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

Fix language not being recognized correctly #1872

Merged
merged 4 commits into from
Apr 29, 2024

Conversation

ExplodingDragon
Copy link
Contributor

Support for en_US type language formats.

@ExplodingDragon ExplodingDragon changed the title fix language parse Fix language not being recognized correctly Mar 27, 2024
@fiftin
Copy link
Collaborator

fiftin commented Mar 27, 2024

But your changes break other languages.

@ExplodingDragon
Copy link
Contributor Author

ExplodingDragon commented Apr 17, 2024

When an exact match cannot be made, the country code will be removed and the match will continue. The test doesn't seem to be a problem.

ru

图片

fr

图片

zh-cn

图片

@@ -670,6 +670,11 @@ const LANGUAGES = {
function getLangInfo(locale) {
let res = LANGUAGES[locale];

// failback short i18n
if (!res) {
res = LANGUAGES[locale.split('_')[0]];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should catch the case mentioned by @fiftin

@ExplodingDragon ExplodingDragon requested a review from fiftin April 22, 2024 00:48
@fiftin fiftin merged commit c762dcd into semaphoreui:develop Apr 29, 2024
4 checks passed
@ExplodingDragon ExplodingDragon deleted the bugfix-i18n-parse branch April 30, 2024 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants