Re: copy/duplicate database schemas

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: copy/duplicate database schemas
Date: 2010-06-24 07:26:34
Message-ID: 20100624072634.GB2637@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rafael Martinez 2010-06-24 07:52:30 Re: The case of PostgreSQL on NFS Server
Previous Message Craig Ringer 2010-06-24 07:01:01 Re: The case of PostgreSQL on NFS Server