

If you want to let each individual user specify which language they Is set LANGUAGE_CODE and make sure the corresponding messageįiles and their compiled versions (. If all you want is to run Django with your native language all you need to do To set an installation-wide language preference, set LANGUAGE_CODE.ĭjango uses this language as the default translation – the final attempt if noīetter matching translation is found through one of the methods employed by the Should be used – installation-wide, for a particular user, or both. Translations that come with Django – you’ll need to activate translation forīehind the scenes, Django has a very flexible model of deciding which language Once you’ve prepared your translations – or, if you want to use the How Django discovers language preference ¶
#Not generally available to the public itranslate to spanish code#
Otherwise a 204 status code (No Content) will

it doesn’t point to a different host and uses a safe scheme), a If that is found and Django considers it to be a safe Through the LANGUAGE_COOKIE_NAME setting.)Īfter setting the language choice, Django looks for a next parameter in the It also saves the language choice in aĬookie that is named django_language by default. If session support is enabled, the view saves the The view expects to be called via the POST method, with a language Language-independent itself to work correctly. Make sure that you don’t include the above URL within Or -e option to specify the file extensions to examine: Override that default, use the -extension Will generate an error if LOCALE_PATHS is empty.īy default django-admin makemessages examines everyįile that has the.

Message file under the directory listed first in LOCALE_PATHS or A string extractedįrom a file of an app without any locale directory will either go in a That is, a string extracted from a file of an app containing a localeĭirectory will go in a message file under that directory. When you run makemessages from the root directory of your project, theĮxtracted strings will be automatically distributed to the proper message files. It creates (or updates) a message file in theĭirectory locale/LANG/LC_MESSAGES. How Django discovers translations and be sure LOCALE_PATHS The script runs over your project source tree or your application source treeĪnd pulls out all strings marked for translation (see
