W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2010

[IndexedDB] Languages for collation

From: Pablo Castro <Pablo.Castro@microsoft.com>
Date: Thu, 12 Aug 2010 06:28:00 +0000
To: public-webapps WG <public-webapps@w3.org>
Message-ID: <F753B2C401114141B426DB383C8885E059019E78@TK5EX14MBXC126.redmond.corp.microsoft.com>
We had some discussions about collation algorithms and such in the past, but I don't think we have settled on the language aspect of it. In order to have stores and indexes sort character-based keys in a way that is consistent with users' expectations we'll have to take indication in the API of what language we should use to collate strings.

Trying to take a minimalist approach, we could add an optional parameter on the database open call that indicates the language to use (e.g. "en" or "en-UK", etc.). If the language is not specified and the database does not exist, then we can use the current browser/OS language to create the database. If not specified and database already exists, then use the one it's already there (this accommodates the fact that a user may be able to change their default language in the browser/OS after the database has been created using the default). If the language is specified and the database already exists and the specified language is not the one the database has then we'll throw an exception (same behavior as with "description", although we have that one in flight right now as well). 

We should probably also add a read-only attribute to the database object that exposes the language.

If this works for folks I can write a proposal for the specific changes to the spec.

Thanks
-pablo
Received on Thursday, 12 August 2010 06:28:36 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:40 GMT