How to get current culture?
# help-with-umbraco
h
Our site currently has two languages with some parts of the site displaying prices in localized currencies. How to detect if site is domain.com or domain.com/da? And get the current culture of the site?
@inject UmbracoHelper umbracoHelper Seems to do the trick. And umbracoHelper.CultureDictionary.Culture.TwoLetterISOLanguageName
s
Umbracohelper.assignedcontent.culturefrpmdomains is an option (on phone, so syntax is probably off). This will not work if the view is loaded through ajax or something. If the view inherits umbracoviewpage, you can use Umbraco.... As the Umbraco helper
m
You can use the Threads current UI culture.
b
Copy code
Thread.CurrentThread.CurrentCulture
should work
121 Views