3

I'm working on something which requires giving the content editor a language selector. After selecting languages, a group of items should have any language except the selected languages removed. The language selector uses the actual language items. These have an iso field and regional iso code field.

When a language item has both an iso and regional iso code, passing either field value to LanguageManager.GetLanguage will result in a language. It looks like items will only have versions for either the iso code language or regional iso code language but not both though.

How do I know when to use the regional iso code vs the regular iso code given a certain language item that has values for both?

2

Instead of using the Regional or ISO code, you can directly use the item name instead. Sitecore will always create the languages using the Regional Code. Examples:

  • en-US
  • en
  • da
  • af-ZA

So, if you use the item name, you don't need to check if the field Regional or ISO has a value.

  • Great that makes things easier for me. Thanks! – Teeknow Sep 12 '17 at 21:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.