[dojo-contributors] Dojo data discussion

Jon Sykes lists at jpsykes.com
Thu Jun 7 16:48:33 EDT 2007


But surely this is not a localization idea, it's a data format question.

Total pseudo code, using the example below I could understanding  
wanting to be able to do:

store.getLabel(germany), // would output an object with both so you  
could then do

store.getLabel(germany).en;
store.getLabel(germany).de;

But without knowing the total ins and outs of the data api, that  
seems to open you wide up to handling nested data objects.

short-name: {en:'Germany', de:{familar: 'foo', formal:{legal:'bar',  
government:'foobar' }},

Where would it end?  :-)


On Jun 7, 2007, at 4:21 PM, Brian Douglas Skinner wrote:

> 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
>
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-contributors




More information about the dojo-contributors mailing list