Hi Rob, sorry for the late reply on this. As Paul said, Isolated Storage is
easy to use as a buffer for holding data when disconnected.

 

I could never find anything in Silverlight development that helps you
globalise an app beyond the basic ResourceManager class. Over a year ago
when I started the app I searched hundreds of web pages for instructions on
how to globalise the app the "right way", or at least a way that gave more
flexibility than using plain Framework 1.0 style resource manager with
resources in DLLs. I never found anything useful. Some people suggested
using converters and other binding tricks, but I found them tedious or
inelegant.

 

In the end I gave up and rolled my own solution. It probably a bit personal
to be of use to others, but I'll give you a potted summary just in case it
might give you ideas.

 

.         At app startup its first WCF call is to get vital global data such
as config values and resource strings.

.         The resource strings are in a tab-delimited text file on the
server that you edit in Excel. The left column is the resource name, the
next column contains the default culture string value, and each optional
column to the right has the strings for a specific culture that you want to
use. Blank strings fallback to the left until they find a value. I think
it's a really convenient format for the strings that is easy to read and
edit. I detect changes resource file timestamp on the server side and new
client sessions will get the changes immediately.

.         A global custom derived ResourceManager loads the Excel format
file on the client side.

.         Anywhere in the SL code you can make call like
resman.GetString("FooErrorTitle") in the familiar way.

.         The final fancy thing I do is have a utility method called by each
control as it loads to walk down its visual tree looking for control IDs or
text that corresponds to a resource key and will be replaced. If there is a
resource key that matches the ID of the control or its Text/Content
property, then a resource replacement is made. I think this is technically
frowned upon, but I find it very convenient.

 

So in summary, I guess I never found an out-of-the-box globalisation
technique I liked, otherwise I wouldn't have made the serious decision to
bother baking my own. If anyone else has better ideas on this subject then
I'm really keen to hear them.

 

Cheers,

Greg

Reply via email to