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

Two Serbian locales shows the same content #766

Open
rt-em opened this issue Jan 19, 2024 · 3 comments
Open

Two Serbian locales shows the same content #766

rt-em opened this issue Jan 19, 2024 · 3 comments

Comments

@rt-em
Copy link

rt-em commented Jan 19, 2024

I'm creating a new website. One languages of this website is Serbian. But there is one feature of Serbian language - it has two scripts: cyrillic and latin and both are widely used.

I created two locales: one for latin script and one for cyrillic.

I added this to settings

LANGUAGE_CODE = "sr-Latn"
WAGTAIL_CONTENT_LANGUAGES = LANGUAGES = [
    ('sr-Latn', "Srpski Latin"),
    ('sr-Cyrl', "Српски"),
    ('en', "English"),
]

The rest of setup is done staight according to Wagtail-localize documentation.

Expected behavior

/sr-latn/somepage/ - gives latin Serbian
/sr-cyrl/somepage/ - gives cyrillic Serbian

How this works for real

/sr-latn/somepage/ - gives latin Serbian
/sr-cyrl/somepage/ - also gives latin Serbian

In admin interface I can turn on all three locales, set up syncing between locales. And in admin I see three site trees for all three locales. I can create page within every locale and get unique translations for every locale of the same page. At this point everything seems good.

But when I'm going to the website both prefix pages /sr-latn/somepage/ and /sr-cyrl/somepage/ gives me only latin variant of page.
If I will push "bird button" -> Edit this page on /sr-latn/somepage/ and on /sr-cyrl/somepage/ both link leads me to the same latin page in admin, even if both variants of page(latin and cyrillic) are exists.

For example:
/admin/pages/19/edit/ - latin Serbian
/admin/pages/21/edit/ - cyrillic Serbian
But /sr-latn/somepage/ and /sr-cyrl/somepage/ refers only /admin/pages/19/edit/

I don't know is this the issue of wagtail-localize or wagtail, or may be django itself, but I'll be very appreciate if someone help me make everything works.

Upd I forget to mention, there is a workaround, instead of Latin Serbian it is posible to specify Croatian locale. But it is not desired setup, because languages are not identical. For example names of the months are completely different in this languages, and thats produces another issue for blog pages...

@zerolab
Copy link
Collaborator

zerolab commented Jan 19, 2024

I suspect this is a Django issue since all the routing happens via i18n_patterns as described in https://docs.wagtail.org/en/stable/advanced_topics/i18n.html#adding-a-language-prefix-to-urls. Do you get the same with if you use sr-latn for LANGUAGE_CODE, and sr-latn and sr-cyrl for WAGTAIL_CONTENT_LANGUAGES and LANGUAGES?

@rt-em
Copy link
Author

rt-em commented Jan 19, 2024

Do you get the same with if you use sr-latn for LANGUAGE_CODE, and sr-latn and sr-cyrl for WAGTAIL_CONTENT_LANGUAGES and LANGUAGES?

Yes, sr-latn and sr-cyrl gives the same result...

@rt-em
Copy link
Author

rt-em commented Jan 19, 2024

As I studied this is not so common that two scripts (and two locales as the result) corresponds to one language.
And funny thing, that Django distinguishes Latin and Cyrillic alphabet for Serbian. And It seems that i18n uses just 'default' Serbian for both Latin and Cyrillic requests.

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