This is a migrated thread and some comments may be shown as answers.

Can't get localization to work

3 Answers 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Luke
Top achievements
Rank 1
Luke asked on 12 Jul 2011, 03:55 PM
Hi guys, I've been trying to follow the localization example.
However, no matter what I do, I can't seem to get a grid to display anything other than english.

-I have a GridLocalization.de-DE.resx in my App_GlobalResources folder.

Here are some snippets of what I'm doing (a cobbled together hybrid of the example and whatever I have handy)
-In the view:

@(Html.Telerik().Grid(Model.TestField)
.Name("Grid4")
.Localizable("de-DE"
.Columns(columns =>
{
    columns.Bound(o => o.Id).Width(100);
})
.Scrollable(scrolling => scrolling.Enabled(true)) 
.Sortable(sorting => sorting.Enabled(true)) 
.Pageable(paging => paging.Enabled(true)) 
.Filterable(filtering => filtering.Enabled(true))
.Groupable(grouping => grouping.Enabled(true)) 
.Footer(true))
  
@{ Html.Telerik().ScriptRegistrar().Globalization(true); }

 

-In the controller:

    ...
    System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de-DE"); 
    return View(model); 
}

I've shown the parts I deem to be relevant, but there's lots more code in these files. If I'm missing something in order to make this work, please let me know. If what I've pasted should be working, then I know the rest of the code is breaking it somehow...

Thank you,
Luke

3 Answers, 1 is accepted

Sort by
0
Luke
Top achievements
Rank 1
answered on 18 Jul 2011, 04:09 PM
Sorry for the week-later bump...

Any help would be much appreciated; I've scoured the web and not found much elsewhere. Even on StackOverflow, the only relevant information seems out of date:
http://stackoverflow.com/questions/2058087/how-do-i-localize-the-grid-from-the-telerik-mvc-extensions )

I thought I was asking a simple question...maybe I missed something, I'm not sure...
but, if anyone's done localization on a grid, please let me know if what I've shown should be sufficient, or if it's missing something, or if I'd need to post more info to be able to tell.

Thanks,
Luke
0
Accepted
Atanas Korchev
Telerik team
answered on 18 Jul 2011, 04:23 PM
Hi Luke,

 Those steps should be sufficient. You can check this blog post if not already. You may also try setting the CurrentUICulture earlier as we do in our demos (check the CultureAwareActionAttribute.cs file).

 If you still struggle with this problem you can attach your project here so we can take a closer look.

Regards,
Atanas Korchev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Luke
Top achievements
Rank 1
answered on 20 Jul 2011, 02:59 PM
Thank you, Atanas.

Knowing that I was breaking something instead of missing something helped a lot. It turns out the problem was that, since our solution involves many projects, the bin directory structure is different. The App_GlobalResources folder, while in the correct place for its project, wasn't being found during runtime.

Thanks again for your support.
Luke

(edit: is it possible to mark my own post as answer, in case others with similar problems stumble across it? Or should I mark yours as the answer?)
Tags
Grid
Asked by
Luke
Top achievements
Rank 1
Answers by
Luke
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or