Skip to content

Conversation

@VeiaG
Copy link
Contributor

@VeiaG VeiaG commented Dec 20, 2025

What?

Added internationalization (i18n) support for the Modular Dashboards feature, allowing dashboard widgets and UI elements to be translated into different languages.
Also updated the automatic translation script to use the more efficient and cost-effective GPT-4.1 model instead of GPT-4. (i thinks this is must-have)

Why?

The Modular Dashboards feature previously had almost no translation support, making it inaccessible for non-English Payload CMS users.
This was particularly important for international communities who need localized admin interfaces.

Additionally, the translation automation script was using the expensive GPT-4 model, which quickly exhausted OpenAI API credits during translation work.

How?

Added new translation keys to all buttons & error inside Modular Dashboard. Translated all keys

Translation Script Update:
Changed model from gpt-4 to gpt-4.1 in the automatic translation script
Maintained same translation quality while significantly reducing API costs (multiple times cheaper)

Testing:

Verified translations load correctly in different locales ( uk/en ) in pnpm dev dashboard

Screenshots

image image image image
- Added new translations for dashboard features in multiple languages including Croatian, Hungarian, Armenian, Indonesian, Icelandic, Italian, Japanese, Korean, Lithuanian, Latvian, Malay, Norwegian, Dutch, Polish, Portuguese, Romanian, Serbian, Serbian Latin, Russian, Slovak, Slovenian, Swedish, Tamil, Thai, Turkish, Ukrainian, Vietnamese, Chinese (Simplified), and Chinese (Traditional).
- Updated TypeScript configuration to include additional paths and improved formatting for better readability.
- Included the Ukrainian language support in the build configuration.
- Updated `useDashboardLayout.ts` to use translation keys for error messages when saving and resetting layout.
- Added new translation keys: `error:failedToSaveLayout` and `error:failedToResetLayout` in `clientKeys.ts`.
- Provided translations for the new keys in multiple languages including Arabic, Azerbaijani, Bulgarian, Bengali, and more.
- Removed unused import of `uk` translations in `buildConfigWithDefaults.ts`.
- Updated translation model to `gpt-4.1` in `translateText.ts`.
@VeiaG VeiaG requested a review from denolfe as a code owner December 20, 2025 15:07
@VeiaG VeiaG changed the title feat(modular-dashboard): add i18n translations for modular dashboards Dec 20, 2025
},
],
model: 'gpt-4',
model: 'gpt-4.1',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change will be of great benefit to other contributors.
If only I had known that this script uses the expensive gpt-4...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant