Django-rosetta :Nothing to translate! You haven't specified any languages in your settings file

I'm using django-rosetta 0.10.0 with Django, and I have django.po and django.mo files set up correctly. Everything works fine with Django's built-in translation system, and I can successfully use translations.

However, when I open Rosetta, it cannot find any translations from my local apps or third-party apps (e.g., rosetta or debug-toolbar). Instead, I see the following message in the Rosetta interface:

Nothing to translate!
You haven't specified any languages in your settings file, or haven't yet generated a batch of translation catalogs.

I’ve already set up my translations in the correct paths and ensured the locale files exist. Here's some additional information about my setup:

Rosetta version: 0.10.0 My app structure follows the standard pattern, with locale directories inside each app (e.g., myapp/locale/fa/LC_MESSAGES/django.po). I have defined

LANGUAGE_CODE = 'fa-ir'
LANGUAGES = (
   ('en','English'),
   ('fa','Persian')
)
TIME_ZONE = 'Asia/Tehran'
USE_I18N = True
USE_L10N = True
USE_TZ = True, 

in settings.py.

Do I need to explicitly define LOCALE_PATHS for each of my apps in settings.py, or should Rosetta automatically detect the locale directories inside the apps?

If it’s necessary to specify LOCALE_PATHS, how should I configure it for multiple apps with translations? As I'm a beginner in Django, I would appreciate any guidance on resolving this issue. How can I get Rosetta to detect and display my translation files?

Thanks in advance!

Django-rosetta does not generate translation files, it is essentially an editor for such files (that includes a lot of extra features).

You can thus first generate the initial batch with:

python3 manage.py makemessages --all

This will make the initial set of (untranslated) messages, and then the rosetta webpage can be used to edit these files.

Вернуться на верх