Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fallback chain for sibling specificity in languages #37

Open
XAMPPRocky opened this issue Aug 8, 2022 · 0 comments
Open

Fallback chain for sibling specificity in languages #37

XAMPPRocky opened this issue Aug 8, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@XAMPPRocky
Copy link
Owner

So basically going for the proposed solution from #1 this results in the fallback key to be present in the base zh language.

I am not sure if we should change that to have a resolution order like:
zh-CN -> zh-CN, zh-TW, zh, default_fallback

The question then would be: What to do with a specificity higher than 2?
de-DE-1996 -> de-DE-1996, [de-CH-VARIANT], de-DE, de-CH, de, default_fallback?
Not sure how the best approach should be.
If we consider the current state as a linked list, other language regions like CH would then be siblings in a tree.
The question is how many branches of the main path between the requested one and the root should be visited.

fallback <- de <- de-DE <- de-DE-1996
               Î         ^- de-DE-VARIANT2          
               \ de-CH <- de-CH-VARIANT

In which order should they be visited?

And what about multiple requested languages? (possibly with weights), can we ignore them for now? I guess currently one can argue that this is only localization resolution and language negotiation should be done ahead.

Originally posted by @valkum in #35 (comment)

@XAMPPRocky XAMPPRocky added enhancement New feature or request help wanted Extra attention is needed labels Aug 8, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant