Skip to content

fix(i18n): add missing translation keys#2140

Merged
MatteoGabriele merged 3 commits intonpmx-dev:mainfrom
nadaniels:fix-2128-missing-translation-keys
Mar 19, 2026
Merged

fix(i18n): add missing translation keys#2140
MatteoGabriele merged 3 commits intonpmx-dev:mainfrom
nadaniels:fix-2128-missing-translation-keys

Conversation

@nadaniels
Copy link
Contributor

🔗 Linked issue

Resolves #2128
Related PR: #2134

📚 Description

This PR addresses the linked issue by adding missing translation keys and removing hardcoded text, including 22 new keys across 7 files.

Additional Notes:

  • Removes the fallback excerpt text in the blog list, since the blog description is enforced by the schema.
  • Purposefully does not add a key to skills-npm in the SkillsModal as mentioned in the linked issue, since it's an official package name. A key for skills CLI was added, following the existing pattern for npm CLI.

I'm not sure how best to proceed with the other PR that was opened while this was in progress. Happy to combine efforts if that's the best way to move forward, given additional guidance. Thanks!

@vercel
Copy link

vercel bot commented Mar 18, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Mar 19, 2026 1:46pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 19, 2026 1:46pm
npmx-lunaria Ignored Ignored Mar 19, 2026 1:46pm

Request Review

@github-actions
Copy link

github-actions bot commented Mar 18, 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
i18n/locales/en.json Source changed, localizations will be marked as outdated.
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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e439f9ff-946c-4c18-8e44-6ac7640f6e3a

📥 Commits

Reviewing files that changed from the base of the PR and between e9be2f5 and d9e56fc.

📒 Files selected for processing (3)
  • app/pages/diff/[[org]]/[packageName]/v/[versionRange].vue
  • i18n/locales/en.json
  • i18n/schema.json
✅ Files skipped from review due to trivial changes (2)
  • i18n/locales/en.json
  • i18n/schema.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/pages/diff/[[org]]/[packageName]/v/[versionRange].vue

📝 Walkthrough

Walkthrough

Replaces numerous hard-coded UI strings with Vue i18n translation bindings across multiple components and pages. Changes include accessibility labels, button text, badges, error/loading messages and sr-only text in Dependencies, ListToolbar, SkillsModal, VersionDistribution, VersionSelector, diff ViewerPanel, blog list page and the compare versions page. Adds corresponding English translation entries and updates i18n schema to include the new keys. No control flow, data fetching, or public API signatures were modified.

Possibly related PRs

Suggested reviewers

  • danielroe
  • serhalp
  • graphieros
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The PR description accurately describes the changeset, explaining what was done (adding missing translation keys), why (resolving issue #2128), and noting specific design decisions.
Linked Issues check ✅ Passed The pull request successfully addresses all objectives from issue #2128 by converting hardcoded UI text to i18n translation keys across the specified files and additional components, adding 22 new translation keys.
Out of Scope Changes check ✅ Passed All changes are within scope of the linked issue #2128. The PR converts hardcoded text to i18n keys in the specified locations plus additional related components, with purposeful design decisions documented in the description.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can generate a title for your PR based on the changes with custom instructions.

Set the reviews.auto_title_instructions setting to generate a title for your PR based on the changes in the PR with custom instructions.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
i18n/locales/en.json (1)

1193-1193: Consider parameterising the expected URL format.

Ending the message with a colon suggests the format example is rendered outside the translation. A {format} placeholder would give translators full control over sentence order.

♻️ Possible tidy-up
-    "version_invalid_url": "Invalid comparison URL. Use format:",
+    "version_invalid_url": "Invalid comparison URL. Use format: {format}",
{{ $t('compare.version_invalid_url', { format: expectedFormat }) }}

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 171a138a-3021-441e-8e7b-a81c096e8960

📥 Commits

Reviewing files that changed from the base of the PR and between 5d8fcf5 and e9be2f5.

📒 Files selected for processing (10)
  • app/components/Package/Dependencies.vue
  • app/components/Package/ListToolbar.vue
  • app/components/Package/SkillsModal.vue
  • app/components/Package/VersionDistribution.vue
  • app/components/VersionSelector.vue
  • app/components/diff/ViewerPanel.vue
  • app/pages/blog/index.vue
  • app/pages/diff/[[org]]/[packageName]/v/[versionRange].vue
  • i18n/locales/en.json
  • i18n/schema.json

Comment on lines +138 to +139
{{ $t('compare.version_invalid_url') }}
<code class="font-mono text-sm">/diff/package/v/from...to</code>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure what the best way to handle this would be, and if we should attempt to add translations for package/from/to. Seems like if we did, we'd want additional brackets or something to separate them out from the "hard-coded" parts of the url (e.g. /diff/[packageName]/v/[from]...[to]). Not totally sure what a i18n key for that would look like.

Copy link
Member

@MatteoGabriele MatteoGabriele Mar 19, 2026

Choose a reason for hiding this comment

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

I do think we need to translate the "from" and "to" strings.
something like $t('compare.version_diff_format', { packageName }) and the string would be:

en.json:

{
  "version_invalid_format": {
    "hint": "Invalid comparison URL. Use format: {0}",
    "format": "/diff/{packageName}/v/from...to"
  },
}

then you use the i18n-t component with something like this

<i18n-t keypath="version_invalid_format.hint" tag="p" for="format">
    <code>{{ $t("version_invalid_format.format") }}</code>
</i18n-t>

I hope this is what you were looking for

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for that! I added the i18n component, and split the format details into additional keys for from and to, while leaving the rest hard-coded (with the packageName interpolated). Hopefully that reduces the potential for introducing errors to the full string in the translations.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! I do find the HTML a bit harder to read, but I think it would probably reduce the number of typos when translating the example.

@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/components/diff/ViewerPanel.vue 71.42% 1 Missing and 1 partial ⚠️
app/components/Package/Dependencies.vue 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Member

@MatteoGabriele MatteoGabriele left a comment

Choose a reason for hiding this comment

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

Thanks for being so responsive and getting this done! 🙏

@MatteoGabriele MatteoGabriele added this pull request to the merge queue Mar 19, 2026
Merged via the queue into npmx-dev:main with commit 69dc57a Mar 19, 2026
20 checks passed
@github-actions github-actions bot mentioned this pull request Mar 19, 2026
@github-actions
Copy link

Thanks for your first contribution, @nadaniels! 💪

We'd love to welcome you to the npmx community. Come and say hi on Discord! And once you've joined, visit npmx.wamellow.com to claim the contributor role.

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.

Add missed translations to terms

2 participants