On Mon, Oct 08, 2007 at 01:37:22PM +0200, Werner F. Bruhin wrote: > I wonder if there is a standard in how to deal with i10n data in tables > with SA, I have search google and the documentation but without any success. > > For example one has a table for countries were at least the name has to > be translated from e.g. "Germany" to "Deutschland" etc., with a Default > Language if an entry is not found for a particular translation. > > My shareware app is currently supporting this but the current > implementation is single user (won't bore you with how I am doing it), > what I would like a multi user solution for this.
I have reimplemented gettext in SQL if that's of any help: http://cvs.savannah.gnu.org/viewvc/gnumed/gnumed/server/sql/gmI18N.sql?root=gnumed&view=log http://cvs.savannah.gnu.org/viewvc/gnumed/gnumed/server/sql/gmI18N-dynamic.sql?root=gnumed&view=log During insertion of, say, country names the following syntax is used: insert into countries (name) values (i18n.i18n('Germany')); which also registers 'Germany' as a translation key. The translation for, say, German is set like so: select i18n.upd_tx('de_DE', 'Germany', 'Deutschland'); where 'de_DE' is a locale name having been made known to the system. Users then set there preferred "database" language in a table (via a stored procedure) which then causes queries like select _('Germany'); to return 'Deutschland' if the user has set his language to 'de_DE' and the translation is available. If no translation is available for the chosen language then the original string is returned. We use this successfully in GNUmed. Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---