question

AnuGarg-2389 avatar image
0 Votes"
AnuGarg-2389 asked AnuGarg-2389 edited

Localization in Ducth in B2C custom Policies

Hi Team,

We want to provide localization in English & Dutch language.
I am looking for Localization strings in dutch language.
Is there any existing predefined localization settings for all like api.signuporsignin.nl / api.selfasserted.nl etc.

Thanks in advance.

Regards,
Anu

azure-ad-b2c
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

amanpreetsingh-msft avatar image
0 Votes"
amanpreetsingh-msft answered AnuGarg-2389 edited

Hi @AnuGarg-2389 • Thank you for reaching out.

The localization resources such as api.signuporsignin.nl or api.selfasserted.nl are not present by default in the custom policies. By default, you will only find api.signuporsignin. Ideally, if you append the Authentication Request or Run Now endpoint of your signup/sign custom policy with the &ui_locales=nl parameter, you should get the strings localized in Dutch language automatically.

You should add api.signuporsignin.nl or other localization resources under content definition IDs if you are not happy with the default translation/localization of some strings and you want to customize the strings as per your requirement. If that is the case, you can follow the below steps:

  1. If you are using the latest starter pack, open the Localizations.xml file and make sure localization is enabled by looking at the below tag:

      <Localization Enabled="true">
    
  2. Add nl as the supported language as shown below:

       <SupportedLanguages DefaultLanguage="en" MergeBehavior="Append">
                 <SupportedLanguage>en</SupportedLanguage>
                 <SupportedLanguage>nl</SupportedLanguage>
             </SupportedLanguages>
    
  3. Add LocalizedResourcesReference for nl language.

       <ContentDefinition Id="api.signuporsignin">
             <LocalizedResourcesReferences MergeBehavior="Prepend">
             <LocalizedResourcesReference Language="en" LocalizedResourcesReferenceId="api.signuporsignin.en" />
             <LocalizedResourcesReference Language="nl" LocalizedResourcesReferenceId="api.signuporsignin.nl" />
             <!-- Add more languages here -->
             </LocalizedResourcesReferences>
         </ContentDefinition>
    
  4. Finally, add the localization strings to LocalizedResources Id="api.signuporsignin.nl" as shown below:

       <LocalizedResources Id="api.signuporsignin.nl">
             <LocalizedCollections>
                 <!-- More localized collections... -->
             </LocalizedCollections>
             <LocalizedStrings>
                 <LocalizedString ElementType="ClaimType" ElementId="email" StringId="DisplayName">Email Address</LocalizedString>
                 <LocalizedString ElementType="UxElement" StringId="heading">Sign in</LocalizedString>
                 <LocalizedString ElementType="ClaimsProvider" StringId="FacebookExchange">Facebook</LocalizedString>
                 <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfInvalidPassword">Your password is incorrect.</LocalizedString>
                 <!-- More localized strings... -->
             </LocalizedStrings>
         </LocalizedResources>
    

An extensive list of all string IDs that are available for localization is documented here: Localization string IDs


Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

· 11
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AnuGarg-2389 • Please share the content definition ID 'api.localaccountpasswordreset.nl' section from your custom policy file where you have defined the localization strings. Also, share the page layout version of 'api.localaccountpasswordreset' in your case.

1 Vote 1 ·
AnuGarg-2389 avatar image AnuGarg-2389 amanpreetsingh-msft ·

Hi @amanpreetsingh-msft ,

Thanks for your reply.



 Pagelayout version is 2.1.6 .

I tried with version 2.0.0 then buttons are getting translated correctly but error messages are still in english.

I have another query:
I have added some custom html pages with custom claims as below:

   <ClaimType Id="totpVerificationCode">
                 <DisplayName>Enter verification code</DisplayName>
                 <DataType>string</DataType>
                 <UserInputType>TextBox</UserInputType>
               </ClaimType>

Thanks,
Anu


0 Votes 0 ·

Hi @amanpreetsingh-msft ,

I am unable to submit my reply whenever trying to add contents of 'api.localaccountpasswordreset.nl' section

0 Votes 0 ·

Hi Aman,

Thanks for your reply.

I was also considering that it should support by default when "NL" is the user browser language and its working also in some cases.

But there is one scenario where we have updated some of the messages as per our requirement .
For example, in Emailverification control (using content definition 'api.localaccountpasswordreset'),
we have updated some of the labels/messages and we unertsand that we need to provide translation for those; but for default buttons, translation didn't happen.
I have attached the screenshot for your reference.

Your help/guidance is much appreciated.

Thanks & Regards,
Anu

0 Votes 0 ·

Hi @AnuGarg-2389 , Thank you for providing the required details.

Looking at the XML snippet that you shared from your custom policy, I don't see that you have added the localization strings for Verify code and Send new code. Please add below LocalizedStrings to api.localaccountpasswordreset.nl to translate these buttons.

       <LocalizedResources Id="api.localaccountpasswordreset.nl">
         <LocalizedStrings>
             <LocalizedString ElementType="UxElement" StringId="ver_but_resend">stuur nieuwe code</LocalizedString>
             <LocalizedString ElementType="UxElement" StringId="ver_but_verify">Code verifiëren</LocalizedString>
         </LocalizedStrings>
       </LocalizedResources>

Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

0 Votes 0 ·
AnuGarg-2389 avatar image AnuGarg-2389 amanpreetsingh-msft ·

Thanks @amanpreetsingh-msft for looking into issue.

My assumption is that localization should work automatically for default buttons, place holders and error messages.

When i updated the Pagelayout version to 2.0.0 (earlier it was 2.1.6) then these buttons are translated automatically but place holders and some error messages are still in english only.

I am confused in behaviour of Localization now; for default error messages and place holder, shouldn't it work itself. I am using below versions of pages

     urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.0.0
     urn:com:microsoft:aad:b2c:elements:contract:unifiedssp:2.1.5

Thanks,
anu


0 Votes 0 ·
Show more comments