I think maybe a better way to do this is by checking the Cultures property on a IPublishedContent object.
@if (Model.Cultures.ContainsKey("nb")) { //... }}
Because properties have its own 'Allow varying by culture' setting, this can lead to unexpected results. It can happen that the property is not present for the given culture in contrast to parent object.
Umbraco Language variant
Is there a way to check if a Language variant exist? I have a site With two Languages, and want to link to a a variant of a page if it exist.
I think i found a solution (probably not the best)
Here I can check if I am at the sami language-version and make a link to the Norwegian language-version.
I think maybe a better way to do this is by checking the Cultures property on a IPublishedContent object.
Because properties have its own 'Allow varying by culture' setting, this can lead to unexpected results. It can happen that the property is not present for the given culture in contrast to parent object.
These days (Umbraco 11 at least) you can go:
Cheers!
is working on a reply...