Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Commit

Permalink
Merge pull request #24 from kumar303/locales
Browse files Browse the repository at this point in the history
explain whitelisted locales in prod
  • Loading branch information
kumar303 committed Jul 11, 2013
2 parents 74ec3bf + 144d892 commit c606686
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion userguide/l10n.rst
Expand Up @@ -11,6 +11,10 @@ Localization works by searching for localizable text in your source code and
extracting (or merging them) into `.po` files in `locale/`.


.. note:: All new locales must be whitelisted before they show up in production.
See `Creating New Locales`_ for details.


Requirements
------------

Expand Down Expand Up @@ -115,11 +119,29 @@ If you want to see these changes in your project::
Creating New Locales
~~~~~~~~~~~~~~~~~~~~

In your projects ``settings.py`` add the new locale to ``KNOWN_LANGUAGES``.
In your project's ``settings.py`` add the new locale to the ``PROD_LANGUAGES``
tuple. During development (when ``settings.DEV`` is True) all locales will show
up if their po files exist but in production, locales will only show up if they exist
in ``PROD_LANGUAGES`` *and* their po files exist.

For example, make Polish and Brazilian Portuguese show up in production when
each locale is fully ready to go live like this::

PROD_LANGUAGES = (
'en-US',
'pl',
'pt-BR',
)


Then run ``./manage.py merge -c`` which will create directories for any locales
that are missing in ``/locale``.

If you want your visible locales in development to match that of production, you
can set dev to use the same whitelist, like this in settings::

DEV_LANGUAGES = PROD_LANGUAGES


Good Practices
--------------
Expand Down

0 comments on commit c606686

Please sign in to comment.