How to translate Strapi v4 Admin Panel
To translate Strapi’s V4 admin panel frontend first make sure you are running Strapi server using:
strapi develop --watch-admin
command or else you’ll need to run strapi build
for every change.
I spent a good 30min until I found out this.
So, go to the file src/admin/app.js
and add the translates that you need:
export default {
config: {
// others configs
locales: [
"pt-BR",
"fr"
],
},
};
But note that is not possible to remove the English en
translation because is the Strapi Admin Panel fallback language.
Overwriting
To overwrite any existing translation add a translations
key inside the config
object with the translation key/value of the language. You can see all Strapi default translations here or inside your project’s node_modules @strapi/admin/admin/src/translations/[language-name].json
.
Here is an example to translate the Strapi navbar title and subtitle:
export default {
config: {
// others configs
locales: [
"pt-BR",
"fr"
],
translations: {
"pt-BR": {
"app.components.LeftMenu.navbrand.title": "Painel Admin",
"app.components.LeftMenu.navbrand.workplace": "mywebsite.com",
},
fr: {
"app.components.LeftMenu.navbrand.title": "Panneau d'administration",
"app.components.LeftMenu.navbrand.workplace": "mywebsite.com",
},
},
},
};
Result
After following the previous steps you will see language select at your profile page /admin/me
and the login page.
Language select at Login page:
Language select at Profile page: