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

add language #7810

Open
pooria-ghorbani opened this issue Feb 13, 2024 · 2 comments
Open

add language #7810

pooria-ghorbani opened this issue Feb 13, 2024 · 2 comments

Comments

@pooria-ghorbani
Copy link

pooria-ghorbani commented Feb 13, 2024

in settings.py add two language , but in djangocms admin toolbar have one language "english"
i want default language ='fa'
(note: fa_IR)

LANGUAGE_CODE = 'fa'

LANGUAGES = [
    ("fa", _("Persian")),
    ("en", _("English")),
    # Add additional languages here
]



CMS_LANGUAGES = {
    1: [
        {
            'code': 'fa',
            'name': _('Persian'),
            'fallbacks': ['en'],
            'public': True,
            'hide_untranslated': False,
            'redirect_on_fallback': True,
        },
        {
            'code': 'en',
            'name': _('English'),
            'fallbacks': ['fa'],
            'public': True,
            'hide_untranslated': False,
            'redirect_on_fallback': True,
        },
    ],
    'default': {
        'fallbacks': ['en', 'fa'],
        'redirect_on_fallback': True,
        'public': True,
        'hide_untranslated': False,
    },
}

why not return 'fa' language ?

#My project in : 
python 3.10
django 4.2.9
djangocms 4.1.0
@fsbraun
Copy link
Sponsor Member

fsbraun commented Mar 14, 2024

@pooria-ghorbani I assume you are referring to the language the toolbar (i.e. menubar) itself is shown. I'm not totally sure to what extend it is translated into Persian.

A user can change their language in "User settings...". Once they've done it, it will stick, even if you change the settings.

For new users, however, the default language should be shown (if their browser does not explicitly request a different language). Can you please check what happens to the toolbar language if you create a new user (with staff status)?

Finaly thought (though I have not tested this): What happens if you swap en and fa in the default fallbacks setting?

I would love to improve support for the Persian language. Please let me know if you would be interested in adding some translations. That would be a great contribution to this community-driven project!

@fsbraun
Copy link
Sponsor Member

fsbraun commented Mar 14, 2024

#7840 indicates that some translations may have gone lost in the release process. Can you try ./manage.py compilemessages to ensure that the existing translations are used by Django?

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

No branches or pull requests

2 participants