Skip to content

fix(l10n): fall back to base language - #2619

Closed
susnux wants to merge 1 commit into
mainfrom
fix/l10n
Closed

susnux wants to merge 1 commit into
mainfrom
fix/l10n

Conversation

@susnux

@susnux susnux commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
susnux requested review from Antreesy and skjnldsv September 17, 2026 13:42
@susnux susnux added bug Something isn't working 3. to review labels Sep 17, 2026
@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.21%. Comparing base (0f0b489) to head (1692068).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2619      +/-   ##
==========================================
+ Coverage   61.74%   62.21%   +0.47%     
==========================================
  Files          15       15              
  Lines         481      487       +6     
  Branches      104      107       +3     
==========================================
+ Hits          297      303       +6     
  Misses        165      165              
  Partials       19       19              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread lib/utils/l10n.ts
translations: {
'': Object.fromEntries(translations.map((translation: GettextTranslation) => [translation.msgid, translation])),
},
const needsRename = useBaseLanguage && currentLanguage === language.split('_')[0]

@Antreesy Antreesy Sep 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't the split be the other way around? e.g. we have de.js and de_DE.js, but not de_AT.js; then:

  • useBaseLanguage is true
  • needsRename is false, because currentLanguage is de_AT and both language.split('_')[0] are de
  • better match should be more generic, so de and not de_DE?

I see how it works with current ja and available ja_JP though

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is more a future proof variant of hard renaming done in server:

lang_map = fi_FI: fi, hu_HU: hu, nb_NO: nb, sk_SK: sk, th_TH: th, ja_JP: ja, bg_BG: bg, cs_CZ: cs

We can also just hardcode that map if that makes more sense

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See: #2620

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok, didn't know it's from .tx/config

@susnux susnux closed this Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Public File Request guest identification dialog is not translated into Japanese

2 participants