Skip to content

🔧 Use Node.js 22 and bump i18next-cli#1280

Merged
Schneegans merged 3 commits intokando-menu:mainfrom
LitoMore:i18next-cli
Apr 25, 2026
Merged

🔧 Use Node.js 22 and bump i18next-cli#1280
Schneegans merged 3 commits intokando-menu:mainfrom
LitoMore:i18next-cli

Conversation

@LitoMore
Copy link
Copy Markdown
Contributor

@LitoMore LitoMore commented Feb 13, 2026

Changes

  • Use Node.js 22 for GitHub Actions
  • Migrate i18next-parser to i18next-cli

The legacy i18next-parser package blocked us from upgrading the Node.js version because it does not support Node.js 22 or later. The i18next team has deprecated the i18next-parser and recommends users migrate to i18next-cli. I migrated it to i18next-cli manually and made some cleanup (comments, configuration) using AI (Opus 4.6).

Those translation files have been changed because the i18next-cli supports sorting keys. I just used its default configurations. Sorting keys can make the content in translation files consistent, so I kept it. Please let me know if you have any thoughts.

@Schneegans
Copy link
Copy Markdown
Contributor

Thanks for looking into this. However, missing translations are now inserted as "" in the translation files which makes them disappear in the GUI. Is it possible to fallback to the English strings again?

Also, it's not very nice that we now have to list the locales in the i18next.config.ts. This way, whenever someone adds a new language on weblate, we need to update this list manually. Is there some way around this?

@LitoMore
Copy link
Copy Markdown
Contributor Author

Thanks for looking into this. However, missing translations are now inserted as "" in the translation files which makes them disappear in the GUI. Is it possible to fallback to the English strings again?

The i18next-cli does not support it. But we can make a workaround for the target. I've created a script to snapshot the pre-extraction file so we can correctly omit newly added empty strings.

Also, it's not very nice that we now have to list the locales in the i18next.config.ts. This way, whenever someone adds a new language on weblate, we need to update this list manually. Is there some way around this?

I've changed those hardcoded locale codes to a glob script for locale detection.

@LitoMore
Copy link
Copy Markdown
Contributor Author

@Schneegans I didn't reformat the locale file because it often causes conflicts.

We can run the i18n script when you're ready to merge. Or run the i18n script after the PR merge.

Copy link
Copy Markdown
Contributor

@Schneegans Schneegans left a comment

Choose a reason for hiding this comment

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

I think this looks good now! Thank you so much for looking into this!

@Schneegans Schneegans merged commit a76d207 into kando-menu:main Apr 25, 2026
11 checks passed
@LitoMore LitoMore deleted the i18next-cli branch April 25, 2026 19:53
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.

2 participants