Skip to content

Conversation

@trueberryless
Copy link
Contributor

I find it pretty useful when translating to be able to check locally if I have updated everything as sometimes it get's chaotic with a lot of outdated strings...

Therefore I made a little script that can easily be called with pnpm for all the languages, which outputs the missing keys and also which have been removed in the original.

In the future, if we keep the single JSON file, we could integrate this into CI, checking for all i18n PRs if everything has been updated automatically.

Not sure, if this goes into the desired direction of the project, as I saw some other issues and PRs improving i18n in other ways. So just close if this is not desired 👍

@vercel
Copy link

vercel bot commented Jan 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Jan 31, 2026 10:35am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Jan 31, 2026 10:35am
npmx-lunaria Ignored Ignored Jan 31, 2026 10:35am

Request Review

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

I would love to run this in CI and automatically remove unused keys in other languages

in autofix.yml, it would ensure when removing keys from one lang, they are automatically removed from every other one

@trueberryless
Copy link
Contributor Author

I would love to run this in CI and automatically remove unused keys in other languages

in autofix.yml, it would ensure when removing keys from one lang, they are automatically removed from every other one

Should I create the github workflow for that directly here? (Would be later, as I got work to do now until evening or so)

package.json Outdated
"build:lunaria": "node --experimental-transform-types ./lunaria/lunaria.ts",
"dev": "nuxt dev",
"dev:docs": "pnpm run --filter npmx-docs dev --port=3001",
"i18n:check": "node scripts/compare-translations.js",

Choose a reason for hiding this comment

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

we're targeting node 24 right? if so this could be a ts file :p

Copy link
Member

Choose a reason for hiding this comment

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

yes!

Comment on lines 1 to 2
import { existsSync, readFileSync } from 'fs'
import { join } from 'path'

Choose a reason for hiding this comment

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

Suggested change
import { existsSync, readFileSync } from 'fs'
import { join } from 'path'
import { existsSync, readFileSync } from 'node:fs'
import { join } from 'node:path'

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

hope you don't mind - I pushed the refactor 🙏

@github-actions
Copy link

github-actions bot commented Jan 31, 2026

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
lunaria/files/de-DE.json Localization changed, will be marked as complete.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@danielroe danielroe changed the title feat(i18n): convenient key comparison feat(i18n): strip unused i18n keys Jan 31, 2026
@danielroe danielroe enabled auto-merge January 31, 2026 10:35
@trueberryless
Copy link
Contributor Author

hope you don't mind - I pushed the refactor 🙏

Awesome, I'm thankful you like the idea 💡

@danielroe danielroe added this pull request to the merge queue Jan 31, 2026
Merged via the queue into npmx-dev:main with commit 192c398 Jan 31, 2026
14 checks passed
@trueberryless trueberryless deleted the feat/i18n-key-comparision branch January 31, 2026 11:04
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