Azure AD: How to map "preferredLanguage" attribute through another attribute
If you are not able to fill in "preferredLanguage" via a default method, you can use the “switch” expression to exchange a finite list of elements to languages. For example, you could use the country or a specific address and exchange it for our language codes (see list below for the correct language codes).
To make this work, you need a list that tells the system which element should be exchanged with which language value.
Please follow the steps below:
Go to Azure Attribute Mapping
Then add a new attribute
Fill in the fields as follows and click on "Save"
![rtaImage.png](../__attachments/1771536574/rtaImage.png?inst-v=151b662e-062c-499a-9412-56136710779d)
Detailed explanation:
Mapping Type: Expression
Expression: Switch([Sourceattribute], "DefaultValue", "Source1", "Target1", "Source2", "Target2", [...])
Sourceattribute: attribute that is maintained throughout (country, postal code, usageLocation, etc.)
DefaultValue: default value for any attribute not mentioned in the list (recommended: de or en)
Source1: first item to be exchanged (e.g., AT; DE; UK etc)
Target1: first exchange (e.g., de, en etc.)
Source2: second item to be exchanged
Target2: second exchange
Target attribute: should be preferredLanguage
All users with source entries that are not featured in the list will receive the default value.
Note:
The expression is case sensitive! For example, if you use both “DE” and “de”, you need to include both versions in the function (“DE”, “de”, “de”, “de”).
Microsoft limits this expression to 100 values.
Microsoft article for further information:
What language syntax do we accept?
We accept ISO 639-1 language codes. The combinations like de-DE and en-US with ISO-639 and ISO-3166 also work.
Full list of acceptable language codes:
ar: 'Arabic'
zh: 'Chinese'
de: 'German'
en: 'English'
es: 'Spanish'
fr: 'French'
it: 'Italian'
nl: 'Dutch'
pl: 'Polish'
pt: 'Portuguese'
ru: 'Russian'
se: 'Swedish'
tr: 'Turkish'
jp: 'Japanese'
da: 'Danish'
cs: 'Czech'
hu: 'Hungarian'
ro: 'Romanian'
sk: 'Slovak'
fi: 'Finnish'
et: 'Estonian'
el: 'Greek'
no: 'Norwegian'
bg: 'Bulgarian'
vi: 'Vietnamese'
sl: 'Slovenian'
hr: 'Croatian'
ko: 'Korean'
hi: 'Hindi'
th: 'Thai'
uk: 'Ukrainian'
Please keep in mind
Accepting that data is not the same as supporting all languages in the list (in terms of content).