From 7630e8725d82011ef9e56446afe0117c8b87fe32 Mon Sep 17 00:00:00 2001 From: Tristan Date: Sun, 5 Jan 2025 09:09:33 +0200 Subject: [PATCH 1/2] fix(et-translations): update etTranslations type to DefaultTranslationsObject to have a fallback --- packages/translations/src/languages/et.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/translations/src/languages/et.ts b/packages/translations/src/languages/et.ts index 8def17dcb8e..1f8559a72af 100644 --- a/packages/translations/src/languages/et.ts +++ b/packages/translations/src/languages/et.ts @@ -1,6 +1,6 @@ -import type { Language } from '../types.js' +import type { DefaultTranslationsObject, Language } from '../types.js' -export const etTranslations = { +export const etTranslations: DefaultTranslationsObject = { authentication: { account: 'Konto', accountOfCurrentUser: 'Praeguse kasutaja konto', From 7def004b06e3c9dc903c699cd8185efa13f1295c Mon Sep 17 00:00:00 2001 From: Tristan Date: Sun, 5 Jan 2025 09:15:48 +0200 Subject: [PATCH 2/2] docs(translations): clarify instructions for adding a new language with DefaultTranslationsObject type --- packages/translations/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/translations/README.md b/packages/translations/README.md index a6904beb5d5..a8e54d26cff 100644 --- a/packages/translations/README.md +++ b/packages/translations/README.md @@ -31,7 +31,7 @@ The home of Payloads API and Admin Panel translations. #### Adding a new language 1. Create a new TS file in the `/packages/translations/src/languages` folder, use the language code as the file name (e.g. `/packages/translations/src/languages/en.ts` for English) -2. Copy all translations from an existing language file and update all of the translations to match your new language +2. Copy all translations from an existing language file and update all of the translations to match your new language. Make sure the translation object containing all the translations is type `DefaultTranslationsObject`. 3. Run one of the following: ```sh yarn build