pg.ddx.io  pgsql-translators@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Pavlo Golub <pavlo.golub@cybertec.at>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-translators@postgresql.org
Subject: Re: API for babel.postgresql.org
Date: Sat, 8 Dec 2018 11:00:06 +0300
Message-ID: <b18654e1-b38f-310e-03ee-a75a47cc3537@gmail.com> (raw)
In-Reply-To: <73450841-93b9-4372-a879-e43d9b60c2a1@email.android.com>
References: <73450841-93b9-4372-a879-e43d9b60c2a1@email.android.com>

Hello Pavlo,

08.12.2018 10:42, Pavlo Golub wrote:
>
>     What kind of functionality are you hoping such an API would provide?
>
> Dumb and simple. List of languages, list of resources, links to .pot
> and .po files.
>
> Example:
> GET /resources
> GET /languages
> GET /psql.pot
> GET /pt_BR/postgres.po
>
> If it's complicated never mind. I can probably parse html then
I use a bash script to collect all pot's from branches in git:
extract_pot() {
    local version=$1
    local gitdir=$2
    local branch=$3
    mkdir $POTD/$version
    (
    cd $gitdir
    git clean -dfx
    git reset --hard HEAD
    git checkout $branch
    git rebase
    ./configure --enable-nls >/dev/null
    make init-po
    for pot in `find . -name '*.pot'`; do
        cp $pot $POTD/$version/
        echo $pot
    done
    )
}


For me the most inconvenient part was to support several versions of .po
and synchronize between them.
So I use pology (posummit) to get united .po's, which looks like:
#. +> 11 10 9.6 9.5
#: pg_config.c:153
#, c-format
msgid "%s: could not find own program executable\n"
msgstr "%s: не удалось найти свой исполняемый файл\n"

#. +> 11 10 9.6 9.5
#: pg_config.c:180
#, c-format
msgid "%s: invalid argument: %s\n"
msgstr "%s: неверный аргумент: %s\n"

#. +> 9.5
#: pg_config.c:243 pg_config.c:259 pg_config.c:275 pg_config.c:291
#: pg_config.c:307 pg_config.c:323 pg_config.c:339 pg_config.c:355
#: pg_config.c:371
#, c-format
msgid "not recorded\n"
msgstr "не сохранено\n"

I can share my scripts if it can be useful for you.

Best regards,
Alexander

view thread (12+ messages)  latest in thread

Message-ID: <b18654e1-b38f-310e-03ee-a75a47cc3537@gmail.com>
Permalink:  ../b18654e1-b38f-310e-03ee-a75a47cc3537@gmail.com/
Also on:    postgresql.org/message-id/b18654e1-b38f-310e-03ee-a75a47cc3537@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-translators@postgresql.org
  Cc: exclusion@gmail.com, pavlo.golub@cybertec.at, peter.eisentraut@2ndquadrant.com
  Subject: Re: API for babel.postgresql.org
  In-Reply-To: <b18654e1-b38f-310e-03ee-a75a47cc3537@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox