File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ npmx.dev uses [@nuxtjs/i18n](https://i18n.nuxtjs.org/) for internationalization.
214214
215215### Approach
216216
217- - All user-facing strings should use translation keys via ` $t() ` in templates or ` t() ` in script
217+ - All user-facing strings should use translation keys via ` $t() ` in templates and script
218218- Translation files live in ` i18n/locales/ ` (e.g., ` en.json ` )
219219- We use the ` no_prefix ` strategy (no ` /en/ ` or ` /fr/ ` in URLs)
220220- Locale preference is stored in cookies and respected on subsequent visits
@@ -233,8 +233,9 @@ npmx.dev uses [@nuxtjs/i18n](https://i18n.nuxtjs.org/) for internationalization.
233233 Or in script:
234234
235235 ``` typescript
236- const { t } = useI18n ()
237- const message = t (' my.translation.key' )
236+ < script setup lang = " ts" >
237+ const message = computed (() => $t (' my.translation.key' ))
238+ < / script >
238239 ```
239240
2402413 . For dynamic values, use interpolation:
You can’t perform that action at this time.
0 commit comments