Skip site navigation (1) Skip section navigation (2)

Re: Use arrays to store multilanguage texts

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Use arrays to store multilanguage texts
Date: 2004-05-29 22:10:42
Message-ID: 20040530001042.B559@hermes.hilbert.loc (view raw or flat)
Thread:
Lists: pgsql-general
> > I am wondering, if it's effective to use text arrays to store
> > multilanguage information.
We solved it like this:

http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/gnumed/gnumed/gnumed/server/sql/gmI18N.sql?rev=1.15

- i18n_curr_lang holds the (ISO) language string per user
- i18n_keys holds the strings to be translated
- i18n_translations holds the translations
- function i18n() inserts a text value into i18n_keys thus
  marking it for translation, this we use during insertion of
  data in the "primary language" (think gettext, think English)
- function _() returns a translated text value (or it's
  primary language equivalent), we use that in queries and view
  definitions
- v_missing_translations is a view of, well, ...

Then here:

http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/gnumed/gnumed/gnumed/server/locale/dump-missing-db_translations.py?rev=1.3

we've got a Python tool that will connect to your database and
create schema files ready for re-insertion via psql after
adding the missing translations. Kind of like a gettext po
file.

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

In response to

Responses

pgsql-general by date

Next:From: Marty ScholesDate: 2004-05-29 23:31:42
Subject: Re: turn WAL off.
Previous:From: vickyDate: 2004-05-29 20:26:13
Subject: Embedded SQL - Unable to connect to PostgreSQL Database

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group