Code

Opened 5 years ago

Closed 3 years ago

Last modified 2 years ago

#10869 closed New feature (wontfix)

./manage.py makemessages should let users specify input directories

Reported by: filipnoetzel Owned by:
Component: Internationalization Version: 1.0
Severity: Normal Keywords: makemessages i18n
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When building an multilingual webapp using django reusable apps, one needs to translate them as well (and include the translation strings in the .po file) ..

Unfortunately ./manage.py makemessages only searches the current directory for translatable strings. Suppose, your directory setup is like

bin/
bin/activate
lib/
lib/python2.6/
lib/python2.6/site-packages/
lib/python2.6/site-packages/contact_form/
lib/python2.6/site-packages/registration/
source/
source/manage.py
source/settings.py
source/locale/

There is no way including the needed translations for django-contact-form and django-registration in your .po-files using ./manage.py makemessages

The attached patch takes care of that by adding a "-D" flag (modeled after xgettext's -D flag - http://linux.die.net/man/1/xgettext ) that takes the input directories as parameters. If none is specified the default behaviour (searching in the current directory) is unchanged.

Attachments (1)

0001-.-manage.py-makemessages-add-D-switch-for-specifyi.patch (3.7 KB) - added by filipnoetzel 5 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 5 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

This is potentially a fairly dangerous idea, since it will pull in no end of potentially duplicated strings. Translating on a per-application basis is to be encouraged (and then contributed back to the application), rather than on a "project" level, since it avoid precisely this problem.

I believe this is a semi-duplicate of another ticket in the internationalization component, because I know Marc Garcia and I have discussed this before.

comment:2 Changed 4 years ago by jezdez

  • Owner jezdez deleted

comment:3 Changed 3 years ago by SmileyChris

  • Severity set to Normal
  • Type set to New feature

comment:4 Changed 3 years ago by jezdez

  • Resolution set to wontfix
  • Status changed from new to closed

While we talked about how translations should be discovered before 1.3, Ramiro and me decided to deprecate project level translations and promote app level translations and the LOCALE_PATHS setting in the future. Closing as wontfix since those options allow dynamic input directories, too.

comment:5 Changed 2 years ago by jpic

  • Easy pickings unset
  • UI/UX unset

Question: what if I want to override a translation from an external app for a particular project ? Do I have to fork the app ?

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.