From: Pavlo Golub <pavlo.golub@cybertec.at>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-translators@postgresql.org
Subject: Re: API for babel.postgresql.org
Date: Sat, 08 Dec 2018 10:13:35 +0200
Message-ID: <b9352158-d8e2-4ec0-9df1-04d4b4b2f934@email.android.com> (raw)
In-Reply-To: <b18654e1-b38f-310e-03ee-a75a47cc3537@gmail.com>
<div dir='auto'><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Dec 8, 2018 10:00, Alexander Lakhin <exclusion@gmail.com> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<div>Hello Pavlo,<br>
<br>
08.12.2018 10:42, Pavlo Golub wrote:<br>
</div>
<blockquote>
<div dir="auto">
<div><br>
<div>
<div class="elided-text">
<blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex">
<p dir="ltr">What kind of functionality are you hoping
such an API would provide?<br>
</p>
</blockquote>
</div>
</div>
</div>
<div dir="auto">Dumb and simple. List of languages, list of
resources, links to .pot and .po files.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Example:</div>
<div dir="auto">GET /resources</div>
<div dir="auto">GET /languages</div>
<div dir="auto">GET /psql.pot</div>
<div dir="auto">GET /pt_BR/postgres.po</div>
<div dir="auto"><br>
</div>
<div dir="auto">If it's complicated never mind. I can probably
parse html then</div>
</div>
</blockquote>
I use a bash script to collect all pot's from branches in git:<br>
extract_pot() {<!-- --><br>
local version=<span class="money">$1</span><br>
local gitdir=<span class="money">$2</span><br>
local branch=<span class="money">$3</span><br>
mkdir $POTD/$version<br>
(<br>
cd $gitdir<br>
git clean -dfx<br>
git reset --hard HEAD<br>
git checkout $branch<br>
git rebase<br>
./configure --enable-nls >/dev/null<br>
make init-po<br>
for pot in `find . -name '*.pot'`; do<br>
cp $pot $POTD/$version/<br>
echo $pot<br>
done<br>
)<br>
}<br>
<br>
<br>
For me the most inconvenient part was to support several versions of
.po and synchronize between them.<br>
So I use pology (posummit) to get united .po's, which looks like:<br>
<tt>#. +> 11 10 9.6 9.5</tt><tt><br>
</tt><tt>#: pg_config.c:153</tt><tt><br>
</tt><tt>#, c-format</tt><tt><br>
</tt><tt>msgid "%s: could not find own program executable\n"</tt><tt><br>
</tt><tt>msgstr "%s: не удалось найти свой исполняемый файл\n"</tt><tt><br>
</tt><tt><br>
</tt><tt>#. +> 11 10 9.6 9.5</tt><tt><br>
</tt><tt>#: pg_config.c:180</tt><tt><br>
</tt><tt>#, c-format</tt><tt><br>
</tt><tt>msgid "%s: invalid argument: %s\n"</tt><tt><br>
</tt><tt>msgstr "%s: неверный аргумент: %s\n"</tt><tt><br>
</tt><tt><br>
</tt><tt>#. +> 9.5</tt><tt><br>
</tt><tt>#: pg_config.c:243 pg_config.c:259 pg_config.c:275
pg_config.c:291</tt><tt><br>
</tt><tt>#: pg_config.c:307 pg_config.c:323 pg_config.c:339
pg_config.c:355</tt><tt><br>
</tt><tt>#: pg_config.c:371</tt><tt><br>
</tt><tt>#, c-format</tt><tt><br>
</tt><tt>msgid "not recorded\n"</tt><tt><br>
</tt><tt>msgstr "не сохранено\n"</tt><tt><br>
</tt><br>
I can share my scripts if it can be useful for you.<br>
</div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Yes, please. Would be awesome. Thanks</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>
Best regards,<br>
Alexander<br>
</div>
</blockquote></div><br></div></div></div>
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-translators@postgresql.org
Cc: pavlo.golub@cybertec.at, exclusion@gmail.com, peter.eisentraut@2ndquadrant.com
Subject: Re: API for babel.postgresql.org
In-Reply-To: <b9352158-d8e2-4ec0-9df1-04d4b4b2f934@email.android.com>
References: <b18654e1-b38f-310e-03ee-a75a47cc3537@gmail.com> <b9352158-d8e2-4ec0-9df1-04d4b4b2f934@email.android.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