Hello ABP Team,
I'm using ABP Suite 10.4.1 with an ABP Framework 10.4.1 Blazor Server application.
My project contains multiple localization files for the same resource:
src/Project.Domain.Shared/Localization/Project/ de-DE.json en-GB.json it.json
The resource is configured as follows:
Configure<AbpLocalizationOptions>(options => { options.Resources .Add<ProjectResource>("it") .AddBaseTypes(typeof(AbpValidationResource)) .AddVirtualJson("/Localization/Project");
options.DefaultResourceType = typeof(ProjectResource);
options.Languages.Add(new LanguageInfo("it", "it", "Italian"));
options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)"));
options.Languages.Add(new LanguageInfo("de-DE", "de-DE", "German (Germany)"));
}); Steps to reproduce Create a new entity using ABP Suite. Generate the CRUD. Inspect the localization files. Actual behavior
ABP Suite generates the new localization keys only inside de-DE.json.
For example:
"HybridRegions": "Hybrid Regions", "NewHybridRegion": "New Hybrid Region", "Permission:HybridRegions": "Hybrid Regions", ...
No corresponding keys are generated in:
it.json en-GB.json
As a result, developers must manually copy and translate every new localization entry.
Expected behavior
One of the following behaviors would be expected:
Generate the new keys in all localization JSON files belonging to the resource. Or provide an option to select which language file(s) should be updated. Or document that Suite intentionally updates only one localization file.
Currently, only a single language file is modified, which seems inconsistent for projects using multiple supported cultures.
Additional information ABP Framework: 10.4.1 ABP Suite: 10.4.1 UI: Blazor Server Resource contains: it.json en-GB.json de-DE.json
Is this the intended behavior, or could this be a bug in ABP Suite?

1 Answer(s)
-
0
Hi,
Suite writes the generated keys into a single base localization file — that part is intentional, it doesn't fan them out to every culture file. The values it generates are English defaults (
"HybridRegions": "Hybrid Regions"etc.), so it only puts them in the base file and leaves the other cultures for your real translations, instead of dropping English text intoit.json/de-DE.json.The rough edge is the file it chose. Suite looks for
en.jsonfirst and writes there. YourLocalization/Projectfolder has noen.json, so it falls back to the first*.jsonit finds in the folder — that's why the keys ended up inde-DE.json. It's not a deliberate pick of German, and it's not even stable across machines, since the file enumeration order depends on the OS/filesystem.To make it predictable, add an
en.jsontoLocalization/Project:{ "culture": "en", "texts": {} }From then on every generation writes the new keys into
en.json, and you translate them intoit.json,en-GB.jsonandde-DE.jsonfrom there.To set expectations: there's no option today to write into all culture files at once, or to choose the target file — the
en.jsonfile only controls which file gets the keys, the translations themselves are still manual. We'll also review this fallback so it doesn't depend on the arbitrary file order.Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)