Skip to content

Conversation

@serhalp
Copy link
Contributor

@serhalp serhalp commented Feb 10, 2026

image

Why:

  • Increase up-front transparency of translation status
  • Provide a passive call-to-action to come help us translate!

Inspired by https://opencollective.com/

@vercel
Copy link

vercel bot commented Feb 10, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 10, 2026 0:43am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Feb 10, 2026 0:43am
npmx-lunaria Ignored Ignored Feb 10, 2026 0:43am

Request Review

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

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

Files with missing lines Patch % Lines
app/pages/settings.vue 0.00% 4 Missing ⚠️
app/utils/locale-label.ts 0.00% 3 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

The changes introduce a locale status formatting system for the language selector. A new utility function formatLocaleLabel in app/utils/locale-label.ts formats locale names by appending translation completion percentages (except when 100% complete). The settings page is updated to use this function through a new getLocaleStatus export from useI18nStatus() and a computed localeItems that maps locales with their formatted labels. Corresponding unit tests verify the formatting behaviour under various locale status scenarios.

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly relates to the changeset, which implements showing translation progress percentages in the language picker dropdown.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/language-picker-translation-progress

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

Comment on lines +9 to +13
const localeItems = computed(() =>
locales.value.map(loc => ({
label: formatLocaleLabel(loc.name ?? '', getLocaleStatus(loc.code)),
value: loc.code,
})),
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

🧩 Analysis chain

🏁 Script executed:

# First, let's examine the settings.vue file around the mentioned lines
cat -n app/pages/settings.vue | head -50

Repository: npmx-dev/npmx.dev

Length of output: 1844


🏁 Script executed:

# Let's also search for locale-related data/setup to understand the structure
rg -A 5 "locales\.value" app/pages/settings.vue | head -30

Repository: npmx-dev/npmx.dev

Length of output: 194


🏁 Script executed:

# Check the formatLocaleLabel function to understand how it handles empty strings
rg -B 2 -A 5 "formatLocaleLabel" app/pages/settings.vue

Repository: npmx-dev/npmx.dev

Length of output: 307


🏁 Script executed:

# Search for locale data source definition
rg -B 3 -A 8 "const locales" app/pages/settings.vue

Repository: npmx-dev/npmx.dev

Length of output: 43


🏁 Script executed:

# Find where useI18n is defined (likely a composable)
rg -l "useI18n|export.*useI18n" --type ts --type js

Repository: npmx-dev/npmx.dev

Length of output: 677


🏁 Script executed:

# Search for formatLocaleLabel function
rg -B 2 -A 10 "function formatLocaleLabel|const formatLocaleLabel|export.*formatLocaleLabel"

Repository: npmx-dev/npmx.dev

Length of output: 560


🏁 Script executed:

# Search for locale configuration/initialization
rg -B 3 -A 8 "locales.*=" --type ts --type js | head -50

Repository: npmx-dev/npmx.dev

Length of output: 2797


🏁 Script executed:

# Check if there's i18n configuration file
fd -e "ts|js" -i "i18n|locale" | grep -E "(config|setup|composable)" | head -20

Repository: npmx-dev/npmx.dev

Length of output: 43


🏁 Script executed:

# Check useI18nStatus composable
cat -n app/composables/useI18nStatus.ts

Repository: npmx-dev/npmx.dev

Length of output: 2814


🏁 Script executed:

# Search for where locales.value comes from in useI18n hook
rg -B 5 -A 10 "locales\s*=" app/ | grep -E "(const|let|var|locales)" | head -20

Repository: npmx-dev/npmx.dev

Length of output: 43


🏁 Script executed:

# Check how useI18n is imported and if it's from `@nuxtjs/i18n`
rg "from.*i18n|import.*useI18n" app/ --type ts --type vue

Repository: npmx-dev/npmx.dev

Length of output: 88


🏁 Script executed:

# Search for useI18n imports and usage (without problematic -t flag)
rg "useI18n|@nuxtjs/i18n" app/ --include="*.ts" --include="*.vue" -B 1 -A 1 | head -30

Repository: npmx-dev/npmx.dev

Length of output: 502


🏁 Script executed:

# Look for nuxt configuration
cat -n nuxt.config.ts 2>/dev/null || cat -n nuxt.config.js 2>/dev/null || fd -e "ts|js" -i "nuxt.config"

Repository: npmx-dev/npmx.dev

Length of output: 10479


🏁 Script executed:

# Check how locales are defined in i18n config
rg -B 5 -A 10 "i18n.*config|locales.*:" --include="*.ts" --include="*.js" | head -50

Repository: npmx-dev/npmx.dev

Length of output: 502


🏁 Script executed:

# Verify formatLocaleLabel with empty string
cat -n app/utils/locale-label.ts

Repository: npmx-dev/npmx.dev

Length of output: 572


🏁 Script executed:

# Check the i18n config file to see currentLocales structure
cat -n config/i18n.ts

Repository: npmx-dev/npmx.dev

Length of output: 14333


🏁 Script executed:

# Also search for currentLocales definition
rg "currentLocales|export.*locales" config/ -B 2 -A 8

Repository: npmx-dev/npmx.dev

Length of output: 1610


Use locale code as fallback when name is missing.
If a locale lacks name, the current empty string fallback results in a blank label (or just "(x%)"). Use the locale code as fallback for better UX.

Suggested change
const localeItems = computed(() =>
  locales.value.map(loc => ({
-   label: formatLocaleLabel(loc.name ?? '', getLocaleStatus(loc.code)),
+   label: formatLocaleLabel(loc.name ?? loc.code, getLocaleStatus(loc.code)),
    value: loc.code,
  })),
)
📝 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
const localeItems = computed(() =>
locales.value.map(loc => ({
label: formatLocaleLabel(loc.name ?? '', getLocaleStatus(loc.code)),
value: loc.code,
})),
const localeItems = computed(() =>
locales.value.map(loc => ({
label: formatLocaleLabel(loc.name ?? loc.code, getLocaleStatus(loc.code)),
value: loc.code,
})),

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.

1 participant