Opened 14 years ago

Closed 13 years ago

#13451 closed (fixed)

i18n - explain use of LOCALE_PATHS for translations outside of project root and apps

Reported by: dmarble Owned by: nobody
Component: Documentation Version: 1.2-beta
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I scratched my head for a while trying to figure out how to include compiled translations from a directory that is not part of the usual translation traversal, i.e. <project root>/locale and each <app>/locale directory.

I ended up stepping through code for a while to find out that trans_real.py searches for LOCALE_PATHS, a tuple/list that can be explicitly defined in settings.py with extra locale directories for use in translation.

This is important where templates may be kept separately from apps and outside of the main project root folder. For example, in pinax, apps are kept in a separate folder which is referenced in a new project based on pinax, but the templates for those external apps are in the main pinax/ project directory.

An example could be added describing this situation in the translation / i18n documentation pages.

For example:

LOCALE_PATHS = (
    '/path/to/external/locale',
)

Change History (2)

comment:1 by Russell Keith-Magee, 14 years ago

milestone: 1.2
Triage Stage: UnreviewedAccepted

LOCALE_PATHS is mentioned in the settings page, and in the i18n howto; however, neither of these sources are prominently linked from the main i18n docs. There is definitely room for improvement here.

However, I'm taking this off the 1.2 milestone because there is still some drafting effort required. If someone works up an appropriate documentation patch, feel free to bump back to 1.2.

comment:2 by Ramiro Morales, 13 years ago

Resolution: fixed
Status: newclosed

Fixed in r15441.

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