Skip to content

Commit 2e0595b

Browse files
authored
fix(translations): update etTranslations type to DefaultTranslationsObject (#10358)
After merging this PR: #10169 the estonian language pack has been published, but since the translation type was not correct, it meant en wasn't used as a fallback lanugage, which resulted the whole app to crash: In the Browser the following error is shown, if Estonian language is picked. ``` Error: Cannot read properties of undefined (reading 'default') at resolveErrorDev (webpack-internal:///(app-pages-browser)/./node_modules/.pnpm/next@15.1.3_react-dom@19.0.0_react@19.0.0__react@19.0.0_sass@1.77.4/node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js:1792:63) at processFullStringRow (webpack-internal:///(app-pages-browser)/./node_modules/.pnpm/next@15.1.3_react-dom@19.0.0_react@19.0.0__react@19.0.0_sass@1.77.4/node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js:2071:17) at processFullBinaryRow (webpack-internal:///(app-pages-browser)/./node_modules/.pnpm/next@15.1.3_react-dom@19.0.0_react@19.0.0__react@19.0.0_sass@1.77.4/node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js:2059:7) at progress (webpack-internal:///(app-pages-browser)/./node_modules/.pnpm/next@15.1.3_react-dom@19.0.0_react@19.0.0__react@19.0.0_sass@1.77.4/node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js:2262:17) ``` Fixes # This is now fixed by adding the correct type to the translation object.
1 parent 43b40f0 commit 2e0595b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/translations/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The home of Payloads API and Admin Panel translations.
3131
#### Adding a new language
3232

3333
1. Create a new TS file in the `<payload-repo-root>/packages/translations/src/languages` folder, use the language code as the file name (e.g. `<payload-repo-root>/packages/translations/src/languages/en.ts` for English)
34-
2. Copy all translations from an existing language file and update all of the translations to match your new language
34+
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`.
3535
3. Run one of the following:
3636
```sh
3737
yarn build

packages/translations/src/languages/et.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { Language } from '../types.js'
1+
import type { DefaultTranslationsObject, Language } from '../types.js'
22

3-
export const etTranslations = {
3+
export const etTranslations: DefaultTranslationsObject = {
44
authentication: {
55
account: 'Konto',
66
accountOfCurrentUser: 'Praeguse kasutaja konto',

0 commit comments

Comments
 (0)