Opened 14 years ago

Closed 11 years ago

Last modified 11 years ago

#13860 closed New feature (wontfix)

Translate the output of admin commands

Reported by: Artem Skoretskiy Owned by: nobody
Component: Internationalization Version: dev
Severity: Normal Keywords:
Cc: Artem Skoretskiy, <tonn81@…> Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

We need to enable i18n and actually translate admin commands (shell, syncdb, dbshell, reset, etc.).

That's surprising that having excellent i18n tool and all needed settings (settings.LANGUAGE_CODE) users still have to use Django in English in time they may use it in they native language.

That makes a big difference for users. That is fine to enter commands in English but texts must be in defined locale.

Change History (20)

comment:1 by Artem Skoretskiy, 14 years ago

Cc: tonn81@… added

comment:2 by Preston Holmes, 14 years ago

Component: django-admin.pyTranslations
milestone: 1.3
Triage Stage: UnreviewedSomeday/Maybe

There is a cart and horse issue. The language is in the settings.py file, which isn't read until the command is executed. The autocomplete code would get very messy trying to sort this out.

This would take someone to work up a generic approach for some sort of command alias lookup.

comment:3 by Artem Skoretskiy, 13 years ago

Cc: Artem Skoretskiy <tonn81@…> added; tonn81@… removed

comment:4 by Ramiro Morales, 13 years ago

I think the OP was talking about the description and help text shown for management commands not the command names themselves.

comment:5 by Claude Paroz, 13 years ago

Component: TranslationsInternationalization

comment:6 by Łukasz Rekucki, 13 years ago

Triage Stage: Someday/MaybeAccepted

I'll switch this to Accepted, because I think it's a good idea.

There is actually no need to read the settings.LANGUAGE_CODE - django-admin.py is command line tool, so it should probably just take the locale from environment. The OP did note that his fine with only translating help texts (and possibly error messages, but that's a bit of problem), but leaving command names in English.

comment:7 by Chris Beaven, 13 years ago

Triage Stage: AcceptedDesign decision needed

Actually, I'm not so sure this is a good idea. Most command line utilities don't translate their arguments and I'm not sure we should either. Bring this up in the django developers group.

in reply to:  7 comment:8 by Claude Paroz, 13 years ago

Replying to SmileyChris:

Most command line utilities don't translate their arguments.

You're probably wrong here. At least most of GNOME command line utilities are translating their 'usage' output.

comment:9 by Chris Beaven, 13 years ago

Summary: Translate admin commandsTranslate the output of admin commands
Triage Stage: Design decision neededAccepted

Oh, right - I think I got confused between translating the output and translating the commands themselves.

Yes, translating the output seems fine.

comment:10 by Artem Skoretskiy, 13 years ago

My suggestion was to translate output of ./manage.py XXX commands - without translating commands or arguments.

Using environment language is a great idea as I always may configure this for myself. However, in some environments it's not possible (shared hosting) - so we should use settings.LANGUAGE_CODE before trying to apply ENV language.

Maybe it makes sense to define another settings (ADMIN_LANGUAGE_CODE) or argument (--lang=ru) for this (let's say my site is in English but I want to admin it in Russian).

comment:11 by Graham King, 13 years ago

Severity: Normal
Type: New feature

comment:12 by Aymeric Augustin, 12 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:13 by Aymeric Augustin, 12 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:14 by Jannis Leidel, 11 years ago

Resolution: wontfix
Status: newclosed

We've discussed this at the sprint and aaugustin, apollo13 and me all agreed that this is a bad idea. The translation in the admin is end user facing, while django-admin.py/manage.py is only for developers. We're also not translating the exception messages that are developer facing.

comment:15 by Claude Paroz, 11 years ago

I must say that I strongly disagree, I don't know why we shouldn't be able to output messages in other languages than English. I also disagree on the fact that output of all commands are only for developers (most are, sure), and even then, why couldn't developper receive the output or help on commands in their own language if they like it (and if their project's default language is not English)?

I know this is always controversial, some thinks that being a developper implies to know English well, that language being the lingua franca of computing. I'm personally on the side of those thinking that everyone has the right to work in one's own language (unfortunately a minority).

comment:16 by Simon Charette, 11 years ago

I agree with claudep.

We should atleast be able to output messages based on the defined LANG environment variable just like most *nix command do nowadays.

(django)simon@simon-laptop:~$ cd inexistant
bash: cd: inexistant: Aucun fichier ou dossier de ce type

comment:17 by Aymeric Augustin, 11 years ago

If you implement that, please provide a way to turn it off, and preferably turn it off by default.

100% of my coding activity is in English and it's horribly distracting when a command outputs French — all the more since many technical terms don't have reasonable translations.

FWIW, on OS X, I haven't encountered any command that translates its output. It would be very distracting if django-admin.py did.

comment:18 by Claude Paroz, 11 years ago

We are not there yet, but I can imagine the language would be settings.LANGUAGE_CODE, 'en-us' by default and overridable with custom settings.

comment:19 by Aymeric Augustin, 11 years ago

For me, this isn't even related to the Django project's language. Python's syntax is in English, the stdlib is in English, >90% of the ecosystem is in English, virtually every relevant web page is in English. When I'm developing, I'm thinking in English, and seeing French is unexpected and disruptive.

Regarding Simon's example — sure, cd's output is in French, but then why is the command still called cd? Shouldn't it be cr or cdr for changer de répertoire?

in reply to:  19 comment:20 by Claude Paroz, 11 years ago

I knew this was a hot topic :-), but...
Replying to aaugustin:

Regarding Simon's example — sure, cd's output is in French, but then why is the command still called cd? Shouldn't it be cr or cdr for changer de répertoire?

You're mixing the language syntax with language output, but I'm sure you know that. No, we are not going to ask for a translated Python API :-)

Like it or not, there are people that don't know English well and yet they like programming. They buy programming books in their own language, and I think we should try to do our best to ease access to Django programming for those people as well.

Note: See TracTickets for help on using tickets.
Back to Top