Localizing the Chrome
In the previous weblog entry I described why separating chrome and content is an important aspect of Charlie’s approach to globalization.
To localize the chrome of a webpage, Charlie uses a custom ResourceManager. Why not use the built-in ResourceManager provided in the .NET Framework? Because I believe that its use of resource files and satellite assemblies is dumb. Instead, Charlie stores string resources in the database, and uses precisely the same cascading logic as it used in its approach to authorization. Here is a peek at the tables of that database:
What these tables show—other than that I was too lazy to obtain proper translations—is that for a single key (such as “Hello”), any number of string values may be stored, for both neutral and specific cultures. Moveover, a website owner may choose to override the default string values. In the example above, the owner of the domain with the ID value of 2 has overriden the default value of “Hullo” with “Hullo, hullo.” Further, the owner has provided a specific French culture value (fr-FR) when the defaults provide only for a neutral French culture value (fr). The website owner has full control over the localization of his or her website’s chrome. Try doing that with satellite assemblies.
Like security, globalization will be an ongoing challenge for Charlie. When I get to the interface aspects of Charlie, there will be more work to do. But for now, this is a very simple and very flexible way to support localizing the chrome.
by Alister Jones | Next up: Localizing the Content →
----
Post a Comment