views:

279

answers:

2

So, what is a best approach to implement silverlight localization with Reactive Framework (Rx) to achive on-the-fly UI changing? I would be very much obliged for examples.

Here is an example of on-the-fly UI changing. But I can't figure out how it works.

+1  A: 

Localization can be made quite simple in .NET or as complex as you like.

The simpler way, would be to create localized resource DLL's for each supported language, and then set the CultureInfo.CurrentUICulture for the user's selected, or detected, language, falling back to a default (preferably English) in case the language isn't supported.

And set up a watcher in case the of a language change.

Some programs requires to reload, others simply to repaint (as it seems the case with the sample you provided).

Paulo Santos
Thanks for reply. Can you post some examples with on-the-fly UI changing?
FFire
A: 

Paulo is correct, see Localizing Silverlight-based Applications. That is specifically for localizing code. If you want to localize the Xaml then see How to: Make XAML Content Localizable.

Using Rx here doesn't do you any good unless you want to reinvent the wheel. Localization is built into Silverlight. It will be "on-the-fly", even in the case where the resources are on the server, they are cached once the Xap or satellite assemblies are downloaded.

Richard Hein
@Richard >>>It will be "on-the-fly"... No it is not. It need reload xap to change language. What about code or example to support your point of view? Please, my qestion not about just localization, but about on-the-fly changing language.
FFire
There's a whole section on localizing out of browser Silverlight applications. If you want to load up a resource from another language on the fly, you use the ResourceManager to get the string, as shown here: http://msdn.microsoft.com/en-us/library/cc838238%28VS.95%29.aspx#localization_offline. See the last section in particular: http://msdn.microsoft.com/en-us/library/cc838238%28VS.95%29.aspx#retrieving_specific_localized_resources.
Richard Hein
@Richard >>>If you want to load up a resource from another language on the fly, you use the ResourceManager to get the string... OK. And how you will bind it in xaml? So, I read a lot about localization, and a msdn and many blogs and other resoursers. Just see link in my qestion. It applacation used Reactive Framework, and I think it's only way to change language on-the-fly. Becouse for on-the-fly changing we need Observable Collection implementation. Can you figure out how it works?
FFire