Skip to content

fix: lang variant detection#95

Merged
pfeerick merged 2 commits intoEdgeTX:mainfrom
rickard-von-essen:fix-lang-detect
Feb 15, 2025
Merged

fix: lang variant detection#95
pfeerick merged 2 commits intoEdgeTX:mainfrom
rickard-von-essen:fix-lang-detect

Conversation

@rickard-von-essen
Copy link
Copy Markdown
Contributor

@rickard-von-essen rickard-von-essen commented Feb 14, 2025

If the browser reports en-US as the preferred language that was previously disregarded since it doesn't match any translations. This fix strips off the variant, i.e. the part after the dash, so en-US becomes en.

Fixes #94

Also updates dep i18next-browser-languagedetector to v 8.0.2

If the browser reports en-US as the preferred language that was
previously disregarded since it doesn't match any translations. This fix
strips off the variant, i.e. the part after the dash, so en-US becomes en.

Fixes EdgeTX#94
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 14, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 41.43%. Comparing base (966d595) to head (0843671).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/renderer/i18n/config.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #95      +/-   ##
==========================================
- Coverage   41.44%   41.43%   -0.02%     
==========================================
  Files         103      103              
  Lines       12010    12013       +3     
  Branches      521      521              
==========================================
  Hits         4977     4977              
- Misses       7024     7027       +3     
  Partials        9        9              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@freshollie
Copy link
Copy Markdown
Collaborator

Nice, thanks for the fix!

@pfeerick pfeerick changed the title Fix lang detect fix: lang variant detection Feb 15, 2025
@pfeerick
Copy link
Copy Markdown
Member

Indeed. Much appreciated! :)

@pfeerick pfeerick merged commit 011c970 into EdgeTX:main Feb 15, 2025
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.

Buddy auto selects the wrong language

3 participants