Re: copy/duplicate database schemas

Поиск
Список
Период
Сортировка
От Karsten Hilbert
Тема Re: copy/duplicate database schemas
Дата
Msg-id 20100624072634.GB2637@hermes.hilbert.loc
обсуждение исходный текст
Ответ на Re: copy/duplicate database schemas  (Craig Ringer <craig@postnewspapers.com.au>)
Ответы Re: copy/duplicate database schemas  ("Karsten Hilbert" <Karsten.Hilbert@gmx.net>)
Список pgsql-general
On Thu, Jun 24, 2010 at 11:29:48AM +0800, Craig Ringer wrote:

> You might want to investigate internationalization options instead,
> where you can process your "master" sources to produce a list of
> strings, and have translators translate those strings. Your code loads
> the string lists, and depending on the setting for the "current
> language" decides which mapping of strings to translations to use when
> emitting messages.
>
> This adds significant complexity to your code, especially since (AFAIK)
> there aren't really any good i18n tools for Pg's SQL, PL/PgSQL, etc.

But there is - whether good or not: Go to
http://gitorious.org/gnumed and browse the tree under
gnumed/server/SQL/. Look at the i18n schema which provides
functions for registering strings for translation and
translating them (i18n.upd_tx()) and using translated
strings nearly transparently in your queries like so:

    SELECT _(label) FROM your_label_table;

Which will return label translated into what the connected
user registered as his preferred language or in the source
language if none registered or no translation available.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

В списке pgsql-general по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: The case of PostgreSQL on NFS Server
Следующее
От: "Rafael Martinez"
Дата:
Сообщение: Re: The case of PostgreSQL on NFS Server