[dojo-contributors] Dojo data discussion

Brian Douglas Skinner skinner at dojotoolkit.org
Thu Jun 7 16:21:01 EDT 2007

Jon Sykes wrote:
> Could you explain that a little more?
> It seems like in Data, any localization issues should be handled 
> in the actual data, not in the JS that accesses it.
> But I might be misunderstanding the example.

Hmmm... I'm not sure I understand what you mean when you say 
"localization issues should be handled in the actual data, not in the JS 
that accesses it".

Here's what I'm thinking...

We will end up having lots of different datastore implementations 
designed to talk to different server-side data sources.  Some of those 
data sources will have a wealth of information available, including 
localization info about attribute values.

For example, it would be easy to write a datastore based on the data 
available on the "CIA World Factbook" website.  In that dataset, the 
item representing Germany has attributes for short-name and long-name, 
with values in both English and German:
   short-name: {en:'Germany', de:'Deutschland'},
   long-name: {en:'Federal Republic of Germany',
               de:'Bundesrepublik Deutschland'},

So when you call store.getLabel(germany), the datastore could return 
either 'Germany' or 'Deutschland', depending on your locale.  The 
locale-specific filtering could happen either on the client or server, 
but I think we want the filtering to happen behind the dojo.data API 
(so, either on the server or within the datastore on the client), rather 
than letting the datastore return both 'Germany' and 'Deutschland' and 
leaving it to the UI to figure out which value to display.

(The CIA World Factbook is probably a bad example, since it only has 
attribute values for a couple locales.  But other data sources have 
richer source data.)

:o) Brian

> On Jun 7, 2007, at 3:15 PM, Brian Douglas Skinner wrote:
>> Bill Keese wrote:
>>> I'm lost.  I thought getLabel() for an employee record (for example)
>>> would return the employee's name.  No localization needed.
>> In the case of an employee's name, then probably no localization would
>> be needed.  But in some other cases you might want localization.  For
>> example, if you've got a set of items that represent countries and
>> cities, those things might have different names in different  
>> languages.
>> :o) Brian

More information about the dojo-contributors mailing list