I have a bilingual site with lots of Dictionary items that Umbraco nicely takes care of using Umbraco.GetDictionaryValue("MyValueName")
However, I have a piece of content that's only available in one language (English) and therefore it only lives in the English content tree.
Problem is, in my view, I still want to call Umbraco.GetDictionaryValue() but as my currentpage will always be English, I only get the English value returned.
I suppose my question is, can I force the culture when I make the call? Something like Umbraco.GetDictionaryValue("MyValueName", myLang)
GetDictionaryValue by passing in Culture
Hi
I have a bilingual site with lots of Dictionary items that Umbraco nicely takes care of using Umbraco.GetDictionaryValue("MyValueName")
However, I have a piece of content that's only available in one language (English) and therefore it only lives in the English content tree.
Problem is, in my view, I still want to call Umbraco.GetDictionaryValue() but as my currentpage will always be English, I only get the English value returned.
I suppose my question is, can I force the culture when I make the call? Something like Umbraco.GetDictionaryValue("MyValueName", myLang)
Hi David
You can set current request culture with this code:
And After that, GetDictionaryValue will return that value.
Thanks,
Alex
Perfect, thanks.
is working on a reply...