penguin178
penguin178

Reputation: 374

Azure B2C Localization of Show Password / Password Toggler label

I have successfully been able to localize the text of all elements in our B2C custom policy files, with the exception of the 'show password' / password toggler labels, which stubbornly refuse to change from their default values.

When using F12 I can examine the code for the page for both the Password and the Password Toggler labels:

<label for="password">#Password</label>
...
<label for="passwordtoggler">show password</label>

They both have the same format, therefore I would expect to be able to localize these both in the same way in the custom policy file.

I can localize the Password label using:

<LocalizedString ElementType="ClaimType" ElementId="password" StringId="DisplayName">#Password</LocalizedString>

However if I try to do the same for the password toggler element:

<LocalizedString ElementType="ClaimType" ElementId="passwordtoggler" StringId="DisplayName">#Show Password</LocalizedString>

Then this does not work, and still just shows the default text of 'show password', and not '#Show Password'

Has anyone been able to localize this label?

Upvotes: 2

Views: 2210

Answers (1)

Jas Suri - MSFT
Jas Suri - MSFT

Reputation: 11315

The password toggler is front end JavaScript, and it’s not delivered by custom policy configuration, therefore cannot be customised by the custom policy localisation.

https://learn.microsoft.com/en-us/azure/active-directory-b2c/javascript-and-page-layout?pivots=b2c-user-flow#show-or-hide-a-password

You can use JS to read the SETTINGS object, which will contain the language and then do your own language customisation, or deliver dynamic HTML pages using dynamic page customisation.

https://learn.microsoft.com/en-us/azure/active-directory-b2c/customize-ui-with-html?pivots=b2c-custom-policy#configure-dynamic-custom-page-content-uri

Upvotes: 3

Related Questions