Skip to content

Commit 551e287

Browse files
committed
More samples
1 parent 6dc8e0a commit 551e287

File tree

1 file changed

+121
-34
lines changed

1 file changed

+121
-34
lines changed

articles/active-directory-b2c/localization.md

Lines changed: 121 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -142,75 +142,162 @@ The **LocalizedString** element contains the following attributes:
142142

143143
| Attribute | Required | Description |
144144
| --------- | -------- | ----------- |
145-
| ElementType | Yes | Possible values: `ClaimType`, `UxElement`, `ErrorMessage`, `Predicate`, or `GetLocalizedStringsTransformationClaimType`. |
145+
| ElementType | Yes | Possible values: `ClaimsProvider`, `ClaimType`, `ErrorMessage`, `GetLocalizedStringsTransformationClaimType`, `Predicate`, `InputValidation`, or `UxElement` . |
146146
| ElementId | Yes | If **ElementType** is set to `ClaimType`, `Predicate`, or `InputValidation`, this element contains a reference to a claim type already defined in the ClaimsSchema section. |
147147
| StringId | Yes | If **ElementType** is set to `ClaimType`, this element contains a reference to an attribute of a claim type. Possible values: `DisplayName`, `AdminHelpText`, or `PatternHelpText`. The `DisplayName` value is used to set the claim display name. The `AdminHelpText` value is used to set the help text name of the claim user. The `PatternHelpText` value is used to set the claim pattern help text. If **ElementType** is set to `UxElement`, this element contains a reference to an attribute of a user interface element. If **ElementType** is set to `ErrorMessage`, this element specifies the identifier of an error message. See [Localization string IDs](localization-string-ids.md) for a complete list of the `UxElement` identifiers.|
148148

149149
## ElementType
150150

151-
The ElementType reference to a claim type or a user interface element in the policy to be localized.
151+
The ElementType reference to a claim type, a claim transformation, or a user interface element in the policy to be localized.
152+
153+
### ClaimsProvider
154+
155+
The ClaimsProvider value is used to localize claim provider name as specified in the StringId.
156+
157+
```xml
158+
<OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin">
159+
<ClaimsProviderSelections>
160+
<ClaimsProviderSelection TargetClaimsExchangeId="FacebookExchange" />
161+
<ClaimsProviderSelection TargetClaimsExchangeId="GoogleExchange" />
162+
<ClaimsProviderSelection TargetClaimsExchangeId="LinkedInExchange" />
163+
<ClaimsProviderSelection ValidationClaimsExchangeId="LocalAccountSigninEmailExchange" />
164+
</ClaimsProviderSelections>
165+
<ClaimsExchanges>
166+
<ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" />
167+
</ClaimsExchanges>
168+
</OrchestrationStep>
169+
```
170+
171+
The following example shows how to localize the claim provider name.
172+
173+
```xml
174+
<LocalizedString ElementType="ClaimsProvider" StringId="FacebookExchange">Facebook</LocalizedString>
175+
<LocalizedString ElementType="ClaimsProvider" StringId="GoogleExchange">Google</LocalizedString>
176+
<LocalizedString ElementType="ClaimsProvider" StringId="LinkedInExchange">LinkedIn</LocalizedString>
177+
```
152178

153179
### ClaimType
154180

155-
The ClaimType value is used to localize one of the claim attributes, as specified in the StringId. The following example shows how to localized the DisplayName, UserHelpText and PatternHelpText attributes of the email claim type.
181+
The ClaimType value is used to localize one of the claim attributes, as specified in the StringId.
182+
183+
```xml
184+
<ClaimType Id="email">
185+
<DisplayName>Email Address</DisplayName>
186+
<DataType>string</DataType>
187+
<UserHelpText>Email address that can be used to contact you.</UserHelpText>
188+
<UserInputType>TextBox</UserInputType>
189+
</ClaimType>
190+
```
191+
192+
The following example shows how to localize the DisplayName, UserHelpText, and PatternHelpText attributes of the email claim type.
156193

157194
```XML
158195
<LocalizedString ElementType="ClaimType" ElementId="email" StringId="DisplayName">Email</LocalizedString>
159196
<LocalizedString ElementType="ClaimType" ElementId="email" StringId="UserHelpText">Please enter your email</LocalizedString>
160197
<LocalizedString ElementType="ClaimType" ElementId="email" StringId="PatternHelpText">Please enter a valid email address</LocalizedString>
161198
```
162199

163-
### UxElement
200+
### ErrorMessage
164201

165-
The UxElement value is used to localize one of the user interface elements as specified in the StringId. The following example shows how to localized the continue and cancel buttonn.
202+
The ErrorMessage value is used to localize one of the system error messages as specified in the StringId.
166203

