[packages] ]feat(i18n): replace quetzal with i18next for translations#1129
[packages] ]feat(i18n): replace quetzal with i18next for translations#1129madster456 wants to merge 2 commits intodevfrom
Conversation
Migrate from quetzal (deprecated) to i18next for internationalization.
JSON locale files are now the source of truth and can be directly edited.
Changes:
- Add i18next dependency
- Create editable JSON locale files for 13 languages
- Add generate-i18next-locales script to bundle translations
- Consolidate translation providers into single TranslationProvider
- Remove quetzal-based translation-provider-client
The translation API remains backward compatible:
- useTranslation() returns { t: (str, vars?) => string }
- StackProvider accepts lang and translationOverrides props
- Same supported locales: de-DE, en-US, es-419, es-ES, fr-CA, fr-FR,
it-IT, ja-JP, ko-KR, pt-BR, pt-PT, zh-CN, zh-TW
To edit translations:
1. Edit JSON files in packages/template/src/locales/
2. Run: pnpm run generate-i18next-locales
3. Run: pnpm run generate-sdks~
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis PR introduces comprehensive internationalization (i18n) support by moving i18next to production dependencies across multiple packages, adding 12 locale JSON files for various languages, implementing a locale generation script, refactoring the translation provider to use i18next with React Context, and updating the translation hook to leverage the new provider architecture. Changes
Sequence Diagram(s)sequenceDiagram
participant App as Application
participant TP as TranslationProvider
participant i18n as i18next Instance
participant TC as TranslationContext
participant useTC as useTranslationContext Hook
participant Hook as useTranslation Hook
App->>TP: Render with lang, translationOverrides
TP->>TP: Derive effectiveLocale from lang + supportedLocales
TP->>TP: Merge base locale + overrides
TP->>i18n: Create i18n instance with merged resources
TP->>i18n: Initialize synchronously
TP->>TC: Provide { i18n, locale } via context
Hook->>useTC: Call useTranslationContext()
useTC->>TC: Access TranslationContext
TC-->>useTC: Return { i18n, locale }
useTC-->>Hook: Expose context value
Hook->>i18n: Call context.i18n.t(key)
i18n-->>Hook: Return translated string
Hook-->>App: Provide t function for UI rendering
Note over TP,i18n: On lang/translationOverrides change
TP->>TP: Update effectiveLocale
TP->>i18n: Update resource bundles
TP->>i18n: Change language
i18n-->>App: Re-render with new translations
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~35 minutes Possibly Related PRs
Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR migrates the internationalization system from quetzal (deprecated) to i18next. JSON locale files are now the editable source of truth for all 13 supported languages (305 translation keys each). Key Changes:
Issues Found:
Translation Editing Workflow:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant JSON as locale/*.json
participant Script as generate-i18next-locales.ts
participant Index as locales/index.ts
participant SP as StackProvider
participant TP as TranslationProvider
participant i18n as i18next instance
participant Comp as Component
participant Hook as useTranslation()
Note over Dev,JSON: Translation Editing Flow
Dev->>JSON: Edit translation keys
Dev->>Script: Run pnpm run generate-i18next-locales
Script->>JSON: Read all JSON files
Script->>Index: Generate TypeScript with inlined translations
Note over SP,Hook: Runtime Translation Flow
SP->>TP: Pass lang & translationOverrides props
TP->>Index: Import locales[lang]
TP->>TP: Merge baseTranslations with translationOverrides
TP->>i18n: Create i18next instance with resources
TP->>i18n: Initialize with merged translations
TP->>Comp: Provide TranslationContext
Comp->>Hook: Call useTranslation()
Hook->>i18n: Access i18n.t() function
Hook->>Comp: Return t(key, vars)
Comp->>i18n: Call t("Hello, {name}!", {name: "World"})
i18n->>Comp: Return "Hello, World!"
|
| const translations = { | ||
| ...baseTranslations, | ||
| ...translationOverrides, | ||
| }; |
There was a problem hiding this comment.
logic: Spreading translationOverrides into a plain object could allow prototype pollution if user provides keys like __proto__ or constructor.
| const translations = { | |
| ...baseTranslations, | |
| ...translationOverrides, | |
| }; | |
| // Merge with overrides using Map to prevent prototype pollution | |
| const translations = new Map(Object.entries(baseTranslations)); | |
| if (translationOverrides) { | |
| for (const [key, value] of Object.entries(translationOverrides)) { | |
| translations.set(key, value); | |
| } | |
| } |
Context Used: Rule from dashboard - Use Map<A, B> instead of plain objects when using dynamic keys to avoid prototype pollution vulnerab... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/template/src/providers/translation-provider.tsx
Line: 46:49
Comment:
**logic:** Spreading `translationOverrides` into a plain object could allow prototype pollution if user provides keys like `__proto__` or `constructor`.
```suggestion
// Merge with overrides using Map to prevent prototype pollution
const translations = new Map(Object.entries(baseTranslations));
if (translationOverrides) {
for (const [key, value] of Object.entries(translationOverrides)) {
translations.set(key, value);
}
}
```
**Context Used:** Rule from `dashboard` - Use Map<A, B> instead of plain objects when using dynamic keys to avoid prototype pollution vulnerab... ([source](https://app.greptile.com/review/custom-context?memory=cd0e08f7-0df2-43c8-8c71-97091bba4120))
How can I resolve this? If you propose a fix, please make it concise.| const translations = { | ||
| ...baseTranslations, | ||
| ...translationOverrides, | ||
| }; |
There was a problem hiding this comment.
logic: Same prototype pollution risk as lines 46-49 with spreading translationOverrides into plain object.
Context Used: Rule from dashboard - Use Map<A, B> instead of plain objects when using dynamic keys to avoid prototype pollution vulnerab... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/template/src/providers/translation-provider.tsx
Line: 82:85
Comment:
**logic:** Same prototype pollution risk as lines 46-49 with spreading `translationOverrides` into plain object.
**Context Used:** Rule from `dashboard` - Use Map<A, B> instead of plain objects when using dynamic keys to avoid prototype pollution vulnerab... ([source](https://app.greptile.com/review/custom-context?memory=cd0e08f7-0df2-43c8-8c71-97091bba4120))
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Actionable comments posted: 14
🤖 Fix all issues with AI agents
In `@packages/template/src/locales/de-DE.json`:
- Line 14: Replace the remaining English values in
packages/template/src/locales/de-DE.json with German translations for the keys
found at the indicated locations (e.g., the "Amount" key and the other keys at
lines 55, 119, 211, 272, 292); update each value to the correct German string
(e.g., "Amount" -> "Betrag") preserving the JSON key names and punctuation, run
a quick JSON validation, and ensure capitalization/terminology is consistent
with other de-DE entries.
In `@packages/template/src/locales/en-US.json`:
- Line 300: Fix the typo in the locale key and value by renaming the translation
key "You email has been verified!" to "Your email has been verified!" in
en-US.json and update the value to match; then propagate this new key name
across all other locale files and any code references (e.g., components or hooks
that call the translation key) so they use the corrected "Your email has been
verified!" key.
In `@packages/template/src/locales/es-419.json`:
- Line 14: Update the Spanish locale entries that are still in English by
replacing the values for the keys "Amount", "Date", "Invoice", "Unavailable",
and "View" with appropriate Spanish translations (e.g., "Monto" or "Cantidad"
for "Amount", "Fecha" for "Date", "Factura" for "Invoice", "No disponible" for
"Unavailable", and "Ver" for "View") in the es-419 JSON so the keys remain the
same but their values are translated.
In `@packages/template/src/locales/es-ES.json`:
- Line 14: The JSON keys "Amount", "Date", "Invoice", "Unavailable", and "View"
currently have English values; update their values in es-ES.json to Spanish to
match es-419.json — set "Amount" -> "Cantidad", "Date" -> "Fecha", "Invoice" ->
"Factura", "Unavailable" -> "No disponible", and "View" -> "Ver" so the
translations are consistent across locales.
In `@packages/template/src/locales/fr-CA.json`:
- Line 14: Several entries in the fr-CA locale JSON still have English values;
update the JSON values for the key "Amount" and the other entries flagged at
lines 119, 272, and 292 so they are translated to French Canadian (keep the JSON
keys unchanged and preserve existing punctuation/escape sequences). Locate the
"Amount" key and the three other keys that currently map to English strings,
replace their English values with the correct fr-CA translations (e.g.,
"Montant" for "Amount" or the appropriate localized phrases), and ensure the
file remains valid JSON (no trailing commas, correct quoting).
In `@packages/template/src/locales/fr-FR.json`:
- Line 14: Several entries in fr-FR locale are still English (e.g., the "Amount"
key and three other entries at lines referenced in the review); update those
JSON values to French translations or explicitly point them to the en-US
fallback. Locate the "Amount" key in fr-FR.json and replace its value with the
correct French string (and do the same for the entries currently English at the
other two referenced positions), ensuring valid JSON and consistent key names;
if you intentionally want to fallback, replace the value with a clear reference
to use en-US (or remove/merge with the existing en-US import) so the UI won’t
show mixed-language text.
In `@packages/template/src/locales/it-IT.json`:
- Line 14: Update the untranslated Italian locale entries by replacing the
English values for the specified keys with Italian equivalents: change the
"Amount" value to "Importo", "Date" to "Data", "Invoice" to "Fattura",
"Unavailable" to "Non disponibile", and "View" to "Visualizza" in the it-IT
JSON; ensure you update the keys "Amount", "Date", "Invoice", "Unavailable", and
"View" consistently (same pattern exists across other locale files) and keep
JSON formatting and commas intact.
In `@packages/template/src/locales/ja-JP.json`:
- Line 14: Several localization values in ja-JP.json are still English (e.g.,
the "Amount" key) and must be localized; open the ja-JP.json locale file and
replace the English string values for the untranslated keys (the entries that
remain in English on the noted lines) with proper Japanese translations,
ensuring each key (such as "Amount" and the other untranslated keys) has a
Japanese value and that JSON formatting and quoting are preserved.
In `@packages/template/src/locales/ko-KR.json`:
- Line 14: Several localization entries in locales/ko-KR.json are still in
English; replace the English values for the keys "Amount", "Date", "Invoice",
"Review past invoices and receipts.", "Unavailable", and "View" with their
proper Korean translations (or add a brief comment if keeping them intentionally
in English). Locate these keys in the JSON (e.g., the entries named "Amount",
"Date", "Invoice", the sentence "Review past invoices and receipts.",
"Unavailable", and "View") and update their string values to the correct Korean
text, ensuring valid JSON string quoting and preserving surrounding commas and
whitespace.
In `@packages/template/src/locales/pt-BR.json`:
- Line 14: Replace the English placeholder values in the pt-BR locale JSON for
the specified keys: update the "Amount" key value to "Valor", the "Date" key
value to "Data", the "Invoice" key value to "Fatura", the "Unavailable" key
value to "Indisponível", and the "View" key value to "Visualizar" so that
"Amount", "Date", "Invoice", "Unavailable", and "View" in
packages/template/src/locales/pt-BR.json have their correct Brazilian Portuguese
translations.
In `@packages/template/src/locales/pt-PT.json`:
- Line 14: Several pt-PT locale entries are still in English; update the JSON
values for the listed keys to European Portuguese: change "Amount" ->
"Montante", "Date" -> "Data", "Invoice" -> "Fatura", "Review past invoices and
receipts." -> "Rever faturas e recibos anteriores.", "Unavailable" ->
"Indisponível", and "View" -> "Ver"; locate these keys in the pt-PT locale file
(keys: "Amount", "Date", "Invoice", "Review past invoices and receipts.",
"Unavailable", "View") and replace their values accordingly, ensuring proper
JSON quoting and comma placement.
In `@packages/template/src/locales/zh-CN.json`:
- Line 14: Replace the untranslated English values in the zh-CN JSON locale:
change the value for the "Amount" key to "金额", for "Date" to "日期", for "Invoice"
to "发票" (to match "Invoices"), for "Unavailable" to "不可用", and for "View" to
"查看"; locate these keys ("Amount", "Date", "Invoice", "Unavailable", "View") in
the zh-CN.json and update their string values accordingly, keeping JSON
formatting intact and ensuring no duplicate keys are introduced.
- Line 300: Fix the typo in the translation key by renaming the source key "You
email has been verified!" to "Your email has been verified!" across all locale
files (e.g., in packages/template/src/locales/zh-CN.json) and ensure
corresponding entries in other locale files and any references in code (template
lookup keys) are updated to the corrected key so translations remain consistent.
In `@packages/template/src/locales/zh-TW.json`:
- Line 14: Replace the English placeholder values in the zh-TW locale JSON with
their Traditional Chinese translations: update the "Amount" key value to "金額",
"Date" to "日期", "Invoice" to "發票", "Unavailable" to "不可用", and "View" to "檢視" in
the locales/zh-TW.json file (look for the exact keys "Amount", "Date",
"Invoice", "Unavailable", "View" to locate the entries) and ensure the JSON
remains valid after edits.
♻️ Duplicate comments (1)
packages/react/package.json (1)
95-95: Same leftover dependency as noted in packages/stack/package.json.The
@quetzallabs/i18nshould be removed from the template if no longer needed.
🧹 Nitpick comments (7)
packages/template/src/locales/zh-CN.json (2)
233-233: Minor inconsistency in placeholder spacing.The spacing around
{provider}is inconsistent between similar strings:
- Line 233:
"使用{provider}登录"(no spaces)- Line 239:
"用 {provider} 注册"(with spaces)This is a minor style nit, but consider standardizing for consistency.
Also applies to: 239-239
216-216: Translation appears redundant.
"Secret API Key": "密钥 API 密钥"reads awkwardly as "密钥" (secret/key) is repeated, resulting in something like "secret key API secret key."Consider a cleaner translation:
Suggested fix
- "Secret API Key": "密钥 API 密钥", + "Secret API Key": "私密 API 密钥",packages/stack/package.json (1)
102-102: Consider removing the deprecated@quetzallabs/i18ndependency.The
@quetzallabs/i18npackage remains in devDependencies but the PR description states quetzal is being replaced. If this dependency is no longer needed, it should be removed frompackages/template/package-template.json(since this file is auto-generated).packages/template/package-template.json (1)
79-80: Wire locale generation into codegen to prevent stale bundlesThe
generate-i18next-localesscript should be integrated into the codegen pipeline (alongside css and quetzal generation) to ensure locales are automatically regenerated during builds and CI checks. Currently it's standalone, which risks developers accidentally shipping stale locale files.Regarding i18next v23.14.0: the project's Node.js minimum (>= 20.0.0) already exceeds the package's requirement (>= 14.0.0), so there are no compatibility concerns.
packages/template/scripts/generate-i18next-locales.ts (2)
38-43: Add error handling for malformed JSON files.If a JSON file contains invalid syntax,
JSON.parsewill throw a generic error without indicating which file caused the issue. Wrapping this in a try-catch with the filename would improve debugging experience.♻️ Suggested improvement
for (const file of jsonFiles) { const localeName = file.replace('.json', ''); const content = fs.readFileSync(path.join(localesDir, file), 'utf-8'); - localeData[localeName] = JSON.parse(content); + try { + localeData[localeName] = JSON.parse(content); + } catch (err) { + throw new Error(`Failed to parse ${file}: ${err instanceof Error ? err.message : String(err)}`); + } console.log(`Read ${file} (${Object.keys(localeData[localeName]).length} keys)`); }
75-78: Consider usingrunAsynchronouslyfor consistency with coding guidelines.The coding guidelines discourage
.catch(console.error)patterns. While this is a CLI script entry point where catch-all is commonly acceptable, usingrunAsynchronouslywould maintain consistency with the codebase patterns.♻️ Alternative using runAsynchronously
+import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises"; + -main().catch(err => { - console.error(err); - process.exit(1); -}); +runAsynchronously(main());Note: This depends on how
runAsynchronouslyhandles errors in CLI contexts. If it doesn't callprocess.exit(1)on failure, the current approach may be more appropriate for build scripts that need to signal failure to CI systems.packages/template/src/providers/translation-provider.tsx (1)
8-11: Useinterfaceinstead oftypefor object shapes.Per coding guidelines, prefer
interfacefor defining object shapes in TypeScript.♻️ Suggested change
-export type TranslationContextValue = { +export interface TranslationContextValue { i18n: I18nInstance, locale: SupportedLocale, -}; +}
| "Add new passkey": "Neue Passkey hinzufügen", | ||
| "Add your email address": "E-Mail-Adresse hinzufügen", | ||
| "Already have an account?": "Haben Sie bereits ein Konto?", | ||
| "Amount": "Amount", |
There was a problem hiding this comment.
Translate remaining English strings in de-DE
Line 14, Line 55, Line 119, Line 211, Line 272, and Line 292 are still English. Please localize to avoid a mixed-language UI.
Also applies to: 55-55, 119-119, 211-211, 272-272, 292-292
🤖 Prompt for AI Agents
In `@packages/template/src/locales/de-DE.json` at line 14, Replace the remaining
English values in packages/template/src/locales/de-DE.json with German
translations for the keys found at the indicated locations (e.g., the "Amount"
key and the other keys at lines 55, 119, 211, 272, 292); update each value to
the correct German string (e.g., "Amount" -> "Betrag") preserving the JSON key
names and punctuation, run a quick JSON validation, and ensure
capitalization/terminology is consistent with other de-DE entries.
| "You are not currently signed in.": "You are not currently signed in.", | ||
| "You can not remove your last sign-in email": "You can not remove your last sign-in email", | ||
| "You cannot revoke your current session": "You cannot revoke your current session", | ||
| "You email has been verified!": "You email has been verified!", |
There was a problem hiding this comment.
Typo: "You email" should be "Your email".
This typo in the source locale will appear in the UI. The key itself contains the typo, which means other locale files reference this same typo as their key.
Proposed fix
- "You email has been verified!": "You email has been verified!",
+ "Your email has been verified!": "Your email has been verified!",Note: This key change will also need to be propagated to all other locale files and any code referencing this translation key.
📝 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.
| "You email has been verified!": "You email has been verified!", | |
| "Your email has been verified!": "Your email has been verified!", |
🤖 Prompt for AI Agents
In `@packages/template/src/locales/en-US.json` at line 300, Fix the typo in the
locale key and value by renaming the translation key "You email has been
verified!" to "Your email has been verified!" in en-US.json and update the value
to match; then propagate this new key name across all other locale files and any
code references (e.g., components or hooks that call the translation key) so
they use the corrected "Your email has been verified!" key.
| "Add new passkey": "Agregar nueva clave de acceso", | ||
| "Add your email address": "Agrega tu correo electrónico", | ||
| "Already have an account?": "¿Ya tienes una cuenta?", | ||
| "Amount": "Amount", |
There was a problem hiding this comment.
Several strings remain untranslated.
The following keys have English values instead of Spanish translations:
- Line 14:
"Amount"→ Consider "Monto" or "Cantidad" - Line 55:
"Date"→ Consider "Fecha" - Line 119:
"Invoice"→ Consider "Factura" - Line 272:
"Unavailable"→ Consider "No disponible" - Line 292:
"View"→ Consider "Ver"
Also applies to: 55-55, 119-119, 272-272, 292-292
🤖 Prompt for AI Agents
In `@packages/template/src/locales/es-419.json` at line 14, Update the Spanish
locale entries that are still in English by replacing the values for the keys
"Amount", "Date", "Invoice", "Unavailable", and "View" with appropriate Spanish
translations (e.g., "Monto" or "Cantidad" for "Amount", "Fecha" for "Date",
"Factura" for "Invoice", "No disponible" for "Unavailable", and "Ver" for
"View") in the es-419 JSON so the keys remain the same but their values are
translated.
| "Add new passkey": "Añadir nueva clave de acceso", | ||
| "Add your email address": "Añade tu dirección de correo electrónico", | ||
| "Already have an account?": "¿Ya tienes una cuenta?", | ||
| "Amount": "Amount", |
There was a problem hiding this comment.
Several strings remain untranslated (same as es-419).
For consistency with es-419.json, the same keys need Spanish translations:
- Line 14:
"Amount" - Line 55:
"Date" - Line 119:
"Invoice" - Line 272:
"Unavailable" - Line 292:
"View"
Also applies to: 55-55, 119-119, 272-272, 292-292
🤖 Prompt for AI Agents
In `@packages/template/src/locales/es-ES.json` at line 14, The JSON keys "Amount",
"Date", "Invoice", "Unavailable", and "View" currently have English values;
update their values in es-ES.json to Spanish to match es-419.json — set "Amount"
-> "Cantidad", "Date" -> "Fecha", "Invoice" -> "Factura", "Unavailable" -> "No
disponible", and "View" -> "Ver" so the translations are consistent across
locales.
| "Add new passkey": "Ajouter une nouvelle clé d'accès", | ||
| "Add your email address": "Ajoutez votre adresse courriel", | ||
| "Already have an account?": "Vous avez déjà un compte?", | ||
| "Amount": "Amount", |
There was a problem hiding this comment.
Translate remaining English strings in fr-CA
Line 14, Line 119, Line 272, and Line 292 still map to English values. Please translate to avoid mixed-language UI.
Also applies to: 119-119, 272-272, 292-292
🤖 Prompt for AI Agents
In `@packages/template/src/locales/fr-CA.json` at line 14, Several entries in the
fr-CA locale JSON still have English values; update the JSON values for the key
"Amount" and the other entries flagged at lines 119, 272, and 292 so they are
translated to French Canadian (keep the JSON keys unchanged and preserve
existing punctuation/escape sequences). Locate the "Amount" key and the three
other keys that currently map to English strings, replace their English values
with the correct fr-CA translations (e.g., "Montant" for "Amount" or the
appropriate localized phrases), and ensure the file remains valid JSON (no
trailing commas, correct quoting).
| "Add new passkey": "Adicionar nova chave de acesso", | ||
| "Add your email address": "Adicione seu endereço de email", | ||
| "Already have an account?": "Já tem uma conta?", | ||
| "Amount": "Amount", |
There was a problem hiding this comment.
Missing translations for pt-BR locale.
Several keys retain English values instead of Brazilian Portuguese translations:
- Line 14:
"Amount": "Amount"→ should be"Valor" - Line 55:
"Date": "Date"→ should be"Data" - Line 119:
"Invoice": "Invoice"→ should be"Fatura" - Line 272:
"Unavailable": "Unavailable"→ should be"Indisponível" - Line 292:
"View": "View"→ should be"Visualizar"
Also applies to: 55-55, 119-119, 272-272, 292-292
🤖 Prompt for AI Agents
In `@packages/template/src/locales/pt-BR.json` at line 14, Replace the English
placeholder values in the pt-BR locale JSON for the specified keys: update the
"Amount" key value to "Valor", the "Date" key value to "Data", the "Invoice" key
value to "Fatura", the "Unavailable" key value to "Indisponível", and the "View"
key value to "Visualizar" so that "Amount", "Date", "Invoice", "Unavailable",
and "View" in packages/template/src/locales/pt-BR.json have their correct
Brazilian Portuguese translations.
| "Add new passkey": "Adicionar nova chave de acesso", | ||
| "Add your email address": "Adicione o seu endereço de email", | ||
| "Already have an account?": "Já tem uma conta?", | ||
| "Amount": "Amount", |
There was a problem hiding this comment.
Missing translations for pt-PT locale.
Several keys retain English values instead of European Portuguese translations:
- Line 14:
"Amount": "Amount"→ should be"Montante" - Line 55:
"Date": "Date"→ should be"Data" - Line 119:
"Invoice": "Invoice"→ should be"Fatura" - Line 211:
"Review past invoices and receipts."→ should be"Rever faturas e recibos anteriores." - Line 272:
"Unavailable": "Unavailable"→ should be"Indisponível" - Line 292:
"View": "View"→ should be"Ver"
Note: Line 211 appears to be translated in pt-BR but not in pt-PT.
Also applies to: 55-55, 119-119, 211-211, 272-272, 292-292
🤖 Prompt for AI Agents
In `@packages/template/src/locales/pt-PT.json` at line 14, Several pt-PT locale
entries are still in English; update the JSON values for the listed keys to
European Portuguese: change "Amount" -> "Montante", "Date" -> "Data", "Invoice"
-> "Fatura", "Review past invoices and receipts." -> "Rever faturas e recibos
anteriores.", "Unavailable" -> "Indisponível", and "View" -> "Ver"; locate these
keys in the pt-PT locale file (keys: "Amount", "Date", "Invoice", "Review past
invoices and receipts.", "Unavailable", "View") and replace their values
accordingly, ensuring proper JSON quoting and comma placement.
| "Add new passkey": "添加新密钥", | ||
| "Add your email address": "添加您的邮箱地址", | ||
| "Already have an account?": "已有账户?", | ||
| "Amount": "Amount", |
There was a problem hiding this comment.
Several strings are left untranslated.
The following keys have English values instead of Chinese translations:
- Line 14:
"Amount": "Amount"→ should be"金额" - Line 55:
"Date": "Date"→ should be"日期" - Line 119:
"Invoice": "Invoice"→ should be"发票"(matching "Invoices" on line 120) - Line 272:
"Unavailable": "Unavailable"→ should be"不可用" - Line 292:
"View": "View"→ should be"查看"
Suggested fix
- "Amount": "Amount",
+ "Amount": "金额",- "Date": "Date",
+ "Date": "日期",- "Invoice": "Invoice",
+ "Invoice": "发票",- "Unavailable": "Unavailable",
+ "Unavailable": "不可用",- "View": "View",
+ "View": "查看",Also applies to: 55-55, 119-119, 272-272, 292-292
🤖 Prompt for AI Agents
In `@packages/template/src/locales/zh-CN.json` at line 14, Replace the
untranslated English values in the zh-CN JSON locale: change the value for the
"Amount" key to "金额", for "Date" to "日期", for "Invoice" to "发票" (to match
"Invoices"), for "Unavailable" to "不可用", and for "View" to "查看"; locate these
keys ("Amount", "Date", "Invoice", "Unavailable", "View") in the zh-CN.json and
update their string values accordingly, keeping JSON formatting intact and
ensuring no duplicate keys are introduced.
| "You are not currently signed in.": "您当前未登录。", | ||
| "You can not remove your last sign-in email": "你不能删除最后一个用于登录的电子邮箱", | ||
| "You cannot revoke your current session": "你不能撤销当前会话", | ||
| "You email has been verified!": "您的邮箱已验证!", |
There was a problem hiding this comment.
Source key contains a typo.
The key "You email has been verified!" should be "Your email has been verified!". The Chinese translation correctly uses "您的邮箱" (your email), but the source key typo should be fixed across all locale files.
🤖 Prompt for AI Agents
In `@packages/template/src/locales/zh-CN.json` at line 300, Fix the typo in the
translation key by renaming the source key "You email has been verified!" to
"Your email has been verified!" across all locale files (e.g., in
packages/template/src/locales/zh-CN.json) and ensure corresponding entries in
other locale files and any references in code (template lookup keys) are updated
to the corrected key so translations remain consistent.
| "Add new passkey": "新增通行金鑰", | ||
| "Add your email address": "新增您的電子郵件地址", | ||
| "Already have an account?": "已經有帳號了嗎?", | ||
| "Amount": "Amount", |
There was a problem hiding this comment.
Missing translations for zh-TW locale.
Several keys retain English values instead of Traditional Chinese translations:
- Line 14:
"Amount": "Amount"→ should be"金額" - Line 55:
"Date": "Date"→ should be"日期" - Line 119:
"Invoice": "Invoice"→ should be"發票" - Line 272:
"Unavailable": "Unavailable"→ should be"不可用" - Line 292:
"View": "View"→ should be"檢視"
Also applies to: 55-55, 119-119, 272-272, 292-292
🤖 Prompt for AI Agents
In `@packages/template/src/locales/zh-TW.json` at line 14, Replace the English
placeholder values in the zh-TW locale JSON with their Traditional Chinese
translations: update the "Amount" key value to "金額", "Date" to "日期", "Invoice"
to "發票", "Unavailable" to "不可用", and "View" to "檢視" in the locales/zh-TW.json
file (look for the exact keys "Amount", "Date", "Invoice", "Unavailable", "View"
to locate the entries) and ensure the JSON remains valid after edits.
Migrate from quetzal (deprecated) to i18next for internationalization. JSON locale files are now the source of truth and can be directly edited.
Changes:
The translation API remains backward compatible:
To edit translations:
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.