abp icon indicating copy to clipboard operation
abp copied to clipboard

Single json file for each language?

Open KevinFarrow opened this issue 7 years ago • 5 comments

In Zero we have one file for each language that we can easily export and have someone translate it for us. Now it looks there are so many (in different modules) that it's hard to ensure duplication doesn't creep in. Is it possible to have a single entry point with one file for each language?

When adding a new module the system could check each string and merge the data?

KevinFarrow avatar Oct 24 '19 19:10 KevinFarrow

Each module has its own localized resources, which is fine. The localization system supports Inherit and extends other localized resources (including localized resources in the module).

https://docs.abp.io/en/abp/latest/Localization

maliming avatar Oct 25 '19 01:10 maliming

@maliming Unfortunately that's not fine, it is a backward step. I need to be able to send a complete single file for translation just like we do in Zero. Best practises (DRY) suggest we don't repeat ourselves but the way it is implemented in abp.io goes against this.

KevinFarrow avatar Oct 28 '19 09:10 KevinFarrow

If an extension file defines the same localized string, it overrides the string.

I like the way it works right now. Localization system allows you to have all translations in the main file and override traslation from modules. This way you can work only on main json if you want to. Each module can be used in several apps, each app can have the same localized strings, but not necessary. It's not about DRY, it's about modularity.

Ice2burn avatar Oct 30 '19 15:10 Ice2burn

Yes, for example, someone developed a new module, the module contains some language translation, may not have the language you want to use, or you think his translation needs improvement.

The framework allows you to add new language translations or modify existing translations. This is enough. You know, for modularity.

maliming avatar Oct 31 '19 01:10 maliming

I am closing this since this is a result of the modularity, and it is by design. @KevinFarrow if you want, you can copy all texts to your json file, from modules you are using (while I definitely don't suggest it).

hikalkan avatar Nov 01 '19 09:11 hikalkan