Strapi v4 Translate admin panel

Hello everyone and happy new year!

I’m looking for the exact same thing as this older topic here but for strapi v4. I saw that the fields content can be internationalized in v4 content builder, but can’t find the same feature for the field names or collection names themselves.

Looking at this other topic, I’d like to ask what the preferred way to translate the labels/collections would be (in the admin panel).

Is this seen as an admin panel customization? Or is there a planned feature/plugin for it in strapi4?

Big thanks in advance,
Pierre

Hi, I’m a little late my friend Pierre, but I think I found a solution that might fit your context.

In this section of the Strapi documentation there is an explanation of how you can translate the names of the collections, in the “Extending translations” part.

image

I would also like to translate the labels(id, createdAt, updatedAt and any other fields that were created in the collection) from the table, investigating I saw that there was a section in Strapi’s translation files that indicated the title of each label, something like:

"content-manager.containers.ListPage.table-headers.publishedAt": "Status"

From that I saw that replacing “publishedAt” for the name of the field I created in the collection could translate to any location, for example:

"content-manager.containers.ListPage.table-headers.WHATEVER": "Your translation"

At the end of it all, the app.js file for Strapi’s configuration would look something like this:

export default {
  config: {
    locales: ['es-MX', 'pt-BR'],
    translations: {
      'pt-BR': {
        Restaurant: 'Restaurantes',
        User: 'Usuários',
        "content-manager.containers.ListPage.table-headers.title": 'Título', // Field created in the collection
        'content-manager.containers.ListPage.table-headers.createdAt': 'Criado em',
        'content-manager.containers.ListPage.table-headers.updatedAt': 'Atualizado em',
      },
      'es-MX': {
        Restaurant: 'Restaurantes',
        User: 'Usuarios',
        "content-manager.containers.ListPage.table-headers.title": 'Título',
        'content-manager.containers.ListPage.table-headers.createdAt': 'Creado en',
        'content-manager.containers.ListPage.table-headers.updatedAt': 'Actualizado',
      },
    },
  },
  bootstrap() {},
};

Content table: Sem-T-tulo-1 — ImgBB

I haven’t tested everything yet to see if it has any side effects, but it actually solved the problem I was having, hope it helps you.

Comments:

  1. I used the Google translation so if you don’t understand something let me know;
  2. If something was poorly explained I will try to improve and give more details.

Any doubt I am available :slight_smile:
Sincerely Vitor

2 Likes

Great answer.

If I have a Locations collection type with address, city, and country fields (image below).

This code "content-manager.containers.ListPage.table-headers.address": "Alamat" only works for displaying the label of the table header (image below).

The code doesn’t work for the label when creating a new entry (image below).

How could we translate the label when a user is creating a new entry?