Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How do I set the language of the dictionaryhelper? The whole site is Dutch.
With the Views, RenderMvcController and SurfaceController the method: DictionaryHelper.Translate gave the Dutch item from the dictionary.
If I use the same method on a UmbracoApiController, The English item from the dictionary is returned.
Have you set the culture of the website to be Dutch?
You can do this by right-clicking on your website root (the top level node not the "Content" node) and selecting the "Culture and Hostnames" option.
From there you select the culture "nl-nl" should be one of the options.
Yes, Therefore I find it so strange the api is english.
did you find the solution to this issue?
Would be great to know how you solved it.
Not sure if relevant but I recall with Umbraco v6 surfacecontrollers when making ajax calls the language context was being lost so i had to do the following:
protected void SetCultureForAjax()
//we lose culture and dictionary wont get labels therefore set it on the thread
string code = _umbracoService.GetCultureCode();
//Get the culture info of the language code
CultureInfo culture = CultureInfo.CreateSpecificCulture(code);
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
The GetCultureCode is getting the culture set on current node. So you could maybe do something similar?
Thanks for this - I will give it a try.
For the moment though I am lucky enough to only want 1 timezone - so I currently do this to get the local time:
var tz = TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time");
return TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.Local, tz);
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted