i18n-embed: Regionless languages (Esperanto)
I have software that is localized into, among others, Esperanto. The official Esperanto language identifier is eo without any region (like the -US in en-US). unic_langid can do langid!("eo") just fine, but it seems that having an eo/ directory within the i18n/ dir that i18n-embed expects isn't detected. Turning on logs, I see:
19:21:46 [DEBUG] (1) i18n_embed: Attempting to load language file: "de-DE/aura.ftl"
19:21:46 [DEBUG] (1) i18n_embed::fluent: Loaded language file: "de-DE/aura.ftl" for language: "de-DE"
19:21:46 [DEBUG] (1) i18n_embed: Attempting to load language file: "en-US/aura.ftl"
19:21:46 [DEBUG] (1) i18n_embed::fluent: Loaded language file: "en-US/aura.ftl" for language: "en-US"
19:21:46 [DEBUG] (1) i18n_embed: Attempting to load language file: "ja-JP/aura.ftl"
19:21:46 [DEBUG] (1) i18n_embed::fluent: Loaded language file: "ja-JP/aura.ftl" for language: "ja-JP"
If I change the name to eo-EO (not its real code), i18n-embed can now detect it and I see:
19:17:51 [DEBUG] (1) i18n_embed: Attempting to load language file: "eo-EO/aura.ftl"
19:17:51 [DEBUG] (1) i18n_embed::fluent: Loaded language file: "eo-EO/aura.ftl" for language: "eo-EO"
Looking in my /usr/share/i18n/locales, it seems that eo and i18n are the only two locales given that don't have a region, so it makes sense that this is an edge case. Can i18n-embed be made to support regionless LanguageIdentifiers?
Now that I think, wouldn't fixing this allow for regionless localizations in general? Say Chinese which has several official zh-* codes.
Hi there, any thoughts?
Hi @fosskers sorry for the slow reply, I'll make sure to take a look at this one soon
One of the tests is using ru without a region https://github.com/kellpossible/cargo-i18n/tree/master/i18n-embed/i18n/ftl/ru so something interesting is going on here!
does this problem occur for you with other region-less language identifiers, or only eo?
I haven't tried it with any others, but I could try it, re: https://github.com/kellpossible/cargo-i18n/issues/52#issuecomment-739350079
@fosskers I'm currently working on an example for this repo that we could modify to reproduce the problem in a test
Perhaps this example could be modified, so the problem is reproduced in a test https://github.com/kellpossible/cargo-i18n/tree/master/i18n-embed/examples/library-fluent
@fosskers I haven't been able to reproduce this problem for myself yet, do you think we should close this issue?
Let's leave it open for now, I'm going to be back developing the project soon that needs it.
Okay, no worries! We'll leave it open :slightly_smiling_face: