Repository navigation
Translations cleanup - #155
Merged
Merged
Conversation
Statuses, settings section labels, breadcrumb labels and login errors are defined in one place and passed to t() later through a variable, so the key extractor could not see them and would treat them as unused. Add a tKey() identity function that marks such strings at their definition, and an invoiceStatusLabel() helper so the dashboard and invoice detail page no longer build status keys by capitalizing the raw status. Breadcrumbs also get an explicit "Users" label instead of relying on the capitalized path segment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Match t("key", { params }) calls; the old patterns required the
closing parenthesis right after the key and missed them
- Pick up keys marked with tKey()
- Unescape string literals so keys containing quotes match en.json
- Use ES module imports so the script also runs under plain node, as
package.json declares "type": "module"
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
de, nl and pt-br were still keyed for an older version of the UI: 186
of their keys were no longer used, while 163 keys the current UI uses
were missing and fell back to English. es-ar, es-co and tr were each
missing about 40 newer keys, and es-ar contained 52 duplicate keys.
- Remove keys no longer referenced anywhere in the frontend, from all
locales
- Add missing keys to en.json and translate them for every locale
- Fix the category, unit and tax definition delete confirmations in
de, nl and pt-br, which used {{name}} although the code passes
{{code}}, so the name was always blank
- Show "Español (Argentina)" in its own language in en.json, like the
other language options
- Sort keys, as the translations workflow does
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pt-br translation exists and both frontend and backend accept the locale, but it was missing from the language dropdown in settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@kittendevv This is my first PR where I use AI. I review all changes manually before submitting a PR and I also test everything as good as I can. Hope thats ok for you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clean up and sync UI translations
The locale files had drifted from the frontend. Some locales were still keyed for an older UI, so many strings showed in English. Others were missing recently added strings. The key extraction script also missed several kinds of keys, so running it would have deleted translations that are still in use.
What changed
Locale files synced with the frontend
Dark,Light,Demo mode warning, …).Bug fix: blank names in delete confirmations
In de, nl and pt-br, the delete confirmations for categories, units and tax definitions used
{{name}}, but the code passes{{code}}, so the name was always blank. They now use{{code}}.Portuguese (Brazil) in the language selection
The pt-br translation existed and the backend accepted it, but it wasn't in the settings dropdown. It's there now. "Español (Argentina)" in en.json is also shown in its own language, like the other options.
extract-i18n-keys.jsfinds all keyst("key", { params }). The old patterns only matched when)came right after the key.tKey()(see below).nodetoo (package.json sets"type": "module").tKey()marker for keys passed through variablesSome strings are defined in one place and passed to
t()later through a variable, so the script couldn't see them: invoice statuses, settings section labels, breadcrumb labels and login error messages. They're now wrapped intKey("..."), which does nothing at runtime except mark them for the script.invoiceStatusLabel()helper instead of capitalizing the raw status where it's displayed.For contributors: if you define a string in one place and pass it to
t()later through a variable, wrap it intKey().bun run sync-keyswill then keep it.TRANSLATIONS.mdis regenerated: 332 keys, all locales complete.Notes for reviewers
Testing
bun run sync-keysreports all keys in sync (332 keys, no missing or unused ones).🤖 Generated with Claude Code
The "Notes for reviewers" section says plainly that the translations came from an AI and haven't had native-speaker review, so reviewers know what to check. To publish, run git push -u origin translations-cleanup and then open the PR. Or I can push it and open it with gh pr create if you'd like.