multiple languages - sorting
What is the best approach to support multiple human languages in Zope with regards to sorting? - Use ZCatalog and ZODB? Is Zope still limited to one locale which it read upon startup? - Put data into PostgreSQL? Unfortunately PostgreSQL uses system locale to define sort order, and the locale is defined at the time of creation of the whole database space. Basicaly it means one would have to run a separate postgresql server for each supported language. - Use custom PostgreSQL function? The convert function (... using utf_8_to_ascii) does not provide suitable data for sorting. -- Milos Prudek
Milos Prudek wrote at 2004-3-30 16:23 +0200:
What is the best approach to support multiple human languages in Zope with regards to sorting?
- Use ZCatalog and ZODB? Is Zope still limited to one locale which it read upon startup?
Sure, as "locale" uses static variables to maintain locale information. Changing it would not be thread safe.
- Put data into PostgreSQL? Unfortunately PostgreSQL uses system locale to define sort order, and the locale is defined at the time of creation of the whole database space. Basicaly it means one would have to run a separate postgresql server for each supported language.
- Use custom PostgreSQL function? The convert function (... using utf_8_to_ascii) does not provide suitable data for sorting.
Define your own locale with a sort order that is acceptable by all of your customers. This task is non-trivial... -- Dieter
- Use custom PostgreSQL function? The convert function (... using utf_8_to_ascii) does not provide suitable data for sorting.
Define your own locale with a sort order that is acceptable by all of your customers. This task is non-trivial...
Probably impossible because I need to support all languages, even the most "exotic" ones. I have found a great solution based on custom PostgreSQL function. It allows switching locales in Postgres on the fly for "SELECT... SORT BY". http://www.fi.muni.cz/~adelton/l10n/postgresql-nls-string/README http://www.fi.muni.cz/~adelton/l10n/postgresql-nls-string/postgresql-nls-str... I verified that it compiles and runs correctly. Maybe other Zopistas will find this useful.
-- Milos Prudek _________________ Most websites are confused chintzy gaudy conflicting tacky unpleasant... unusable. Learn how usable YOUR website is! http://www.spoxdesign.com
participants (2)
-
Dieter Maurer -
Milos Prudek