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

Adding indonesian language leads to admin tabs layout crashing in TabedTranslationAdmin #763

Open
flameai opened this issue Oct 15, 2024 · 3 comments

Comments

@flameai
Copy link

flameai commented Oct 15, 2024

If you add Indonesian (Id) to LANGUAGES in Django and try to use TabbedTranslationAdmin there it looks weird
 2024-10-15 17 44 47

@last-partizan
Copy link
Collaborator

What's in the browser console? Maybe there's some errors?

@flameai
Copy link
Author

flameai commented Oct 17, 2024

It's clear in console log.
I spent my day and figured out the bug:

--- a/modeltranslation/utils.py
+++ b/modeltranslation/utils.py
@@ -80,7 +80,7 @@ build_localized_verbose_name = lazy(_build_localized_verbose_n
ame, str)
 
 
 def _join_css_class(bits: list[str], offset: int) -> str:
-    if "-".join(bits[-offset:]) in settings.AVAILABLE_LANGUAGES + ["en-us"]:
+    if "-".join(bits[-offset:]) in settings.AVAILABLE_LANGUAGES + ["en-us", "ind"]:

It seems you'v forgot to make reverse lookup for Indonesian here in utils.py
Unfortunately I cant make PR to this repo.
It would be nice you make this fix for new version.

Thanks in advance.

last-partizan added a commit that referenced this issue Oct 17, 2024
@last-partizan
Copy link
Collaborator

Thanks for a fix, applied it and released new version. Please check.

@flameai flameai changed the title Adding indonesian language leads to admin tabs layout crushing in TabedTranslationAdmin Adding indonesian language leads to admin tabs layout crashing in TabedTranslationAdmin Oct 17, 2024
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