abp icon indicating copy to clipboard operation
abp copied to clipboard

Localization help

Open faejr opened this issue 6 years ago • 8 comments

Hi

Is it possible to localize say the AbpAccount module only in my application without creating a PR to this repo? I need this as I don't intend to localize everything at this time and need it for a preview

faejr avatar Mar 30 '20 11:03 faejr

hi

Have you read the documentation of localization? https://docs.abp.io/en/abp/latest/Localization

maliming avatar Mar 30 '20 13:03 maliming

Yes I did read that documentation, but that doesn't really explain how to translate the AbpAccount namespace or such

faejr avatar Mar 30 '20 13:03 faejr

Can you explain your problem in detail?

maliming avatar Mar 30 '20 14:03 maliming

Well the login page is currently only available in certain languages in the angular template, where it appears to be using the AbpAccount namespace for translations. I don't seem to have access to edit these templates and as a result they are in English, while the rest of the application is in Swedish (Except for once again, Abp namespace translations).

I want to somehow be able to translate these parts of the frontend as well

faejr avatar Mar 30 '20 14:03 faejr

You could extend these localization resources

         options.Resources
                .Add<FichaMedicaResource>("es")
                .AddBaseTypes(typeof(AbpValidationResource))
                .AddVirtualJson("/Localization/FichaMedica");
            //se extienden otros LocalizationResources en nuestro mismo localization
            options.Resources
                .Get<IdentityResource>() //AbpIdentity
                .AddVirtualJson("/Localization/FichaMedica");
            options.Resources
                .Get<AbpTenantManagementResource>() //AbpTenantManagement
                .AddVirtualJson("/Localization/FichaMedica");`

Add your own languages in YouProjectHttpApiHostModule options.Languages.Add(new LanguageInfo("es", "es", "Español")); The override tags in your own resource

// Override de AbpIdentity "Permission:IdentityManagement": "Usuarios y roles", "Permission:RoleManagement": "Roles", "Permission:Create": "Crear", "Permission:Edit": "Editar", "Permission:Delete": "Eliminar", "Permission:ChangePermissions": "Cambiar permisos", "Permission:UserManagement": "Usuarios",

luisp88 avatar Mar 30 '20 18:03 luisp88

Thanks for the help, that solved my issue!

faejr avatar Apr 02 '20 08:04 faejr

Hmm actually I can't seem to override the AccountResource as it seems to be assigned later in the cycle. Why is that?

faejr avatar Apr 02 '20 08:04 faejr

I solved it as I remembered how the structure worked. I added the AbpAccountApplicationContractsModule as a dependency and now it works.

faejr avatar Apr 02 '20 08:04 faejr