abp icon indicating copy to clipboard operation
abp copied to clipboard

Angular additional property localization not working

Open ertugrulbakidal opened this issue 3 years ago • 2 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Description

I've tried all possible solutions to localize a property which is entity extension as described here . But seems it's not working for Angular UI

Reproduction Steps

ObjectExtensionManager.Instance.Modules()
                .ConfigureIdentity(identity =>
                {
                    identity.ConfigureUser(user =>
                    {
                        user.AddOrUpdateProperty<string>( //property type: string
                            "SocialSecurityNumber", //property name
                            property =>
                            {
                                //validation rules
                                property.Attributes.Add(new RequiredAttribute());
                                property.Attributes.Add(new StringLengthAttribute(64) { MinimumLength = 4 });

                                property.Configuration[IdentityModuleExtensionConsts.ConfigurationNames.AllowUserToEdit] = true;

                                //...other configurations for this property
                                property.DisplayName =
                                  LocalizableString.Create<BookStoreResource>(
                                      "UserSocialSecurityNumberDisplayName"
                                  );
                            }
                        );
                    });
                });

Expected behavior

No response

Actual behavior

No response

Regression?

No response

Known Workarounds

No response

Version

7.1.1

User Interface

Angular

Database Provider

EF Core (Default)

Tiered or separate authentication server

Separate Auth Server

Operation System

Windows (Default)

Other information

angular_localization_issue

angular_localization_issue1

ertugrulbakidal avatar Apr 20 '23 18:04 ertugrulbakidal

Pass param with given format ::UserSocialSecurityNumberDisplayName

property.DisplayName = LocalizableString.
    Create<MyProjectNameResource>("::UserSocialSecurityNumberDisplayName");

image

bariscanyilmaz avatar May 08 '23 22:05 bariscanyilmaz

Thank you @bariscanyilmaz, it worked :)

ertugrulbakidal avatar May 14 '23 21:05 ertugrulbakidal