Transparent i18n?

Поиск
Список
Период
Сортировка
От Steve - DND
Тема Transparent i18n?
Дата
Msg-id LDEHKBBOEMIJKHKBOFNFCEKKPJAA.postgres@digitalnothing.com
обсуждение исходный текст
Ответы Re: Transparent i18n?  (David Pratt <fairwinds@eastlink.ca>)
Список 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 по дате отправления:

Предыдущее
От: MargaretGillon@chromalloy.com
Дата:
Сообщение: How to know if a TRANSACTION isn't completed
Следующее
От: David Pratt
Дата:
Сообщение: Re: Advice on structure /sequence / trigger