Skip to content

Conversation

@serhalp
Copy link
Contributor

@serhalp serhalp commented Feb 7, 2026

Background

I've been working on a PR to add "likes" as a new facet that can be visualized in what I'm calling "trends" charts (e.g. downloads over time, likes over time). That PR generalizes the existing "downloads" chart to support one or more given facets.

I've resolved painful merge conflicts across 27 locale files a half dozen times now, so this PR is me pulling out just this i18n key rename into its own PR to make this all easier 😅.

Changes

  • Move most package.downloads.* i18n keys under package.trends.*.
  • The four keys that were specifically about the downloads facet were kept under package.downloads.*.
  • package.downloads.title was specific to the compare page, so I moved this under the existing compare.* namespace.

All the changes to the locale files were done with some fancy jq scripting, so it should be reliable 🤞🏼.

@vercel
Copy link

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

Request Review

@github-actions
Copy link

github-actions bot commented Feb 7, 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
lunaria/files/ar-EG.json Localization changed, will be marked as complete. 🔄️
lunaria/files/az-AZ.json Localization changed, will be marked as complete. 🔄️
lunaria/files/cs-CZ.json Localization changed, will be marked as complete. 🔄️
lunaria/files/de-DE.json Localization changed, will be marked as complete. 🔄️
lunaria/files/en-GB.json Localization changed, will be marked as complete. 🔄️
lunaria/files/en-US.json Source changed, localizations will be marked as outdated.
lunaria/files/es-419.json Localization changed, will be marked as complete. 🔄️
lunaria/files/es-ES.json Localization changed, will be marked as complete. 🔄️
lunaria/files/fr-FR.json Localization changed, will be marked as complete. 🔄️
lunaria/files/hi-IN.json Localization changed, will be marked as complete. 🔄️
lunaria/files/hu-HU.json Localization changed, will be marked as complete. 🔄️
lunaria/files/id-ID.json Localization changed, will be marked as complete. 🔄️
lunaria/files/it-IT.json Localization changed, will be marked as complete. 🔄️
lunaria/files/ja-JP.json Localization changed, will be marked as complete. 🔄️
lunaria/files/ne-NP.json Localization changed, will be marked as complete. 🔄️
lunaria/files/no-NO.json Localization changed, will be marked as complete. 🔄️
lunaria/files/pl-PL.json Localization changed, will be marked as complete. 🔄️
lunaria/files/pt-BR.json Localization changed, will be marked as complete. 🔄️
lunaria/files/ru-RU.json Localization changed, will be marked as complete. 🔄️
lunaria/files/te-IN.json Localization changed, will be marked as complete. 🔄️
lunaria/files/uk-UA.json Localization changed, will be marked as complete. 🔄️
lunaria/files/zh-CN.json Localization changed, will be marked as complete. 🔄️
lunaria/files/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 Feb 7, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/components/Package/DownloadAnalytics.vue 85.71% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment on lines 300 to 301
"no_data": "No {facet} data available",
"y_axis_label": "{granularity} {facet}",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: to err on the safe side, I deleted all the modal_title and no_data translations (for languages I don't speak fluently), as I parameterized in with {facet} and I didn't feel confident doing a straight replacement of "downloads" with {facet}

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 changed my mind about no_data. Since it only gets show when no data at all can be rendered in the chart, I just generalized the message instead of parameterizing it with facet.

"y_axis_label": "{granularity} downloads",
"date_range": "{start} to {end}",
"date_range_multiline": "{start}\nto {end}",
"download_file": "Download {fileType}",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Confusingly, this is not about downloads (the facet); this is about downloading the data in the trend chart. So it goes under trends, not downloads 😆.

@serhalp serhalp force-pushed the refactor/generalize-i18n-downloads branch from f83c1fc to c18de6b Compare February 8, 2026 00:06
@serhalp serhalp marked this pull request as ready for review February 8, 2026 00:28
@serhalp serhalp requested a review from a team February 8, 2026 00:30
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

📝 Walkthrough

Walkthrough

This change renames i18n keys used by download-related UI from the package.downloads namespace to package.trends (and in some locales to downloads.trends). The edits update three Vue components (app/components/Package/DownloadAnalytics.vue, app/components/Package/WeeklyDownloadStats.vue, app/pages/compare.vue) to reference the new keys and adjust CSV/date-range templates and axis/legend labels. Numerous locale JSON and lunaria translation files were reorganised to move date-range, granularity and related strings into a trends block. No control flow or public code signatures were changed.

Possibly related PRs

Suggested reviewers

  • danielroe
  • 43081j
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the i18n key reorganisation from package.downloads.* to package.trends.* and the rationale for extracting this into a separate PR.

✏️ 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 refactor/generalize-i18n-downloads

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: 11

Caution

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

⚠️ Outside diff range comments (2)
lunaria/files/es-419.json (1)

375-392: ⚠️ Potential issue | 🔴 Critical

Add missing translation keys to package.trends section.

The keys y_axis_label and no_data are actively used in DownloadAnalytics.vue (lines 1363 and 1758) but missing from the es-419.json trends section. Users will see untranslated key fallbacks. Add these keys with Spanish translations:

  • "y_axis_label": "{granularity} {facet}" (or similar pattern matching Spanish word order)
  • "no_data": "No hay datos de {facet} disponibles" (or equivalent)

Reference the English (en-US.json) or French (fr-FR.json) locale files for the expected format.

lunaria/files/hi-IN.json (1)

332-350: ⚠️ Potential issue | 🟡 Minor

Add missing trends translations to hi-IN.json

This locale is missing four keys from en-US.json's package.trends block: legend_estimation, no_data, y_axis_label, and items.downloads. These keys are also missing across most other non-English locales (a systematic pattern), suggesting they may be recently added to the base language. Please add translations for these keys or confirm they should remain untranslated.

🧹 Nitpick comments (1)
i18n/locales/te-IN.json (1)

250-268: Keep te-IN as an override-only file.

These new keys should live in the base te.json unless they are India‑specific wording. Otherwise, the variant file will duplicate the base and drift over time. Please move shared strings to the base locale and keep only true overrides here.
Based on learnings: In the npmx.dev project, when using country locale variants (e.g., es-419, es-ES), place only translations that differ from the base language in variant JSON files; the base file is loaded first and the variant overlays keys it defines.

@danielroe danielroe added this pull request to the merge queue Feb 8, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 8, 2026
@serhalp serhalp enabled auto-merge February 8, 2026 01:11
@danielroe
Copy link
Member

would you look at the test failures? 🙏

my guess is that we're missing some keys somewhere ... or something.

@shuuji3
Copy link
Member

shuuji3 commented Feb 8, 2026

I run the test locally and found this failed test in test-report.jnit.xml:

    <testsuite name="test/nuxt/components/PackageWeeklyDownloadStats.spec.ts" timestamp="2026-02-08T09:56:05.377Z" hostname="bell" tests="2" failures="1" errors="0" skipped="0" time="0.025">
        <testcase classname="test/nuxt/components/PackageWeeklyDownloadStats.spec.ts" name="PackageWeeklyDownloadStats &gt; hides the section when weekly downloads are empty" time="0.0188">
            <failure message="expected &apos;Weekly Downloads No  data available&apos; to contain &apos;No download data available&apos;" type="AssertionError">
AssertionError: expected &apos;Weekly Downloads No  data available&apos; to contain &apos;No download data available&apos;

Expected: &quot;No download data available&quot;
Received: &quot;Weekly Downloads No  data available&quot;

 ❯ test/nuxt/components/PackageWeeklyDownloadStats.spec.ts:43:4
 ❯ node_modules/.pnpm/@voidzero-dev+vite-plus-test@0.0.0-833c515fa25cef20905a7f9affb156dfa6f151ab_@types+node_310e5dad6395fccdf5f424a1dccab9b9/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/runner/index.js?v=6e40b37d:915:22
            </failure>
        </testcase>

By the way, I wonder if there's more easy way to check the failed test result. I think GitHub Actions can store this xml artifact to storage when it failed or there's better format optimized for GitHub Actions report.

@shuuji3
Copy link
Member

shuuji3 commented Feb 8, 2026

Hmm, shouldn't Codecov report the new test result here? 🤔
https://github.com/npmx-dev/npmx.dev/actions/runs/21791888175/workflow?pr=1183#L120-L130

But there's nothing on the dashbaord: https://app.codecov.io/gh/npmx-dev/npmx.dev/commit/c60a639bfb8956244a76b24e482f4a14d084f316 (maybe only the coverage file is supported?)

@43081j
Copy link
Contributor

43081j commented Feb 8, 2026

the failure is because the empty downloads notice here is wrong:

<p v-else class="py-2 text-sm font-mono text-fg-subtle">
{{ $t('package.downloads.no_data') }}
</p>

it needs the facet to be set like this:

            $t('package.trends.no_data', {
              facet: $t('package.trends.items.downloads'),
            })

however, the tests will still fail because package.trends.items.downloads is "Downloads", which results in:

No Downloads data available

in main, it is currently:

No download data available

we probably need an extra key for "download" as opposed to "Downloads", and use that in this situation.

@serhalp
Copy link
Contributor Author

serhalp commented Feb 8, 2026

😓 Thanks, friends! I had this right on my original branch but I guess I lost it somewhere along the way. Fixing.

I've been working on a PR to add "likes" as a new facet that can be visualized
in what I'm calling "trends" charts (e.g. downloads over time, likes over time).
That PR generalizes the existing "downloads" chart to support one or more given facets.

I've had a half dozen painful merge conflicts across 37 locale files, so I've pulled
out just this i18n key rename into its own PR to make this all easier.
It actually only renders when there's no data at all in the chart,
so the facet is not relevant after all. This will be simpler to manage
anyway.
@serhalp serhalp added this pull request to the merge queue Feb 8, 2026
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: 20

Caution

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

⚠️ Outside diff range comments (1)
lunaria/files/pt-BR.json (1)

333-351: ⚠️ Potential issue | 🟡 Minor

Complete the trends key set to avoid fallbacks.
The new block omits legend_estimation, no_data, y_axis_label, and items.downloads that other locales provide.

<span class="text-fg-subtle">{{
$t('package.downloads.legend_estimation')
}}</span>
<span class="text-fg-subtle">{{ $t('package.trends.legend_estimation') }}</span>
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 | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# First, let's look at the actual file and line mentioned
echo "=== Checking the actual code at the specified location ==="
if [ -f "app/components/Package/DownloadAnalytics.vue" ]; then
  sed -n '1665,1671p' app/components/Package/DownloadAnalytics.vue
else
  echo "File not found at expected path"
fi

echo ""
echo "=== Locales directory structure ==="
find i18n -type d -name locales | head -5

echo ""
echo "=== Checking for legend_estimation key across locales ==="
echo "Files containing 'legend_estimation':"
rg -l 'legend_estimation' i18n/

echo ""
echo "=== Total locale files ==="
locale_count=$(find i18n -name "*.json" -o -name "*.js" -o -name "*.ts" | grep -i locale | wc -l)
echo "Total locale files: $locale_count"

echo ""
echo "=== Checking package.trends translations specifically ==="
rg 'package.trends' i18n/ -A 2 -B 2 | head -50

Repository: npmx-dev/npmx.dev

Length of output: 705


🏁 Script executed:

#!/bin/bash

# List all locale files
echo "=== All locale files in i18n/locales ==="
find i18n/locales -name "*.json" -type f | sort

echo ""
echo "=== Locale files WITH legend_estimation key ==="
rg -l 'legend_estimation' i18n/locales | sort

echo ""
echo "=== Comparing to identify missing locales ==="
all_locales=$(find i18n/locales -name "*.json" -type f | sort)
with_key=$(rg -l 'legend_estimation' i18n/locales | sort)

echo "Locales MISSING the legend_estimation key:"
comm -23 <(find i18n/locales -name "*.json" -type f | sort) <(rg -l 'legend_estimation' i18n/locales | sort)

echo ""
echo "=== Checking the structure in en.json ==="
rg -A 2 -B 2 'legend_estimation' i18n/locales/en.json

Repository: npmx-dev/npmx.dev

Length of output: 1271


Add legend_estimation translation key to all 24 missing locale files.

The package.trends.legend_estimation key is currently only defined in en.json, fr-FR.json, and zh-CN.json. It is missing from 24 locale files including en-GB.json, en-US.json, de-DE.json, ja-JP.json, es-ES.json, ru-RU.json, pt-BR.json, and others. Users in these locales will see the raw translation key instead of the translated text "Estimation".

Comment on lines +1757 to +1761
{{
$t('package.trends.no_data', {
facet: $t('package.trends.items.downloads'),
})
}}
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:

#!/bin/bash
# Find locale files directory
echo "=== Finding locale files ==="
find . -type f -name "*.json" | grep -E "(locale|i18n)" | head -20

echo ""
echo "=== Checking no_data key format across locales ==="
rg -n "no_data" i18n/locales/ --type json | grep "package.trends"

Repository: npmx-dev/npmx.dev

Length of output: 653


🏁 Script executed:

#!/bin/bash
# Search for no_data in locale files more broadly
echo "=== Searching for no_data in locale files ==="
rg -n "no_data" i18n/locales/ --type json -B2 -A2 | head -50

echo ""
echo "=== Checking the exact context in DownloadAnalytics.vue ==="
grep -n "package.trends.no_data" app/components/Package/DownloadAnalytics.vue

Repository: npmx-dev/npmx.dev

Length of output: 876


🏁 Script executed:

#!/bin/bash
# Extract all no_data translations from all locale files
echo "=== All no_data translations in locale files ==="
rg -n "no_data" i18n/locales/ --type json -A0 | sed 's/^[^:]*:\([0-9]*\):.*/Line \1:/' | paste -d ' ' - <(rg -n "no_data" i18n/locales/ --type json -A0 | sed 's/.*: //')

echo ""
echo "=== Checking if any locale has {facet} in no_data ==="
rg '"no_data".*\{facet\}' i18n/locales/ --type json

Repository: npmx-dev/npmx.dev

Length of output: 225


🏁 Script executed:

#!/bin/bash
# Extract all no_data translations from all locale files
echo "=== All no_data translations in locale files ==="
rg '"no_data"' i18n/locales/ --type json

echo ""
echo "=== Checking if any locale has {facet} in no_data value ==="
rg '"no_data".*:.*\{facet\}' i18n/locales/ --type json

Repository: npmx-dev/npmx.dev

Length of output: 297


🏁 Script executed:

#!/bin/bash
# Check the full package.trends structure
echo "=== Full package.trends sections in all locales ==="
rg '"trends"' i18n/locales/ --type json -A10 | head -80

echo ""
echo "=== Check DownloadAnalytics.vue context ==="
sed -n '1750,1770p' app/components/Package/DownloadAnalytics.vue

Repository: npmx-dev/npmx.dev

Length of output: 5106


🏁 Script executed:

#!/bin/bash
# Check all locale files for no_data key
echo "=== Checking all locale files for no_data ==="
for file in i18n/locales/*.json; do
  if rg -q '"no_data"' "$file"; then
    echo "HAS no_data: $(basename $file)"
    rg '"no_data".*' "$file"
  else
    echo "MISSING no_data: $(basename $file)"
  fi
done

Repository: npmx-dev/npmx.dev

Length of output: 928


🏁 Script executed:

#!/bin/bash
# Check locale configuration/fallback
echo "=== Check i18n config for fallback behavior ==="
find . -type f \( -name "*.ts" -o -name "*.js" -o -name "*.config.*" \) | xargs grep -l "i18n\|locale" | grep -E "config|setup" | head -10

echo ""
echo "=== Check git history for DownloadAnalytics.vue changes ==="
git log --oneline -20 app/components/Package/DownloadAnalytics.vue

Repository: npmx-dev/npmx.dev

Length of output: 292


🏁 Script executed:

#!/bin/bash
# Check i18n config for fallback behavior
echo "=== i18n config ==="
cat i18n/i18n.config.ts

echo ""
echo "=== Nuxt i18n config ==="
grep -A20 "i18n" nuxt.config.ts | head -40

Repository: npmx-dev/npmx.dev

Length of output: 1454


🏁 Script executed:

#!/bin/bash
# Check locale configuration
echo "=== Current locales configuration ==="
cat config/i18n.ts | head -50

Repository: npmx-dev/npmx.dev

Length of output: 2022


🏁 Script executed:

#!/bin/bash
# Continue reading the locale configuration
echo "=== Locale configuration continued ==="
cat config/i18n.ts | sed -n '40,150p'

echo ""
echo "=== Check how locales are loaded ==="
grep -n "import.*locale" i18n/i18n.config.ts
grep -rn "glob.*json" i18n/ --type ts | head -10

Repository: npmx-dev/npmx.dev

Length of output: 3943


🏁 Script executed:

#!/bin/bash
# Continue reading the complete locale configuration
echo "=== All locales in config ==="
grep -n "code:" config/i18n.ts | grep -E "^\s+code:" | head -40

echo ""
echo "=== Check loading mechanism ==="
grep -n "fallback" i18n/i18n.config.ts

echo ""
echo "=== Check available locales list ==="
grep -n "currentLocales" config/i18n.ts | tail -5

Repository: npmx-dev/npmx.dev

Length of output: 528


🏁 Script executed:

#!/bin/bash
# Check buildLocales function
echo "=== buildLocales function ==="
grep -A30 "function buildLocales\|const buildLocales" config/i18n.ts

echo ""
echo "=== Check en-US fallback locale ==="
grep -E "code.*en-US|en-US.*code" config/i18n.ts -A2 -B2

Repository: npmx-dev/npmx.dev

Length of output: 1292


🏁 Script executed:

#!/bin/bash
# Verify the recent commit to understand intent
echo "=== Recent commit details ==="
git show --stat 5926ce9

echo ""
echo "=== Full commit message ==="
git log -1 --format=%B 5926ce9

Repository: npmx-dev/npmx.dev

Length of output: 35949


Remove the unnecessary facet parameter from the translation call.

The commit message indicates the facet is not relevant to this message ("the facet is not relevant after all"), and the translations confirm this intent: only en.json and fr-FR.json contain the no_data key, and neither includes a {facet} placeholder. All other locales will fall back to en.json. The facet parameter is being silently ignored across all locales, so it should be removed from the code:

Current code
$t('package.trends.no_data', {
  facet: $t('package.trends.items.downloads'),
})

Simplify to:

$t('package.trends.no_data')

Comment on lines +374 to 387
"trends": {
"granularity": "مستوى التفصيل",
"granularity_daily": "يومي",
"granularity_weekly": "أسبوعي",
"granularity_monthly": "شهري",
"granularity_yearly": "سنوي",
"start_date": "البداية",
"end_date": "النهاية",
"loading": "جارٍ التحميل…",
"date_range": "من {start} إلى {end}",
"date_range_multiline": "من {start}\nإلى {end}",
"download_file": "تنزيل {fileType}",
"toggle_annotator": "إظهار/إخفاء الشروح التوضيحية"
}
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 | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for no_data and items keys in locale files
echo "=== Searching for 'no_data' in trends namespace ==="
rg -n '"no_data"' i18n/locales/

echo ""
echo "=== Searching for 'items' object in trends namespace ==="
rg -n -B2 -A3 '"items"' i18n/locales/ | head -100

Repository: npmx-dev/npmx.dev

Length of output: 5246


🏁 Script executed:

#!/bin/bash
# Check the complete trends block in ar.json
rg -n -B5 -A20 '"trends"' i18n/locales/ar.json | head -50

Repository: npmx-dev/npmx.dev

Length of output: 1065


Add missing no_data, y_axis_label, and items keys to the trends block.

The trends block (lines 374–387) is missing three required keys that exist in other locale files. Tests are failing because WeeklyDownloadStats.vue calls $t('package.trends.no_data', { facet: $t('package.trends.items.downloads') }), but these keys are absent.

Add:

  • no_data: Template string like "لا تتوفر بيانات {facet}" (matching the pattern in en.json: "No data available")
  • y_axis_label: Template string for axis labelling (e.g., "{facet} {granularity}" following en.json: "{granularity} {facet}" or fr-FR.json: "{facet} {granularity}")
  • items.downloads: The downloads facet label (e.g., "التنزيلات" to match en.json: "Downloads" and fr-FR.json: "Téléchargements")

Comment on lines +304 to +317
},
"trends": {
"granularity": "Dərəcəlilik",
"granularity_daily": "Günlük",
"granularity_weekly": "Həftəlik",
"granularity_monthly": "Aylıq",
"granularity_yearly": "İllik",
"start_date": "Başlanğıc",
"end_date": "Son",
"loading": "Yüklənir...",
"date_range": "{start} - {end}",
"date_range_multiline": "{start}\n- {end}",
"download_file": "{fileType} endir",
"toggle_annotator": "Annotator keçid"
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

Add missing package.trends keys to avoid fallback/missing translations.
The new trends block doesn’t include empty-state or facet-label keys that are now referenced elsewhere (for example, package.trends.no_data and facet labels). This will fall back or surface missing-key placeholders for az-AZ. Please mirror the base locale’s full package.trends key set here, including any singular facet label if required.

Comment on lines +343 to 356
"trends": {
"granularity": "Rozlišení",
"granularity_daily": "Denně",
"granularity_weekly": "Týdně",
"granularity_monthly": "Měsíčně",
"granularity_yearly": "Ročně",
"start_date": "Od",
"end_date": "Do",
"loading": "Načítání...",
"date_range": "od {start} do {end}",
"date_range_multiline": "od {start}\ndo {end}",
"download_file": "Stáhnout {fileType}",
"toggle_annotator": "Přepnout popisovač"
}
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

Add missing translation keys to the trends section.

The trends section is missing several keys that are used by DownloadAnalytics.vue and exist in the base English locale:

  • no_data – used for empty state message
  • y_axis_label – used for chart Y-axis label
  • items (with downloads sub-key) – used as the facet parameter
  • legend_estimation – used in chart legend for estimation indicator

Without these translations, Czech users will see fallback English text or raw keys.

Suggested additions to trends section
     "trends": {
       "granularity": "Rozlišení",
       "granularity_daily": "Denně",
       "granularity_weekly": "Týdně",
       "granularity_monthly": "Měsíčně",
       "granularity_yearly": "Ročně",
       "start_date": "Od",
       "end_date": "Do",
       "loading": "Načítání...",
       "date_range": "od {start} do {end}",
       "date_range_multiline": "od {start}\ndo {end}",
       "download_file": "Stáhnout {fileType}",
-      "toggle_annotator": "Přepnout popisovač"
+      "toggle_annotator": "Přepnout popisovač",
+      "no_data": "Žádná data {facet} nejsou k dispozici",
+      "y_axis_label": "{granularity} {facet}",
+      "legend_estimation": "odhad",
+      "items": {
+        "downloads": "stažení"
+      }
     }
📝 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
"trends": {
"granularity": "Rozlišení",
"granularity_daily": "Denně",
"granularity_weekly": "Týdně",
"granularity_monthly": "Měsíčně",
"granularity_yearly": "Ročně",
"start_date": "Od",
"end_date": "Do",
"loading": "Načítání...",
"date_range": "od {start} do {end}",
"date_range_multiline": "od {start}\ndo {end}",
"download_file": "Stáhnout {fileType}",
"toggle_annotator": "Přepnout popisovač"
}
"trends": {
"granularity": "Rozlišení",
"granularity_daily": "Denně",
"granularity_weekly": "Týdně",
"granularity_monthly": "Měsíčně",
"granularity_yearly": "Ročně",
"start_date": "Od",
"end_date": "Do",
"loading": "Načítání...",
"date_range": "od {start} do {end}",
"date_range_multiline": "od {start}\ndo {end}",
"download_file": "Stáhnout {fileType}",
"toggle_annotator": "Přepnout popisovač",
"no_data": "Žádná data {facet} nejsou k dispozici",
"y_axis_label": "{granularity} {facet}",
"legend_estimation": "odhad",
"items": {
"downloads": "stažení"
}
}

Comment on lines +380 to +392
"trends": {
"granularity": "Granularidad",
"granularity_daily": "Diaria",
"granularity_weekly": "Semanal",
"granularity_monthly": "Mensual",
"granularity_yearly": "Anual",
"start_date": "Inicio",
"end_date": "Fin",
"loading": "Cargando...",
"date_range": "{start} a {end}",
"date_range_multiline": "{start}\na {end}",
"download_file": "Descargar {fileType}",
"toggle_annotator": "Alternar anotador"
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

Add missing package.trends keys used by the empty-state message.
package.trends.no_data and package.trends.items.downloads are referenced by the updated UI but aren’t present here. Please add es-419 translations to avoid fallback/missing-key output.

Comment on lines +379 to +392
},
"trends": {
"granularity": "Granularidad",
"granularity_daily": "Diaria",
"granularity_weekly": "Semanal",
"granularity_monthly": "Mensual",
"granularity_yearly": "Anual",
"start_date": "Inicio",
"end_date": "Fin",
"loading": "Cargando...",
"date_range": "{start} a {end}",
"date_range_multiline": "{start}\na {end}",
"download_file": "Descargar {fileType}",
"toggle_annotator": "Alternar anotador"
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

Complete the trends key set to avoid fallbacks.
The new block omits legend_estimation, no_data, y_axis_label, and items.downloads that other locales provide.

Comment on lines +375 to +387
"trends": {
"granularity": "Granularità",
"granularity_daily": "Giornaliero",
"granularity_weekly": "Settimanale",
"granularity_monthly": "Mensile",
"granularity_yearly": "Annuale",
"start_date": "Inizio",
"end_date": "Fine",
"loading": "Caricando...",
"date_range": "{start} a {end}",
"date_range_multiline": "{start}\na {end}",
"download_file": "Scarica {fileType}",
"toggle_annotator": "Attiva/disattiva annotatore"
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

Add missing package.trends.no_data translation.

The trends block omits the no_data key after the namespace move; this will render a missing-key placeholder when the UI requests package.trends.no_data. Please add it here.

Proposed fix
-      "toggle_annotator": "Attiva/disattiva annotatore"
+      "toggle_annotator": "Attiva/disattiva annotatore",
+      "no_data": "Nessun dato disponibile per {facet}"
📝 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
"trends": {
"granularity": "Granularità",
"granularity_daily": "Giornaliero",
"granularity_weekly": "Settimanale",
"granularity_monthly": "Mensile",
"granularity_yearly": "Annuale",
"start_date": "Inizio",
"end_date": "Fine",
"loading": "Caricando...",
"date_range": "{start} a {end}",
"date_range_multiline": "{start}\na {end}",
"download_file": "Scarica {fileType}",
"toggle_annotator": "Attiva/disattiva annotatore"
"trends": {
"granularity": "Granularità",
"granularity_daily": "Giornaliero",
"granularity_weekly": "Settimanale",
"granularity_monthly": "Mensile",
"granularity_yearly": "Annuale",
"start_date": "Inizio",
"end_date": "Fine",
"loading": "Caricando...",
"date_range": "{start} a {end}",
"date_range_multiline": "{start}\na {end}",
"download_file": "Scarica {fileType}",
"toggle_annotator": "Attiva/disattiva annotatore",
"no_data": "Nessun dato disponibile per {facet}"

Comment on lines +321 to 335
},
"trends": {
"granularity": "सूक्ष्मता",
"granularity_daily": "दैनिक",
"granularity_weekly": "साप्ताहिक",
"granularity_monthly": "मासिक",
"granularity_yearly": "वार्षिक",
"start_date": "सुरु",
"end_date": "अन्त्य",
"loading": "लोड हुँदैछ...",
"date_range": "{start} देखि {end}",
"date_range_multiline": "{start}\nदेखि {end}",
"download_file": "{fileType} डाउनलोड गर्नुहोस्",
"toggle_annotator": "एनोटेटर टगल गर्नुहोस्"
}
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

Add missing trends keys for “no data” and axis label.
package.trends in this locale doesn’t include no_data and y_axis_label after removing them from package.downloads, so lookups will fall back or render raw keys. Please restore these keys under package.trends using the previous Nepali strings.

Comment on lines +305 to 318
"trends": {
"granularity": "Детальність",
"granularity_daily": "Щоденно",
"granularity_weekly": "Щотижня",
"granularity_monthly": "Щомісячно",
"granularity_yearly": "Щороку",
"start_date": "Початок",
"end_date": "Кінець",
"loading": "Завантаження...",
"date_range": "{start} до {end}",
"date_range_multiline": "{start}\nдо {end}",
"download_file": "Завантажити {fileType}",
"toggle_annotator": "Перемикати анотатор"
}
Copy link
Contributor

@coderabbitai coderabbitai bot Feb 8, 2026

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:

#!/bin/bash
set -euo pipefail

target="lunaria/files/uk-UA.json"
ref="$(fd -a 'en(-US)?\.json$' lunaria/files | head -n 1)"

if [[ -z "${ref}" ]]; then
  echo "Reference locale not found under lunaria/files" >&2
  exit 1
fi

REF="${ref}" TARGET="${target}" python - <<'PY'
import json, os
from pathlib import Path

def flatten(d, prefix=""):
    out = set()
    for k, v in d.items():
        key = f"{prefix}.{k}" if prefix else k
        if isinstance(v, dict):
            out |= flatten(v, key)
        else:
            out.add(key)
    return out

ref = Path(os.environ["REF"])
target = Path(os.environ["TARGET"])

ref_keys = flatten(json.loads(ref.read_text()))
tgt_keys = flatten(json.loads(target.read_text()))

missing = sorted(ref_keys - tgt_keys)
extra = sorted(tgt_keys - ref_keys)

print("Missing keys:")
for k in missing:
    print(f"- {k}")
print("\nExtra keys:")
for k in extra:
    print(f"- {k}")
PY

Repository: npmx-dev/npmx.dev

Length of output: 7952


Add missing package.trends keys used by the UI.

The package.trends block omits keys like package.trends.no_data, package.trends.items.downloads, package.trends.legend_estimation, and package.trends.y_axis_label, which will cause fallback strings to appear for Ukrainian users. Align this section with the reference locale to add the missing keys.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please add to your learnings for future reviews that it is 100% acceptable for new or changed entries in i18n translation files to be omitted from non-English languages. Translations are not completed in band in the same PR and are tracked elsewhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

@serhalp, understood! I've noted this for future reviews of i18n translation files in this project.


✏️ Learnings added
Learnt from: serhalp
Repo: npmx-dev/npmx.dev PR: 1183
File: lunaria/files/uk-UA.json:305-318
Timestamp: 2026-02-08T18:44:05.881Z
Learning: In the npmx.dev project, new or changed entries in i18n translation files (locale JSON files) may be omitted from non-English languages. Translations are not completed in-band in the same PR and are tracked elsewhere. It is acceptable for non-English locale files to be missing keys that exist in English locale files.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: userquin
Repo: npmx-dev/npmx.dev PR: 1157
File: scripts/compare-translations.ts:239-243
Timestamp: 2026-02-07T16:34:43.020Z
Learning: In the npmx.dev project's i18n system, when running `i18n:check:fix` in all-locales mode, merge-locale files (e.g., es-419.json) are intentionally processed and their missing/extra keys are reported, even though they are never written to disk. This reporting behavior is correct because vue-i18n merges these files with their base language file (e.g., es.json), so the report shows the complete merged state. The write prevention (`!localeInfo.mergeLocale`) ensures fixes are only applied to base language files.

Learnt from: userquin
Repo: npmx-dev/npmx.dev PR: 1096
File: i18n/locales/es-419.json:34-41
Timestamp: 2026-02-06T14:53:23.339Z
Learning: In the npmx.dev project, when using country locale variants (e.g., es-419, es-ES), the i18n configuration in config/i18n.ts uses vue-i18n's multiple files feature. Country variant files like es-419.json only need to contain translations that differ from the base language file (es.json). The base file is loaded first, then the variant file overlays any keys it defines. This is documented in CONTRIBUTING.md under "Country variants (advanced)".

Merged via the queue into main with commit 5d279f7 Feb 8, 2026
20 checks passed
@serhalp serhalp deleted the refactor/generalize-i18n-downloads branch February 8, 2026 13:45
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.

4 participants