Open Closed

Translate Administration menu #2435


User avatar
0
safi created

Hi Support

I am using ABP 4.4.3 and all are working fine but I want to translate the administration menu on language selection. I have done with all menus except the administration menu so could you please suggest to me how can I translate this.

It's very urgent for me so please respond to this asap.

Thanks,

  • ABP Framework version: v4.4.3
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

18 Answer(s)
  • User Avatar
    0
    yekalkan created
    Support Team Fullstack Developer

    Hi @safi

    I answered this question at https://support.abp.io/QA/Questions/2413/Changing-the-name-of-Administration-menu-item#answer-c47fcd18-b187-5cae-4a43-3a0160d834cf

  • User Avatar
    0
    safi created

    Hi @safi

    I answered this question at https://support.abp.io/QA/Questions/2413/Changing-the-name-of-Administration-menu-item#answer-c47fcd18-b187-5cae-4a43-3a0160d834cf

    Ok, thanks. If there is anything that we can add in the JSON file (present in the localization folder) for this?

  • User Avatar
    0
    yekalkan created
    Support Team Fullstack Developer

    If there is anything that we can add in the JSON file (present in the localization folder) for this?

    You won't change anything in your current localization files. You need to create another localization folder and configure it to extend the resource you want to change.

    See Extending Existing Resource section in the documentation.

    In your scenario, you need to extend AbpUiNavigationResource.

    Localization key for administration menu is Menu:Administration.

    example code:

    services.Configure<AbpLocalizationOptions>(options =>
    {
        options.Resources
            .Get<AbpUiNavigationResource>()
            .AddVirtualJson("/Localization/Resources/Test/Extensions");
    });
    

    /Localization/Resources/Test/Extensions/en.json file:

    {
      "culture": "en",
      "texts": {
        "Menu:Administration": "Custom administration translate"
      }
    }
    
  • User Avatar
    0
    safi created

    services.Configure<AbpLocalizationOptions>(options => { options.Resources .Get<AbpUiNavigationResource>() .AddVirtualJson("/Localization/Resources/Test/Extensions"); });

    Where I need to add this code?

  • User Avatar
    0
    safi created

    If there is anything that we can add in the JSON file (present in the localization folder) for this?

    You won't change anything in your current localization files. You need to create another localization folder and configure it to extend the resource you want to change.

    See Extending Existing Resource section in the documentation.

    In your scenario, you need to extend AbpUiNavigationResource.

    Localization key for administration menu is Menu:Administration.

    example code:

    services.Configure<AbpLocalizationOptions>(options => 
    { 
        options.Resources 
            .Get<AbpUiNavigationResource>() 
            .AddVirtualJson("/Localization/Resources/Test/Extensions"); 
    }); 
    

    /Localization/Resources/Test/Extensions/en.json file:

    { 
      "culture": "en", 
      "texts": { 
        "Menu:Administration": "Custom administration translate" 
      } 
    } 
    

    Hi

    Thanks for the response. I tried your solution so it's reflecting my files in Language text section (under administration) but not changing text in registration form. I added keys there but not showing changes there.

  • User Avatar
    0
    safi created

    It's quite urgent so expecting early response.

  • User Avatar
    0
    yekalkan created
    Support Team Fullstack Developer

    Hi @safi,

    You overrided AbpUiNavigationResource localizations, and registration form localizations don't belong to that resource. So you need to override AbpAccountResource as well.

  • User Avatar
    0
    safi created

    Hi @safi,

    You overrided AbpUiNavigationResource localizations, and registration form localizations don't belong to that resource. So you need to override AbpAccountResource as well.

    Hi

    If I am trying to add AbpAccountResource then it's showing error

    Please let me know what reference I need to add for this. Same error is coming If I use AbpUiNavigationResource.

  • User Avatar
    0
    yekalkan created
    Support Team Fullstack Developer

    Namespace for AbpAccountResource is Volo.Abp.Account.Localization, and Volo.Abp.UI.Navigation.Localization.Resource for AbpUiNavigationResource.

    using Volo.Abp.Account.Localization;

    using Volo.Abp.UI.Navigation.Localization.Resource;

    However, make sure that you are overriding these resources in a project/layer that references Volo.Abp.Account.Pro.Shared.Application.Contracts package. I suggest you to make these changes in the top layer (i guess HttpApi.Host for blazor) of your solution.

  • User Avatar
    0
    safi created

    Namespace for AbpAccountResource is Volo.Abp.Account.Localization, and Volo.Abp.UI.Navigation.Localization.Resource for AbpUiNavigationResource.

    using Volo.Abp.Account.Localization;

    using Volo.Abp.UI.Navigation.Localization.Resource;

    However, make sure that you are overriding these resources in a project/layer that references Volo.Abp.Account.Pro.Shared.Application.Contracts package. I suggest you to make these changes in the top layer (i guess HttpApi.Host for blazor) of your solution.

    Ok thanks, yekalkan. Let me try this solution.

  • User Avatar
    0
    safi created

    Namespace for AbpAccountResource is Volo.Abp.Account.Localization, and Volo.Abp.UI.Navigation.Localization.Resource for AbpUiNavigationResource.

    using Volo.Abp.Account.Localization;

    using Volo.Abp.UI.Navigation.Localization.Resource;

    However, make sure that you are overriding these resources in a project/layer that references Volo.Abp.Account.Pro.Shared.Application.Contracts package. I suggest you to make these changes in the top layer (i guess HttpApi.Host for blazor) of your solution.

    Ok thanks, yekalkan. Let me try this solution.

    I added these folders into host project and trying like this but still getting error while using AbpAccountResource

  • User Avatar
    0
    yekalkan created
    Support Team Fullstack Developer

    What does the error say?

  • User Avatar
    0
    safi created

    What does the error say?

    Adding this code into hostmodule.cs and getting this error also I have added the above-mentioned namespace and references too.

  • User Avatar
    0
    yekalkan created
    Support Team Fullstack Developer

    There is a typo in the screenshot (AbpAccountrResource instead of AbpAccountResource). Does the error persist when you fix it?

  • User Avatar
    0
    safi created

    AbpAccountResource

    Yes, still the same error.Can we connect on zoom?

  • User Avatar
    0
    yekalkan created
    Support Team Fullstack Developer

    Can you try AccountResource instead of AbpAccountResource?

  • User Avatar
    0
    safi created

    AccountResource

    Hi

    Yes, the account resource is working but it's not taking keys from my resource file. I added a localization folder under the host project and added a test folder into it in which I have added a de-DE.json file and calling like this only.

    Can we connect on zoom to check this? I already spent enough time on this and it's very urgent for me.

  • User Avatar
    0
    alper created
    Support Team Director

    You can send your project to support@abp.io

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