Transparent i18n? - Mailing list pgsql-general

From Steve - DND
Subject Transparent i18n?
Date
Msg-id LDEHKBBOEMIJKHKBOFNFCEKKPJAA.postgres@digitalnothing.com
Whole thread Raw
Responses Re: Transparent i18n?  (David Pratt <fairwinds@eastlink.ca>)
List pgsql-general
I've recently been trying to implement some i18n functionality as simply as
possible into my application. I have a lot of lookup values and such in the
DB that need to be translated, and I would rather not do it in the calling
client.

A friend and I put our heads together, and came up which seemed like a
ridiculously elegant way of doing it using PGs SELECT rules, and some type
of connection "session" information. Well I got the connection session stuff
figured out thanks to Richard Huxton. Apparently though, SELECT rules can
only be used to create views and not actually modify the data returned by a
table?

I was trying to do something along the lines of a translations table, which
house all translations for a given string. My lookup tables would then
reference the specific strings they needed. I was then going to place a
SELECT rule on the lookup table that would perform a join(based off of the
lookup word, and the current session language), and return that in the field
of the lookup value.

Is my only option to use a separate view? What are some techniques the rest
of you use for storing translation info in the DB?

Thanks,
Steve



pgsql-general by date:

Previous
From: MargaretGillon@chromalloy.com
Date:
Subject: How to know if a TRANSACTION isn't completed
Next
From: David Pratt
Date:
Subject: Re: Advice on structure /sequence / trigger