Open Closed

(Bug)Extended properties does not use Localization for Enum Type in the Angular App #7442


User avatar
0
n.uerkmez created
  • ABP Framework version: v8.2.0
  • UI Type: Angular
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hi, I have created a brand new Book App to be sure if the localization works for an extended property that is an enum by following the step in the https://docs.abp.io/en/abp/latest/Module-Entity-Extensions#special-types. But there is no way to get popup values from the localization file.

This is my localization of en.json

Extention of Identity Module

UserType Enum

UI Output (No Localization)


7 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    please check this doc https://docs.abp.io/en/commercial/latest/tutorials/book-store/part-2?UI=NG&DB=EF#localization

    I think try once with this one only

    as you are passing it both ways like-

    it might not be very clear, the correct approach should be "Enum:UserType.0": "Regular XXXXX",

    thanks

  • User Avatar
    0
    n.uerkmez created

    Hello,

    please check this doc https://docs.abp.io/en/commercial/latest/tutorials/book-store/part-2?UI=NG&DB=EF#localization

    I think try once with this one only

    as you are passing it both ways like-

    it might not be very clear, the correct approach should be "Enum:UserType.0": "Regular XXXXX",

    thanks

    Hi, It did not work. I have tried every combination before creating this ticket. You can create a new Angular project and extend the Identity object with an enum as defined here https://docs.abp.io/en/abp/latest/Module-Entity-Extensions#special-types. You can experience, that it does not work as expected. I can not access the code of the ABP Identity Component + Template. So I can not change the localization code. Please check this issue, https://github.com/abpframework/abp/issues/13264 But it is not working for Angular

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    It works for me.

    my steps:

    • abp new TestApp -u angualr
     ObjectExtensionManager.Instance.Modules()
      .ConfigureIdentity(identity =>
      {
          identity.ConfigureUser(user =>
          {
             user.AddOrUpdateProperty<UserType>("Type");
          });
      });
      
    public enum UserType
    {
        Regular = 1,
        Moderator = 2,
    
        SuperUser = 3
    
    }
    
    "Enum:UserType.1": "Regular user",
    "Enum:UserType.2": "Moderator user",
    "Enum:UserType.3": "Super user"
    

  • User Avatar
    0
    n.uerkmez created

    Thanks yor your effort. But please double check your Type dropdown items's display text. It does not match localization text but just enum UserType name For example; Moderator display text must be "Moderator user" instead.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Yes, you are right

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    This is a bug, and i create an issue : https://github.com/abpframework/abp/issues/20165

  • User Avatar
    0
    n.uerkmez created

    Thanks

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09