Aw: Re: Localizing stored functions by replacing placeholders in their body

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Aw: Re: Localizing stored functions by replacing placeholders in their body
Date: 2021-03-02 20:23:51
Message-ID: trinity-9db230c0-6119-48a6-bd24-7b67b87a414a-1614716631208@3c-app-gmx-bs61
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I'm not sure this is a great approach to in-database translations: you
> have one function per string, which is cumbersome, bloated and probably
> slow. I would suggest having a function that takes a string and returns
> its translation, which is obtained from a couple of tables: one where
> the original strings are stored and another which stores the
> translations for each string into each language.

Perhaps like so

https://www.gnumed.de/documentation/schema/release/#i18n.table.curr-lang

SQL to be found here

https://github.com/ncqgm/gnumed/tree/master/gnumed/gnumed/server/sql

Karsten

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2021-03-02 22:28:56 Re: Locks in creating a partition in CREATE TABLE vs ALTER TABLE
Previous Message Alvaro Herrera 2021-03-02 20:19:00 Re: Localizing stored functions by replacing placeholders in their body