Skip to content

fix(i18n): extract untranslated hardcoded strings#2181

Merged
MatteoGabriele merged 1 commit intomainfrom
serhalp/translate-pkg-docs
Mar 21, 2026
Merged

fix(i18n): extract untranslated hardcoded strings#2181
MatteoGabriele merged 1 commit intomainfrom
serhalp/translate-pkg-docs

Conversation

@serhalp
Copy link
Member

@serhalp serhalp commented Mar 21, 2026

🔗 Linked issue

N/A (I think)

🧭 Context

Found some untranslated hardcoded user-visible English strings

📚 Description

Extract them and translate to French

@vercel
Copy link

vercel bot commented Mar 21, 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 21, 2026 5:26pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 21, 2026 5:26pm
npmx-lunaria Ignored Ignored Mar 21, 2026 5:26pm

Request Review

@github-actions
Copy link

github-actions bot commented Mar 21, 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/ar.json Localization changed, will be marked as complete.
i18n/locales/az-AZ.json Localization changed, will be marked as complete.
i18n/locales/bg-BG.json Localization changed, will be marked as complete.
i18n/locales/bn-IN.json Localization changed, will be marked as complete.
i18n/locales/cs-CZ.json Localization changed, will be marked as complete.
i18n/locales/de-DE.json Localization changed, will be marked as complete.
i18n/locales/en.json Source changed, localizations will be marked as outdated.
i18n/locales/es.json Localization changed, will be marked as complete.
i18n/locales/fr-FR.json Localization changed, will be marked as complete.
i18n/locales/hi-IN.json Localization changed, will be marked as complete.
i18n/locales/hu-HU.json Localization changed, will be marked as complete.
i18n/locales/id-ID.json Localization changed, will be marked as complete.
i18n/locales/it-IT.json Localization changed, will be marked as complete.
i18n/locales/ja-JP.json Localization changed, will be marked as complete.
i18n/locales/kn-IN.json Localization changed, will be marked as complete.
i18n/locales/mr-IN.json Localization changed, will be marked as complete.
i18n/locales/nb-NO.json Localization changed, will be marked as complete.
i18n/locales/ne-NP.json Localization changed, will be marked as complete.
i18n/locales/pl-PL.json Localization changed, will be marked as complete.
i18n/locales/pt-BR.json Localization changed, will be marked as complete.
i18n/locales/ru-RU.json Localization changed, will be marked as complete.
i18n/locales/ta-IN.json Localization changed, will be marked as complete.
i18n/locales/te-IN.json Localization changed, will be marked as complete.
i18n/locales/tr-TR.json Localization changed, will be marked as complete.
i18n/locales/uk-UA.json Localization changed, will be marked as complete.
i18n/locales/zh-CN.json Localization changed, will be marked as complete.
i18n/locales/zh-TW.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.

@codecov
Copy link

codecov bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@serhalp serhalp force-pushed the serhalp/translate-pkg-docs branch from cf190cf to db14455 Compare March 21, 2026 17:24
@serhalp serhalp marked this pull request as ready for review March 21, 2026 17:29
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 21, 2026

📝 Walkthrough

Walkthrough

This pull request refactors the internationalisation layer for settings UI labels and package documentation. The accent_colors and background_themes i18n keys were restructured from simple strings to objects with a label property in all 24 locale files. Vue components and composables were updated to reference these new label keys. The package-docs page was modified to use i18n translations for previously hardcoded English strings. The i18n schema was updated to validate the new structure and define the additional package documentation keys.

Possibly related PRs

Suggested reviewers

  • graphieros
  • danielroe
  • ghostdevv
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The PR description accurately describes the changeset: extracting hardcoded English strings and translating them, which aligns with the actual modifications across UI components, composables, and i18n locale files.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch serhalp/translate-pkg-docs

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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/pages/package-docs/[...path].vue (1)

13-13: Align with the project's established $t() pattern in <script setup>.

This page unnecessarily destructures t from useI18n() instead of using the auto-injected $t(). Other pages across the project (index.vue, about.vue, etc.) use $t() directly within script setup callbacks, including useSeoMeta and other composables.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 879a087c-1be9-42bf-b663-4c4d635c1fc7

📥 Commits

Reviewing files that changed from the base of the PR and between b43cc0a and db14455.

📒 Files selected for processing (33)
  • app/components/Settings/AccentColorPicker.vue
  • app/components/Settings/BgThemePicker.vue
  • app/composables/useSettings.ts
  • app/pages/package-docs/[...path].vue
  • app/pages/settings.vue
  • i18n/locales/ar.json
  • i18n/locales/az-AZ.json
  • i18n/locales/bg-BG.json
  • i18n/locales/bn-IN.json
  • i18n/locales/cs-CZ.json
  • i18n/locales/de-DE.json
  • i18n/locales/en.json
  • i18n/locales/es.json
  • i18n/locales/fr-FR.json
  • i18n/locales/hi-IN.json
  • i18n/locales/hu-HU.json
  • i18n/locales/id-ID.json
  • i18n/locales/it-IT.json
  • i18n/locales/ja-JP.json
  • i18n/locales/kn-IN.json
  • i18n/locales/mr-IN.json
  • i18n/locales/nb-NO.json
  • i18n/locales/ne-NP.json
  • i18n/locales/pl-PL.json
  • i18n/locales/pt-BR.json
  • i18n/locales/ru-RU.json
  • i18n/locales/ta-IN.json
  • i18n/locales/te-IN.json
  • i18n/locales/tr-TR.json
  • i18n/locales/uk-UA.json
  • i18n/locales/zh-CN.json
  • i18n/locales/zh-TW.json
  • i18n/schema.json


defineOgImageComponent('Default', {
title: () => `${pkg.value?.name ?? 'Package'} - Docs`,
title: () => t('package.docs.og_title', { name: pkg.value?.name ?? 'Package' }),
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Localise the OG fallback token too.

'Package' is still hardcoded English. Use an existing translated key for the fallback to keep this path fully localised.

💡 Suggested patch
-  title: () => t('package.docs.og_title', { name: pkg.value?.name ?? 'Package' }),
+  title: () => t('package.docs.og_title', { name: pkg.value?.name ?? t('package.navigation') }),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
title: () => t('package.docs.og_title', { name: pkg.value?.name ?? 'Package' }),
title: () => t('package.docs.og_title', { name: pkg.value?.name ?? t('package.navigation') }),

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.

LGTM ✨

@MatteoGabriele MatteoGabriele added this pull request to the merge queue Mar 21, 2026
Merged via the queue into main with commit d86c9c4 Mar 21, 2026
23 checks passed
@MatteoGabriele MatteoGabriele deleted the serhalp/translate-pkg-docs branch March 21, 2026 18:53
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.

2 participants