Skip to content

feat: use i18n for hardcoded strings in components and pages#2134

Closed
Sigmabrogz wants to merge 3 commits intonpmx-dev:mainfrom
Sigmabrogz:fix/issue-2128
Closed

feat: use i18n for hardcoded strings in components and pages#2134
Sigmabrogz wants to merge 3 commits intonpmx-dev:mainfrom
Sigmabrogz:fix/issue-2128

Conversation

@Sigmabrogz
Copy link

Closes #2128

Replaced hardcoded strings with i18n translations across the following files:

  • app/pages/blog/index.vue
  • app/pages/diff/[[org]]/[packageName]/v/[versionRange].vue
  • app/components/diff/ViewerPanel.vue
  • app/components/Package/SkillsModal.vue

Added missing keys to en.json.

@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 8:09am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 19, 2026 8:09am
npmx-lunaria Ignored Ignored Mar 19, 2026 8:09am

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.

@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 2 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 ⚠️

📢 Thoughts on this report? Let us know!

@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: fd425216-2648-4272-a474-8ee06d712b6d

📥 Commits

Reviewing files that changed from the base of the PR and between ae0348f and f9ac6fc.

📒 Files selected for processing (1)
  • app/components/diff/ViewerPanel.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/components/diff/ViewerPanel.vue

📝 Walkthrough

Walkthrough

Replaces hard-coded English UI strings with Vue i18n translation keys across multiple components and pages: Package Skills modal, diff ViewerPanel, blog index, and package diff page. Adds corresponding English translations in i18n/locales/en.json (blog entries, skills method labels, and a files.viewer group plus related compare/file keys). No logic, routing, data flow, or API changes.

Possibly related PRs

Suggested reviewers

  • danielroe
  • graphieros
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description accurately describes the changes made, mentioning specific files and the replacement of hardcoded strings with i18n translations.
Linked Issues check ✅ Passed All requirements from issue #2128 are met: hardcoded strings in the four specified files have been replaced with i18n translations and corresponding keys were added to en.json.
Out of Scope Changes check ✅ Passed All changes are within scope of issue #2128. The pull request only adds i18n translations to the specified files and translation keys, with no unrelated modifications.

✏️ 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.

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/components/diff/ViewerPanel.vue (1)

148-148: ⚠️ Potential issue | 🟡 Minor

Several strings remain hardcoded despite having i18n keys available.

The following strings should be localised to complete the i18n work for this component:

Line Current Suggested
148 Options {{ $t('compare.viewer.options') }}
301 View file {{ $t('compare.viewer.view_file') }}
338 View in code browser {{ $t('compare.viewer.view_in_code_browser') }}
348 No content changes detected {{ $t('compare.viewer.no_content_changes') }}

These keys already exist in i18n/locales/en.json (lines 1219, 1225, 1228, 1229).

🔧 Proposed fix
             <span class="i-lucide:settings w-3.5 h-3.5" />
-            Options
+            {{ $t('compare.viewer.options') }}
             <span
           class="px-2 py-1 text-xs text-fg-muted hover:text-fg bg-bg-muted border border-border rounded transition-colors"
           target="_blank"
         >
-          View file
+          {{ $t('compare.viewer.view_file') }}
         </NuxtLink>
           class="text-xs text-fg-muted hover:text-fg underline"
         >
-            View in code browser
+            {{ $t('compare.viewer.view_in_code_browser') }}
           </NuxtLink>
       <div
         v-else-if="diff && diff.hunks.length === 0"
         class="py-8 text-center text-fg-muted text-sm"
       >
-        No content changes detected
+        {{ $t('compare.viewer.no_content_changes') }}
       </div>

Also applies to: 301-301, 338-338, 348-348


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8c3bd668-6049-407a-bf86-541c8f6aa8a9

📥 Commits

Reviewing files that changed from the base of the PR and between 77c4570 and ae0348f.

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

@Sigmabrogz
Copy link
Author

I've updated the remaining hardcoded strings in ViewerPanel.vue with their respective i18n keys! Ready for re-review.

@MatteoGabriele
Copy link
Member

Thanks for jumping on this issue! I've just merged #2140 since it was ready to go, but I appreciate you taking the time to work on it. 🙏

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