You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`pnpm i18n:check [locale]`| Compares `en.json` with other locale files. Shows missing and extra keys. Optionally filter output by locale (e.g. `pnpm i18n:check ja-JP`).|
466
-
|`pnpm i18n:check:fix [locale]`| Same as check, but adds missing keys to other locales with English placeholders.|
467
-
|`pnpm i18n:report`| Audits translation keys against code usage in `.vue` and `.ts` files. Reports missing keys (used in code but not in locale), unused keys (in locale but not in code), and dynamic keys.|
468
-
|`pnpm i18n:report:fix`|Removes unused keys from `en.json` and all other locale files. |
469
-
|`pnpm i18n:schema`| Generates a JSON Schema from `en.json` at `i18n/schema.json`. Locale files reference this schema for IDE validation and autocompletion. |
|`pnpm i18n:check:fix [locale]`| Compares `en.json` with other locale files and adds missing keys with English placeholders. Optionally filter output by locale (e.g. `pnpm i18n:check:fix ja-JP`). |
466
+
|`pnpm i18n:report:fix`| Removes unused keys from `en.json` and all other locale files. |
467
+
|`pnpm vp run i18n:check [locale]`| Same as check:fix, but only show missing and extra keys. |
468
+
|`pnpm vp run i18n:report`|Audits translation keys against code usage in `.vue` and `.ts`files. Reports missing keys (used in code but not in locale), unused keys (in locale but not in code), and dynamic keys.|
469
+
|`pnpm vp run i18n:schema`| Generates a JSON Schema from `en.json` at `i18n/schema.json`. Locale files reference this schema for IDE validation and autocompletion. |
We track the current progress of translations with [Lunaria](https://lunaria.dev/) on this site: https://i18n.npmx.dev/
503
503
If you see any outdated translations in your language, feel free to update the keys to match the English version.
504
504
505
-
Use `pnpm i18n:check` and `pnpm i18n:check:fix` to verify and fix your locale (see [i18n commands](#i18n-commands) above for details).
505
+
Use `pnpm i18n:check:fix` to fix your locale (see [i18n commands](#i18n-commands) above for details).
506
506
507
507
#### Country variants (advanced)
508
508
@@ -590,7 +590,7 @@ See how `es`, `es-ES`, and `es-419` are configured in [config/i18n.ts](./config/
590
590
- Use `common.*` for shared strings (loading, retry, close, etc.)
591
591
- Use component-specific prefixes: `package.card.*`, `settings.*`, `nav.*`
592
592
- Do not use dashes (`-`) in translation keys; always use underscore (`_`): e.g., `privacy_policy` instead of `privacy-policy`
593
-
-**Always use static string literals as translation keys.** Our i18n scripts (`pnpm i18n:report`) rely on static analysis to detect unused and missing keys. Dynamic keys cannot be analyzed and will be flagged as errors.
593
+
-**Always use static string literals as translation keys.** Our i18n scripts (`pnpm i18n:report:fix`) rely on static analysis to detect unused and missing keys. Dynamic keys cannot be analyzed and will be flagged as errors.
594
594
595
595
**Bad:**
596
596
@@ -752,6 +752,23 @@ pnpm test:browser:ui # Run with Playwright UI
752
752
753
753
Make sure to read about [Playwright best practices](https://playwright.dev/docs/best-practices) and don't rely on classes/IDs but try to follow user-replicable behaviour (like selecting an element based on text content instead).
754
754
755
+
#### Updating snapshots
756
+
757
+
Some tests use image snapshots that must match the CI environment (Linux). If you need to update them, and aren't running Linux, you can use Docker to run in the same environment:
758
+
759
+
```bash
760
+
docker run --rm \
761
+
-e CI=true \
762
+
-e NODE_OPTIONS="--max-old-space-size=4096" \
763
+
-v $(pwd):/work \
764
+
-w /work \
765
+
mcr.microsoft.com/playwright:v1.58.2-noble \
766
+
sh -c "npm install -g pnpm && pnpm install && pnpm vp run build:test && pnpm vp run test:browser:prebuilt --update-snapshots"
767
+
```
768
+
769
+
> [!NOTE]
770
+
> If the build runs out of memory, increase `--max-old-space-size` to `8192`.
771
+
755
772
### Test fixtures (mocking external APIs)
756
773
757
774
E2E tests use a fixture system to mock external API requests, ensuring tests are deterministic and don't hit real APIs. This is handled at two levels:
> Want automatic redirects? Try the [npmx-replace browser extension](https://github.com/tylersayshi/npmx-replace-extension) (Chrome only for now) or the separate [npmx-redirect extension](https://github.com/iaverages/npmx-redirect) for [Chrome](https://chromewebstore.google.com/detail/lbhjgfgpnlihfmobnohoipeljollhlnb) / [Firefox](https://addons.mozilla.org/en-GB/firefox/addon/npmx-redirect/).
117
+
> Want automatic redirects? Try the [npmx-redirect extension](https://github.com/iaverages/npmx-redirect) for [Chrome](https://chromewebstore.google.com/detail/lbhjgfgpnlihfmobnohoipeljollhlnb) / [Firefox](https://addons.mozilla.org/en-GB/firefox/addon/npmx-redirect/).
118
118
119
119
#### Not yet supported
120
120
@@ -148,7 +148,7 @@ We welcome contributions – please do feel free to explore the project and
148
148
149
149
## Related projects
150
150
151
-
-[npmx-replace-extension](https://github.com/tylersayshi/npmx-replace-extension)– Browser extension to redirect npmjs.com to npmx.dev (Chrome only for now)
151
+
-[npmx-redirect](https://github.com/iaverages/npmx-redirect)– Browser extension that automatically redirects npmjs.com URLs to npmx.dev.
152
152
-[JSR](https://jsr.io/)– The open-source package registry for modern JavaScript and TypeScript
153
153
-[npm-userscript](https://github.com/bluwy/npm-userscript)– Browser userscript with various improvements and fixes for npmjs.com
154
154
-[npm-alt](https://npm.willow.sh/)– An alternative npm package browser
@@ -158,7 +158,6 @@ We welcome contributions – please do feel free to explore the project and
158
158
-[nxjt](https://nxjt.netlify.app)– npmx Jump To: Quickly navigate to npmx common webpages.
159
159
-[npmx-weekly](https://npmx-weekly.trueberryless.org/)– A weekly newsletter for the npmx ecosystem. Add your own content via suggestions in the weekly PR on [GitHub](https://github.com/trueberryless-org/npmx-weekly/pulls?q=is%3Aopen+is%3Apr+label%3A%22%F0%9F%95%94+weekly+post%22).
160
160
-[npmx-digest](https://npmx-digest.trueberryless.org/)– An automated news aggregation website that summarizes npmx activity from GitHub and Bluesky every 8 hours.
161
-
-[npmx-redirect](https://github.com/iaverages/npmx-redirect)– Browser extension that automatically redirects npmjs.com URLs to npmx.dev.
162
161
-[npmx-badge](https://npmx-badge.vercel.app/)– A playground to help you create custom badges quickly.
0 commit comments