167-
```XML
168-
<LocalizedString ElementType="UxElement" StringId="button_continue">Create new account</LocalizedString>
169-
<LocalizedString ElementType="UxElement" StringId="button_cancel">Cancel</LocalizedString>
204+
```xml
205+
<TechnicalProfile Id="AAD-UserWriteUsingAlternativeSecurityId">
206+
<Metadata>
207+
<Item Key="RaiseErrorIfClaimsPrincipalAlreadyExists">true</Item>
208+
<Item Key="UserMessageIfClaimsPrincipalAlreadyExists">You are already registered, please press the back button and sign in instead.</Item>
209+
</Metadata>
210+
...
211+
</TechnicalProfile>
170212
```
171213

172-
### ErrorMessage
173-
The ErrorMessage value is used to localize one of the system error messages as specified in the StringId. The following example shows how to localized the UserMessageIfClaimsPrincipalAlreadyExists UserMessageIfClaimsPrincipalDoesNotExist and error messages.
214+
The following example shows how to localize the UserMessageIfClaimsPrincipalAlreadyExists error message.
215+
174216

175217
```XML
176218
<LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsPrincipalAlreadyExists">The account you are trying to create already exists, please sign-in.</LocalizedString>
177-
<LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsPrincipalDoesNotExist">We can't seem to find your account.</LocalizedString>
178219
```
179220

180-
### Predicate
221+
### GetLocalizedStringsTransformationClaimType
181222

182-
The `Predicate` value is used to localize one of the [Predicate](predicates.md) error messages, as specified in the StringId. The `InputValidation` value is used to localize one of the [PredicateValidation](predicates.md) group error messages as specified in the StringId.
223+
The `GetLocalizedStringsTransformationClaimType` value is used to copy localized strings into claims. For more information, see [GetLocalizedStringsTransformation claims transformation](string-transformations.md#getlocalizedstringstransformation)
183224

184-
The following example shows a localized the **UserHelpText** of **Predicate** with Id `IsLengthBetween8And64`. And a localized **UserHelpText** of **PredicateGroup** with Id `CharacterClasses` of **PredicateValidation** with Id `StrongPassword`.
185225

186-
```XML
187-
<PredicateValidation Id="StrongPassword">
188-
<PredicateGroups>
189-
...
190-
<PredicateGroup Id="CharacterClasses">
191-
...
192-
</PredicateGroup>
193-
</PredicateGroups>
194-
</PredicateValidation>
195-
196-
...
197-
198-
<Predicate Id="IsLengthBetween8And64" Method="IsLengthRange">
199-
...
200-
</Predicate>
201-
...
226+
### Predicate
202227

228+
The `Predicate` value is used to localize one of the [Predicate](predicates.md) error messages, as specified in the StringId.
229+
230+
231+
```xml
232+
<Predicates>
233+
<Predicate Id="LengthRange" Method="IsLengthRange" HelpText="The password must be between 6 and 64 characters.">
234+
<Parameters>
235+
<Parameter Id="Minimum">6</Parameter>
236+
<Parameter Id="Maximum">64</Parameter>
237+
</Parameters>
238+
</Predicate>
239+
<Predicate Id="Lowercase" Method="IncludesCharacters" HelpText="a lowercase letter">
240+
<Parameters>
241+
<Parameter Id="CharacterSet">a-z</Parameter>
242+
</Parameters>
243+
</Predicate>
244+
<Predicate Id="Uppercase" Method="IncludesCharacters" HelpText="an uppercase letter">
245+
<Parameters>
246+
<Parameter Id="CharacterSet">A-Z</Parameter>
247+
</Parameters>
248+
</Predicate>
249+
</Predicates>
250+
```
203251

204-
<LocalizedString ElementType="InputValidation" ElementId="StrongPassword" StringId="CharacterClasses">The password must have at least 3 of the following:</LocalizedString>
252+
The following example shows a localized a predicate help text.
205253

206-
<LocalizedString ElementType="Predicate" ElementId="IsLengthBetween8And64" StringId="HelpText">The password must be between 8 and 64 characters.</LocalizedString>
254+
```xml
255+
<LocalizedString ElementType="Predicate" ElementId="LengthRange" StringId="HelpText">The password must be between 6 and 64 characters.</LocalizedString>
256+
<LocalizedString ElementType="Predicate" ElementId="Lowercase" StringId="HelpText">a lowercase letter</LocalizedString>
257+
<LocalizedString ElementType="Predicate" ElementId="Uppercase" StringId="HelpText">an uppercase letter</LocalizedString>
207258
```
208259

209-
### GetLocalizedStringsTransformationClaimType
260+
### InputValidation
261+
262+
The `InputValidation` value is used to localize one of the [PredicateValidation](predicates.md) group error messages as specified in the StringId.
263+
264+
```xml
265+
<PredicateValidations>
266+
<PredicateValidation Id="CustomPassword">
267+
<PredicateGroups>
268+
<PredicateGroup Id="LengthGroup">
269+
<PredicateReferences MatchAtLeast="1">
270+
<PredicateReference Id="LengthRange" />
271+
</PredicateReferences>
272+
</PredicateGroup>
273+
<PredicateGroup Id="CharacterClasses">
274+
<UserHelpText>The password must have at least 3 of the following:</UserHelpText>
275+
<PredicateReferences MatchAtLeast="3">
276+
<PredicateReference Id="Lowercase" />
277+
<PredicateReference Id="Uppercase" />
278+
<PredicateReference Id="Number" />
279+
<PredicateReference Id="Symbol" />
280+
</PredicateReferences>
281+
</PredicateGroup>
282+
</PredicateGroups>
283+
</PredicateValidation>
284+
</PredicateValidations>
285+
```
210286

211-
The `GetLocalizedStringsTransformationClaimType` value is used to copy localized strings into claims. For more information, see [GetLocalizedStringsTransformation claims transformation](string-transformations.md#getlocalizedstringstransformation)
287+
The following example shows a localized a predicate validation group help text.
212288

289+
```XML
290+
<LocalizedString ElementType="InputValidation" ElementId="StrongPassword" StringId="CharacterClasses">The password must have at least 3 of the following:</LocalizedString>
291+
```
292+
293+
### UxElement
294+
295+
The UxElement value is used to localize one of the user interface elements as specified in the StringId. The following example shows how to localize the continue and cancel buttons.
213296

297+
```XML
298+
<LocalizedString ElementType="UxElement" StringId="button_continue">Create new account</LocalizedString>
299+
<LocalizedString ElementType="UxElement" StringId="button_cancel">Cancel</LocalizedString>
300+
```
214301

215302
## Next steps
216303

0 commit comments

Comments
 (0)