Hello,
I am trying to upgrade from ABP 9.3.7 to ABP 10.4.1 and have encountered a localization issue - I am only seeing localization keys in the angular front-end and the application-localization endpoint is not returning my applications custom localization values in the relevant section: "MyApplication": { "texts": {}, "baseResources": [ "AbpValidation", "AbpUi" ] },.
I have not modified the embedded localization resources (en.json, etc.), the MyApplicationResource class, or the localization configuration in MyApplicationDomainSharedModule. I have verified that the en.json file is an Embedded Resource with Do Not Copy.
Do I need to modify the localization configuration as part of this migration? Why is this happening?
Thank you, Matt
4 Answer(s)
-
0
This happens when your embedded JSON localization files are no longer being served by the Virtual File System (VFS) after the upgrade, so the
/api/abp/application-localizationendpoint can only return the resource metadata (resource name + baseResources), but cannot read your embeddeden.json, therefore:- Angular shows localization keys (because texts aren’t available),
- and the endpoint returns
"texts": {}for your resource.
In ABP v10, a common cause (especially after upgrades) is that the project that contains your embedded localization JSONs (typically
*.Domain.Shared) does not referenceMicrosoft.Extensions.FileProviders.Embeddedanymore (or it wasn’t present). Without it, embedded files may not be discoverable by VFS at runtime in some setups.Fix: add the embedded file provider package to the project that contains the embedded json files (usually
MyApplication.Domain.Shared.csproj):
<ItemGroup> <PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="*" /> </ItemGroup>Then rebuild and rerun. After that,
/api/abp/application-localizationshould start returning your"MyApplication": { "texts": { ... } }content again.You do not need to change your localization configuration (e.g.
AddVirtualJson("/Localization/MyApplication")) if it was already correct and unchanged; this is typically a missing runtime dependency needed to read embedded resources.If you also have module/submodule resources, apply the same fix to each
*.Domain.Shared(or whichever assembly embeds the localization jsons).
Links (verified):
- https://abp.io/support/questions/9788
- https://docs.abp.io/en/abp/latest/Virtual-File-System#working-with-the-embedded-files
- https://docs.abp.io/en/abp/latest/Localization#extending-existing-resource
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
To narrow this down, could you share a few things:
- Your
MyApplication.Domain.Shared.csproj(full file). - Your
MyApplicationDomainSharedModule.cs— specifically theConfigureServicesmethod. - The full JSON response from
/api/abp/application-localization?cultureName=en— we'd like to see whether other resources (likeAbpIdentity,AbpUi, etc.) also have emptytexts, or only yourMyApplicationresource.
In the meantime, you can try this. Your symptom usually comes from
Microsoft.Extensions.FileProviders.Embeddedbeing missing or pruned inDomain.Sharedafter upgrading across .NET versions. Without that package, the manifest XML isn't embedded into yourDomain.Shared.dll, ABP's virtual file system can't find youren.json, and the endpoint returnstexts: {}while the resource itself is still registered (which matches what you're seeing — the resource shows up with the correctbaseResources, just no texts).Make sure
MyApplication.Domain.Shared.csprojhas all three pieces below:<PropertyGroup> <GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest> </PropertyGroup> <ItemGroup> <EmbeddedResource Include="Localization\MyApplication\*.json" /> <Content Remove="Localization\MyApplication\*.json" /> </ItemGroup> <ItemGroup> <PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="10.0.7" /> </ItemGroup>Then run
dotnet clean && dotnet buildand restart the host. TheMyApplicationresource should start returning its texts.If all three pieces are already in place, send over the csproj and module file and we'll dig deeper.
Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) - Your
-
0
Hello,
The issue was a missing Microsoft.Extensions.FileProviders.Embedded reference.
Thank you!
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)