Re: API for babel.postgresql.org

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Pavlo Golub <pavlo(dot)golub(at)cybertec(dot)at>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-translators(at)postgresql(dot)org
Subject: Re: API for babel.postgresql.org
Date: 2018-12-08 08:00:06
Message-ID: b18654e1-b38f-310e-03ee-a75a47cc3537@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-translators

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

In response to

Responses

Browse pgsql-translators by date

  From Date Subject
Next Message Pavlo Golub 2018-12-08 08:13:35 Re: API for babel.postgresql.org
Previous Message Pavlo Golub 2018-12-08 07:42:22 Re: API for babel.postgresql.org