From c27d6f53af5c7a0a7dfdbd2aad13802ac591844d Mon Sep 17 00:00:00 2001 From: Sigmabrogz Date: Wed, 18 Mar 2026 18:09:37 +0000 Subject: [PATCH 1/3] feat: use i18n for hardcoded strings in components and pages Closes #2128 --- app/components/Package/SkillsModal.vue | 10 ++----- app/components/diff/ViewerPanel.vue | 20 ++++++------- app/pages/blog/index.vue | 4 +-- .../[packageName]/v/[versionRange].vue | 10 +++---- i18n/locales/en.json | 28 +++++++++++++++++-- 5 files changed, 45 insertions(+), 27 deletions(-) diff --git a/app/components/Package/SkillsModal.vue b/app/components/Package/SkillsModal.vue index 65d1fb57ac..84b29f47e0 100644 --- a/app/components/Package/SkillsModal.vue +++ b/app/components/Package/SkillsModal.vue @@ -67,9 +67,7 @@ function getWarningTooltip(skill: SkillListItem): string | undefined { : 'border-transparent text-fg-subtle hover:text-fg' " @click="selectedMethod = 'skills-npm'" - > - skills-npm - + >{{ $t('package.skills.method_npm') }} + >{{ $t('package.skills.method_cli') }} @@ -100,7 +96,7 @@ function getWarningTooltip(skill: SkillListItem): string | undefined { scope="global" >
- + - +
- +
- Change ratio + {{ $t('compare.viewer.change_ratio') }} {{ maxChangeRatio.toFixed(2) }}
@@ -219,14 +219,14 @@ function getCodeUrl(version: string): string {
- +
- Diff distance + {{ $t('compare.viewer.diff_distance') }} {{ maxDiffDistance }}
@@ -252,14 +252,14 @@ function getCodeUrl(version: string): string {
- +
- Char edits + {{ $t('compare.viewer.char_edits') }} {{ inlineMaxCharEdits }}
@@ -317,14 +317,14 @@ function getCodeUrl(version: string): string {
-

Loading diff...

+

{{ $t('compare.viewer.loading_diff') }}

- {{ loadError?.message || 'Failed to load diff' }} + {{ loadError?.message || $t('compare.viewer.failed_to_load_diff') }}

-

No posts found.

+

{{ $t('blog.no_posts') }}

diff --git a/app/pages/diff/[[org]]/[packageName]/v/[versionRange].vue b/app/pages/diff/[[org]]/[packageName]/v/[versionRange].vue index 336843087e..070d2b1466 100644 --- a/app/pages/diff/[[org]]/[packageName]/v/[versionRange].vue +++ b/app/pages/diff/[[org]]/[packageName]/v/[versionRange].vue @@ -135,21 +135,21 @@ useSeoMeta({

- Invalid comparison URL. Use format: /diff/package/v/from...to + {{ $t('compare.invalid_url') }}

- Go to package + {{ $t('compare.go_to_package') }}
-

Comparing versions...

+

{{ $t('compare.comparing_versions') }}

diff --git a/i18n/locales/en.json b/i18n/locales/en.json index 842d04d54a..5c896904f7 100644 --- a/i18n/locales/en.json +++ b/i18n/locales/en.json @@ -110,7 +110,9 @@ "like_count": "{count} like | {count} likes", "repost_count": "{count} repost | {count} reposts", "more_replies": "{count} more reply... | {count} more replies..." - } + }, + "no_excerpt": "No Excerpt Available", + "no_posts": "No posts found." }, "settings": { "title": "settings", @@ -286,7 +288,9 @@ "refs": "{count} ref | {count} refs", "assets": "{count} asset | {count} assets" }, - "view_source": "View source" + "view_source": "View source", + "method_npm": "skills-npm", + "method_cli": "skills CLI" }, "links": { "main": "main", @@ -1205,7 +1209,25 @@ "files_button": "Files", "select_file_prompt": "Select a file from the sidebar to view its diff", "close_files_panel": "Close files panel", - "filter_files_label": "Filter files by change type" + "filter_files_label": "Filter files by change type", + "invalid_url": "Invalid comparison URL. Use format: /diff/package/v/from...to", + "go_to_package": "Go to package", + "comparing_versions": "Comparing versions...", + "failed_to_compare": "Failed to compare versions", + "back_to_package": "Back to package", + "viewer": { + "options": "Options", + "merge_modified_lines": "Merge modified lines", + "word_wrap": "Word wrap", + "change_ratio": "Change ratio", + "diff_distance": "Diff distance", + "char_edits": "Char edits", + "view_file": "View file", + "loading_diff": "Loading diff...", + "failed_to_load_diff": "Failed to load diff", + "view_in_code_browser": "View in code browser", + "no_content_changes": "No content changes detected" + } }, "pds": { "title": "npmx.social", From ae0348fab3ee8a60faace4f128985bc52b2edec7 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:11:00 +0000 Subject: [PATCH 2/3] [autofix.ci] apply automated fixes --- app/components/Package/SkillsModal.vue | 8 ++++++-- app/components/diff/ViewerPanel.vue | 5 ++++- app/pages/diff/[[org]]/[packageName]/v/[versionRange].vue | 8 ++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/components/Package/SkillsModal.vue b/app/components/Package/SkillsModal.vue index 84b29f47e0..f633f0d89e 100644 --- a/app/components/Package/SkillsModal.vue +++ b/app/components/Package/SkillsModal.vue @@ -67,7 +67,9 @@ function getWarningTooltip(skill: SkillListItem): string | undefined { : 'border-transparent text-fg-subtle hover:text-fg' " @click="selectedMethod = 'skills-npm'" - >{{ $t('package.skills.method_npm') }} + > + {{ $t('package.skills.method_npm') }} + + > + {{ $t('package.skills.method_cli') }} +
diff --git a/app/components/diff/ViewerPanel.vue b/app/components/diff/ViewerPanel.vue index 64a8129a11..7c4c5f5c49 100644 --- a/app/components/diff/ViewerPanel.vue +++ b/app/components/diff/ViewerPanel.vue @@ -174,7 +174,10 @@ function getCodeUrl(version: string): string { >
- + diff --git a/app/pages/diff/[[org]]/[packageName]/v/[versionRange].vue b/app/pages/diff/[[org]]/[packageName]/v/[versionRange].vue index 070d2b1466..613ce968f2 100644 --- a/app/pages/diff/[[org]]/[packageName]/v/[versionRange].vue +++ b/app/pages/diff/[[org]]/[packageName]/v/[versionRange].vue @@ -137,7 +137,9 @@ useSeoMeta({

{{ $t('compare.invalid_url') }}

- {{ $t('compare.go_to_package') }} + {{ + $t('compare.go_to_package') + }}
@@ -149,7 +151,9 @@ useSeoMeta({ From f9ac6fc08b0c67924e6cf75725a9a17852489417 Mon Sep 17 00:00:00 2001 From: Sigmabrogz Date: Thu, 19 Mar 2026 08:07:07 +0000 Subject: [PATCH 3/3] fix(i18n): apply remaining string translations in ViewerPanel as per code review --- app/components/diff/ViewerPanel.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/components/diff/ViewerPanel.vue b/app/components/diff/ViewerPanel.vue index 7c4c5f5c49..a2bfa74b07 100644 --- a/app/components/diff/ViewerPanel.vue +++ b/app/components/diff/ViewerPanel.vue @@ -145,7 +145,7 @@ function getCodeUrl(version: string): string { @click="showOptions = !showOptions" > - Options + {{ $t('compare.viewer.options') }} - View file + {{ $t('compare.viewer.view_file') }}
@@ -335,7 +335,7 @@ function getCodeUrl(version: string): string { :to="getCodeUrl(toVersion)" class="text-xs text-fg-muted hover:text-fg underline" > - View in code browser + {{ $t('compare.viewer.view_in_code_browser') }}
@@ -345,7 +345,7 @@ function getCodeUrl(version: string): string { 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') }}