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

kiwix::ICULanguageInfo::selfName() default to default locale instead of user locale. #1012

Open
mgautierfr opened this issue Oct 31, 2023 · 4 comments
Assignees
Milestone

Comments

@mgautierfr
Copy link
Member

mgautierfr commented Oct 31, 2023

A locale may be known by ICU but without metadata about it (and so, no way to know how to name it in its own language).

Take for example crh which can be named in French or in English but we have no way to name things in crh (no crh.xml in https://github.com/unicode-org/cldr/blob/main/common/main/)

In this case, locale.getDisplayLanguage(locale, langSelfNameICUString); use the default/fallback language for the display name. It is English for library.kiwix.org but it can be changed with LANG env var.

In this case, we should fallback to the language of UI (specific to the user).

@veloman-yunkan
Copy link
Collaborator

This proposal, as formulated, contradicts the semantics of the language-self-name concept, which is an attribute of the concerned language only and is independent of the client. The right way to address that shortcoming with crh is to add its self-name in the iso639_3 map in languageTools.cpp.

By reading the intention behind this ticket I interpret it as a request to display in the current UI language those languages (coming from /catalog/v2/languages) that don't have a registered self-name. I don't agree with the exception clause. IMHO, if we make that enhancement it may be useful to always display both the self-name of a language and its translation-in-the-current-UI-language (if the latter is available).

@kelson42 kelson42 modified the milestones: 13.4.0, 13.2.0 Mar 3, 2024
@kelson42
Copy link
Collaborator

kelson42 commented May 12, 2024

@mgautierfr @veloman-yunkan Can we now what the exact user visible problem this proposal adresses? Afaik the languages are always displayed in their own langauge and we know how to handle this in case ICU does not have the info!

@mgautierfr
Copy link
Member Author

Can we now what the exact user visible problem this proposal adresses?

In the case of crh, as ICU doesn't have the information to display crh in crh, it display crh in "the default language", so ("Crimean Tatar") for library.kiwix.org.
But if you are in a french UI, it would be better to display it in French ("tatar de Crimée")

We should display a lang in the following language (by preference order):

  • Self language
  • UI language
  • System language (most of the time english, but can be configured with LANG env var)
  • English (?)

Today we are displaying it in:

  • Self language
  • System language

we know how to handle this in case ICU does not have the info!

Yes and we should still use it. But it need a explicit change in our code (and a release).
By using UI language as first fallback, we somehow have a better UI "by default" until we add the info in our own code.

@kelson42
Copy link
Collaborator

kelson42 commented Jun 4, 2024

@mgautierfr Thanks, very clear to me now. I agree.

@kelson42 kelson42 modified the milestones: 13.2.0, 13.3.0 Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants