danirus / django-comments-xtd

A pluggable Django comments application with thread support, follow-up notifications, mail confirmation, like/dislike flags, moderation, a ReactJS plugin and Bootstrap 5.3.
https://django-comments-xtd.readthedocs.io
BSD 2-Clause "Simplified" License
594 stars 157 forks source link

Change language #174

Closed ogurec-ogurec closed 4 years ago

ogurec-ogurec commented 4 years ago

How can I change the language? For example, in Russian. In the settings added:

LANGUAGE_CODE = 'ru'

LANGUAGES = (
    ('ru', 'Russian'),
)

Added 1 a file django.po (rus) to the folder:

..\Lib\site-packages\django_comments_xtd\locale\ru\LC_MESSAGES\django.po

Restarted the server, but nothing has changed.

danirus commented 4 years ago

You have to use the compilemessages command of Django. Read the Internationalization page of the docs: here. Remember that the JavaScript plugin uses its own djangojs.po as oppose to the django.po used by the backend.

There's already a django.po for Russian in django-comments-xtd. It was added by @MikerStudio a month ago. However there's no translation for the plugin yet.

On changing the language, if you want your site to be in Russian, change the LANGUAGE_CODE setting in your settings.py module:

LANGUAGE_CODE = 'ru'

If you want to support multiple languages, I recommend you to read the pages under the Internationalization topic in the office Django site, it's a lot, but it's worth reading. You can also see how it is done in the example comp site that comes with django-comments-xtd:

ogurec-ogurec commented 4 years ago

thanks