Commit Graph

1 Commits

Author SHA1 Message Date
Aotumuri 1c6aa2bfc3 Improve language code matching logic for locale fallback (#1534)
## Description:

This pull request improves the logic for matching language codes to
supported languages.
Now, the function tries to find the most specific language by splitting
the input code with “-” or “_”, and searching from the longest
combination to the shortest.
If no direct match is found, it searches for all supported language
codes that start with the same base (first two letters) and chooses the
most specific one.
If nothing matches, it defaults to English.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I have read and accepted the CLA aggreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

aorumuri
2025-07-25 14:08:35 -04:00