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
Copy file name to clipboardExpand all lines: .github/instructions/i18n-convert.instructions.md
+30-16Lines changed: 30 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
applyTo: '**/*.vue'
3
3
---
4
4
5
-
You are given a Nuxt/Vue single-file component (.vue). Your task is to convert every hard-coded natural-language string in the <template> into our localization system using @vintl/vintl-nuxt (which wraps FormatJS).
5
+
You are given a Nuxt/Vue single-file component (.vue). Your task is to convert every hard-coded natural-language string in the <template> into our localization system using vue-i18n with utilities from `@modrinth/ui`.
6
6
7
7
Please follow these rules precisely:
8
8
@@ -13,40 +13,53 @@ Please follow these rules precisely:
13
13
14
14
2. Create message definitions
15
15
16
-
- In the <scriptsetup> block, import `defineMessage` or `defineMessages` from `@vintl/vintl`.
16
+
- In the <scriptsetup> block, import `defineMessage` or `defineMessages` from `@modrinth/ui`.
17
17
- For each extracted string, define a message with a unique `id` (use a descriptive prefix based on the component path, e.g. `auth.welcome.long-title`) and a `defaultMessage` equal to the original English string.
@@ -58,7 +71,8 @@ Please follow these rules precisely:
58
71
59
72
8. Update imports and remove literals
60
73
61
-
- Ensure imports for `defineMessage`/`defineMessages`, `useVIntl`, and `<IntlFormatted>` are present. Replace all hard-coded strings with `formatMessage(...)` or `<IntlFormatted>` and remove the literals.
74
+
- Ensure imports from `@modrinth/ui` are present: `defineMessage`/`defineMessages`, `useVIntl`, `IntlFormatted`, and optionally `normalizeChildren`.
75
+
- Replace all hard-coded strings with `formatMessage(...)` or `<IntlFormatted>` and remove the literals.
"message": "Changing the site language may cause some content to appear in English if a translation is not available. The site is not yet fully translated, so some content may remain in English for certain languages. We are still working on improving our localization system, so occasionally content may appear broken."
0 commit comments