Translations
ShipWithDjango simplifies the process of managing translations through the use of Django Rosetta, a powerful tool that provides a fully functional graphical interface for handling your application's translations. This means you can easily manage your translations without needing to directly edit .mo
and .po
files. For more details about Django Rosetta, you can visit the Django Rosetta documentation.
Configuration Details
Source Language
The SOURCE_LANGUAGE_CODE
and SOURCE_LANGUAGE_NAME
settings define the primary language of your application, which serves as the source language for all translations.
Rosetta Messages Per Page
The ROSETTA_MESSAGES_PER_PAGE
setting controls how many translation messages are displayed per page in the Rosetta interface. Adjusting this number can help you manage the volume of translations you work with at one time.
Translating Languages
ROSETTA_LANGUAGES
: This setting lists the languages that can be translated from the source language using the admin panel. Note that these languages are only available in the admin panel for translation purposes and are not visible to users on the front end. If you want these languages to be selectable by users, you need to add them to theLANGUAGES
setting.LANGUAGES
: This setting defines the languages available for users to select on the front end of your application. Languages listed here will also be available for translation in the admin panel.
Translation Service API Keys
If you use external translation services, ShipWithDjango supports integration with various providers through API keys. These services can assist in automating or improving the accuracy of your translations.
Yandex Translate: Set the
YANDEX_TRANSLATE_KEY
to use Yandex's translation services.Azure Translator: Set the
AZURE_CLIENT_SECRET
to integrate with Microsoft's Azure Translator service.DeepL: Set the
DEEPL_AUTH_KEY
to use the DeepL translation service.
Adding More Languages
To add more languages for translation:
For Admin Translation Only: Add the language codes to
ROSETTA_LANGUAGES
. These languages will be available in the Rosetta interface but not on the front end.For User Selection: Add the language codes to
LANGUAGES
. This will make them available both in the Rosetta interface and on the front end for users to select.
Last updated