[9.x] Add auto language fallback to less specific localization #42258
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi everyone,
A bit of context first: as my team is preparing to undertake a huge effort on localization we've been looking for specialized software and personal online and we figured out that the vast majority charge either by word or "target translation key" (as key x language).
Here's our problem: we plan to support locales like
en_US
anden_GB
that would have most of the translations keys exactly the same, having those fallback toen
could reduce drastically the number of strings in the end. As this is currently possible using the current fallback config when we addpt_BR
andpt_PT
to the mix suddenly there's no way to have those fallback topt
.This proposal adds auto fallback when the locale is something like
en_US
oren-US
to a less specificen
. It could also fallback something likeen_US-custom
toen_US
thenen
.As a downside, I realize that this could add several CPU cycles to process the regular expression and even worse, a lot more of I/O.