How to override plugin translations?

Hello there!

I am trying to override “strapi-plugin-content-type-builder” translation files without modifying node_modules folder.

And for that, I have created “\extensions\strapi-plugin-content-type-builder\admin\src\translations” directory and added the modified language files in it in json format, also made an index.js like this one:

import en from './en.json';
import tr from './tr.json';

const trads = {
  en,
  tr
};

export default trads;

But it didn’t work. I still see the original translations that was is the json files in “node_modules\strapi-plugin-content-type-builder\admin\src\translations”

How can I override the original json files with the new ones? Thanks.

1 Like

So anyone?

Hi,

As soon as you want to extend an existing plugin you have to create a folder in the extensions folder. This folder should be named by the plugin ID: Strapi plugins - Strapi Developer Documentation

In your case I think that the strapi-plugin-content-type-builder ID is content-type-builder

1 Like

It worked! Thank you.

1 Like

Can you check the answer as a solution in order to help other people who have this kind of “issue” :wink:

Hi,

I’m using latest version of Strapi v4.1.11 and created following structure of content-type-builder extension:

Screenshot from 2022-05-16 09-51-25

pl.json:

{
  "plugin.name": "Modelowanie danych"
}

index.js:

import pl from './pl.json';

const trads = {
  pl,
};

export const languageNativeNames = {
  pl: 'Polski',
};

export default trads;

It still doesn’t override translation, even though I have content-type-builder directory name. I tried it with different keys in json, and it doesn’t work as well.

Did the override system changed in the newest version or am I doing something wrong? Thanks

1 Like

Hello

Did you find a solution to this
Simply overriding default structure from the repo in “extensions” directory doesn’t seem to work at all

Same here, I’m trying to override a script in the content-manager.

image

oh, I’ve found it!

It is written in the documentation:

You don’t need to recreate the file structure of the plugin. Instead, you override the controllers etc. in the strapi-server.js.