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

Update gettext code to use two catalogues for language names and UI #328

Merged
merged 3 commits into from
Jun 22, 2023

Conversation

rafaelmardojai
Copy link
Member

Other complementary changes:

  • Stop calling from gettext import gettext as _ since _() should be already installed on the global namespace.
  • Also install gettext() and use it to get lang names and avoid including those strings on the regular UI po file.
  • Move languages list from CLDR to define module as a plain dict.
  • Make google provider use our lang names machinery (BaseProvider.add_lang()) since the ALIASES list is growing.

Depends on dialect-app/po#16.

@rafaelmardojai
Copy link
Member Author

@mufeedali Hey, merged the new structure on po (dialect-app/po#16).

Tested this (installing the flatpak locally) and seems to be working fine, could you test it too? :p

@mufeedali
Copy link
Member

image

Hmm... Passing LANG=ar to simulate an Arabic setup, I cant see the translations for anything other than the languages.

@rafaelmardojai
Copy link
Member Author

Hmm... Passing LANG=ar to simulate an Arabic setup, I cant see the translations for anything other than the languages.

Discovered something funny.

if I run LANG=es flatpak run app.drey.Dialect.Devel I have the same issue as you. But f I just run flatpak run app.drey.Dialect.Devel (my system locale is spanish) I get the translations just right.

@mufeedali
Copy link
Member

Wow, that is interesting... then what would be the correct way to set per-app locale?

@rafaelmardojai
Copy link
Member Author

Wow, that is interesting... then what would be the correct way to set per-app locale?

Not sure. The thing is that it only works if I use LANG=es_PE.UTF-8.

But in the other hand is pretty strange that it gets the langs names right.

@rafaelmardojai
Copy link
Member Author

So changed my system language to Portuguese and the issue happens.

@rafaelmardojai
Copy link
Member Author

Tested again using the LANGUAGE env var and everything works fine.

@mufeedali
Copy link
Member

Okay, looks good. Thanks for confirming!

@mufeedali mufeedali merged commit ed3d813 into main Jun 22, 2023
2 checks passed
@mufeedali mufeedali deleted the cldr branch June 22, 2023 04:53
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

Successfully merging this pull request may close these issues.

None yet

2 participants