Open Closed

Multiple Localization Resources #2032


User avatar
0
maristides created
  • ABP Framework version: v4.4.3
  • UI type: Blazor
  • DB provider: EF Core

Hi,

I have craeted my project using the template and it comes with a default Localization Resource and multiple json files. My application will end up with thousands of strings that will need to be localized. I do not want to have all my strings in one json file. I want to have a seperate resource and json files for each section of my application. I have read the documentation https://docs.abp.io/en/abp/latest/Localization and https://docs.abp.io/en/abp/latest/UI/Blazor/Localization and try to introduce another localization resource without success. Something is not mapping correctly between projects. Can you please provide the steps or a sample project showing how to achieve the above?

Thanks


2 Answer(s)
  • User Avatar
    0
    cotur created

    Hello @maristides,

    1. Please make sure your language files are embedded resource.
    2. Make sure all the paths are correct in everywhere.
    3. If you create a new resource, you need to inject IStringLocalizer<NewResource>. Maybe you are using existing resource which is created with solution.
    4. You may follow the more easiest way "extending the existing localization resource" instead of creating new resouce, here is the documentation part related with it: https://docs.abp.io/en/abp/latest/Localization#extending-existing-resource
  • User Avatar
    0
    maristides created

    Hello,

    Thanks for your help. The problem was that my language files were not embedded resources. It would be nice if this detail was mentioned in the documentation.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11