Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n - where are the translation files located for backend/Django #1129

Open
GennadiLisai opened this issue Dec 6, 2024 · 3 comments
Open

Comments

@GennadiLisai
Copy link

Everything is clear with the translation of the frontend , I can't figure out where the files for i18n translations are located

{% trans "Account Inactive" %} - it is being translated, but where does the translation come from

I didn't find the locale folder with the translation files.

@mgogoulos mgogoulos changed the title i18n - where are the translation files located i18n - where are the translation files located for backend/Django Dec 6, 2024
@mgogoulos
Copy link
Contributor

Hi, I see what you mean. This is the Django translations...
Django, the framework powering the backend of the application, is making it's own translations, which adds to the complexity, it requires to run 2-3 commands to get it.
https://docs.djangoproject.com/en/5.1/topics/i18n/translation/

Do you want to have a look there, and I can assist you with an example maybe so we commit that part to the documentation for others making changes there...

@GennadiLisai
Copy link
Author

Thank you, I thought so

If it's not difficult, an example would be very helpful :)

I'm slowly trying to figure it out and get into the project

@GennadiLisai
Copy link
Author

**Thanks for the tip :)
Installed the gettext package - apt update -apt install gettext
then added LOCALE_PATHS = [path to location] to the settings.py file
then ran the command django-admin makemessages - *.po files appeared in the folders with the languages ​​designated
then test added the translation to the strings
then ran the command django-admin compilemessages - *.mo files appeared in the folders with the languages ​​designated

We'll test it and figure it out further :)**

_Спасибо за подсказку :)
Установил пакет gettext - apt update -apt install gettext
затем в файл settings.py добавил LOCALE_PATHS = [ путь к расположению ]
затем выполнил команду django-admin makemessages - файлы *.po появились в папках с обозначением языков
затем тестово добавил перевод в строки
затем выполнил команду django-admin compilemessages - файлы *.mo появились в папках с обозначением языков

будем тестировать и разбираться дальше :)_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants