Opened 6 years ago

Closed 4 years ago

Last modified 4 years ago

#13860 closed New feature (wontfix)

Translate the output of admin commands

Reported by: tonnzor Owned by: nobody
Component: Internationalization Version: master
Severity: Normal Keywords:
Cc: tonnzor, <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 Changed 6 years ago by tonnzor

Cc: tonn81@… added
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:2 Changed 6 years ago by Preston Holmes

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 Changed 6 years ago by tonnzor

Cc: tonnzor <tonn81@…> added; tonn81@… removed

comment:4 Changed 6 years ago by Ramiro Morales

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

comment:5 Changed 6 years ago by Claude Paroz

Component: TranslationsInternationalization

comment:6 Changed 6 years ago by Łukasz Rekucki

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 Changed 6 years ago by Chris Beaven

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.

comment:8 in reply to:  7 Changed 6 years ago by Claude Paroz

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 Changed 6 years ago by Chris Beaven

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 Changed 6 years ago by tonnzor

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 Changed 5 years ago by Graham King

Severity: Normal
Type: New feature

comment:12 Changed 5 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:13 Changed 5 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:14 Changed 4 years ago by Jannis Leidel

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 Changed 4 years ago by Claude Paroz

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 Changed 4 years ago by Simon Charette

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 Changed 4 years ago by Aymeric Augustin

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 Changed 4 years ago by Claude Paroz

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 Changed 4 years ago by Aymeric Augustin

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?

comment:20 in reply to:  19 Changed 4 years ago by Claude Paroz

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