pg.ddx.io  pgsql-translators@postgresql.org mailing list archive  
help / color / mirror / Atom feed
API for babel.postgresql.org
12+ messages / 5 participants
[nested] [flat]

* API for babel.postgresql.org
@ 2018-12-05 10:53  Pavlo Golub <pavlo.golub@cybertec.at>
  0 siblings, 1 reply; 12+ messages in thread

From: Pavlo Golub @ 2018-12-05 10:53 UTC (permalink / raw)
  To: pgsql-translators

Greetings, Pgsql-translators.

Is there any API for https://babel.postgresql.org/?

Since .pot files are not part of the repository sources, neither
.po files with translation ratio less then 80, I cannot use github
integration. 

Thus I hope some API may help me a lot. Thanks in advance

-- 
Kind regards,
 Pavlo                          mailto:pavlo.golub@cybertec.at





^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: API for babel.postgresql.org
@ 2018-12-08 07:42  Pavlo Golub <pavlo.golub@cybertec.at>
  0 siblings, 2 replies; 12+ messages in thread

From: Pavlo Golub @ 2018-12-08 07:42 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; +Cc: pgsql-translators

<div dir='auto'><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Dec 8, 2018 09:19, Peter Eisentraut &lt;peter.eisentraut@2ndquadrant.com&gt; wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">On 05/12/2018 11:53, Pavlo Golub wrote:
<br>
&gt; Greetings, Pgsql-translators.
<br>
&gt; 
<br>
&gt; Is there any API for https://babel.postgresql.org/?
<br>
&gt; 
<br>
&gt; Since .pot files are not part of the repository sources, neither
<br>
&gt; .po files with translation ratio less then 80, I cannot use github
<br>
&gt; integration. 
<br>
&gt; 
<br>
&gt; Thus I hope some API may help me a lot. Thanks in advance
<br>

<br>
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 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"><p dir="ltr">

<br>
-- 
<br>
Peter Eisentraut&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; http://www.2ndQuadrant.com/
<br>
PostgreSQL Development, 24x7 Support, Remote DBA, Training &amp; Services
<br>
</p>
</blockquote></div><br></div></div></div>

^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: API for babel.postgresql.org
@ 2018-12-08 08:00  Alexander Lakhin <exclusion@gmail.com>
  parent: Pavlo Golub <pavlo.golub@cybertec.at>
  1 sibling, 2 replies; 12+ messages in thread

From: Alexander Lakhin @ 2018-12-08 08:00 UTC (permalink / raw)
  To: Pavlo Golub <pavlo.golub@cybertec.at>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; 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

^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: API for babel.postgresql.org
@ 2018-12-08 08:13  Pavlo Golub <pavlo.golub@cybertec.at>
  parent: Alexander Lakhin <exclusion@gmail.com>
  1 sibling, 1 reply; 12+ messages in thread

From: Pavlo Golub @ 2018-12-08 08:13 UTC (permalink / raw)
  To: Alexander Lakhin <exclusion@gmail.com>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-translators

<div dir='auto'><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Dec 8, 2018 10:00, Alexander Lakhin &lt;exclusion@gmail.com&gt; 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>
    &nbsp;&nbsp;&nbsp; local version=<span class="money">$1</span><br>
    &nbsp;&nbsp;&nbsp; local gitdir=<span class="money">$2</span><br>
    &nbsp;&nbsp;&nbsp; local branch=<span class="money">$3</span><br>
    &nbsp;&nbsp;&nbsp; mkdir $POTD/$version<br>
    &nbsp;&nbsp;&nbsp; (<br>
    &nbsp;&nbsp;&nbsp; cd $gitdir<br>
    &nbsp;&nbsp;&nbsp; git clean -dfx<br>
    &nbsp;&nbsp;&nbsp; git reset --hard HEAD<br>
    &nbsp;&nbsp;&nbsp; git checkout $branch<br>
    &nbsp;&nbsp;&nbsp; git rebase<br>
    &nbsp;&nbsp;&nbsp; ./configure --enable-nls &gt;/dev/null<br>
    &nbsp;&nbsp;&nbsp; make init-po<br>
    &nbsp;&nbsp;&nbsp; for pot in `find . -name '*.pot'`; do<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp $pot $POTD/$version/<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo $pot<br>
    &nbsp;&nbsp;&nbsp; done<br>
    &nbsp;&nbsp;&nbsp; )<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>#. +&gt; 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>#. +&gt; 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>#. +&gt; 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>

^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: API for babel.postgresql.org
@ 2018-12-08 10:00  Alexander Lakhin <exclusion@gmail.com>
  parent: Pavlo Golub <pavlo.golub@cybertec.at>
  0 siblings, 0 replies; 12+ messages in thread

From: Alexander Lakhin @ 2018-12-08 10:00 UTC (permalink / raw)
  To: Pavlo Golub <pavlo.golub@cybertec.at>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-translators


08.12.2018 11:13, Pavlo Golub wrote:
>
>
>     I can share my scripts if it can be useful for you.
>
>
> Yes, please. Would be awesome. Thanks
>

Please look at the attached archive. After extracting it, you should
place pology <http://pology.nedohodnik.net/; (I use 0.12) in
pg-messages/ and run ./update-po.sh.
(The script with create .tmp with the temporary files, so you can remove
it later if you wish.)
You will get all united po's in postgresql/. It supposed that you will
work with them using some l10n tools. (I use Lokalize).
After translation you  can run ./scatter.sh and get all the messages
scattered by versions in .tmp/messages-$VER.git.
The scripts are intended for 'ru' translation, but you can easily switch
to another language.
Any feedback is welcome.

Best regards,
Alexander

Attachments:

  pg-messages.tar.bz2 (application/x-bzip, 1.9K) download

^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: API for babel.postgresql.org
@ 2018-12-08 20:13  Alvaro Herrera <alvherre@2ndquadrant.com>
  parent: Alexander Lakhin <exclusion@gmail.com>
  1 sibling, 1 reply; 12+ messages in thread

From: Alvaro Herrera @ 2018-12-08 20:13 UTC (permalink / raw)
  To: Alexander Lakhin <exclusion@gmail.com>; +Cc: Pavlo Golub <pavlo.golub@cybertec.at>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-translators

On 2018-Dec-08, Alexander Lakhin wrote:

> I use a bash script to collect all pot's from branches in git:

I too wrote a bunch of scripts to handle these tasks :-( and they are
quite ugly.  Maybe we need a better way, such as the API being
requested (we can discuss exactly what would be useful).

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: API for babel.postgresql.org
@ 2018-12-08 20:23  Pavlo Golub <pavlo.golub@cybertec.at>
  parent: Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 0 replies; 12+ messages in thread

From: Pavlo Golub @ 2018-12-08 20:23 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Alexander Lakhin <exclusion@gmail.com>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-translators

<div dir='auto'><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Dec 8, 2018 22:13, Alvaro Herrera &lt;alvherre@2ndquadrant.com&gt; wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">On 2018-Dec-08, Alexander Lakhin wrote:
<br>

<br>
&gt; I use a bash script to collect all pot's from branches in git:
<br>

<br>
I too wrote a bunch of scripts to handle these tasks :-( and they are
<br>
quite ugly.&nbsp; Maybe we need a better way, such as the API being
<br>
requested (we can discuss exactly what would be useful)<br></p></blockquote></div></div></div><div dir="auto">+1 from me for API</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"><p dir="ltr">

<br>
-- 
<br>
Álvaro Herrera&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; https://www.2ndQuadrant.com/
<br>
PostgreSQL Development, 24x7 Support, Remote DBA, Training &amp; Services
<br>
</p>
</blockquote></div><br></div></div></div>

^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: API for babel.postgresql.org
@ 2018-12-12 17:58  Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  parent: Pavlo Golub <pavlo.golub@cybertec.at>
  1 sibling, 1 reply; 12+ messages in thread

From: Peter Eisentraut @ 2018-12-12 17:58 UTC (permalink / raw)
  To: Pavlo Golub <pavlo.golub@cybertec.at>; +Cc: pgsql-translators

On 08/12/2018 08:42, Pavlo Golub wrote:
> 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

You can already get the .po and .pot files.

Adding a file with languages would be easy, but what exactly would it mean?

- all languages ever seen across any branch
- all languages in the current branch
- all languages for a catalog
- all languages qualified
- etc.

I don't know what you mean by "resources".

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: API for babel.postgresql.org
@ 2018-12-12 18:29  Pavlo Golub <pavlo.golub@cybertec.at>
  parent: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 0 replies; 12+ messages in thread

From: Pavlo Golub @ 2018-12-12 18:29 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; +Cc: pgsql-translators

<div dir='auto'><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Dec 12, 2018 19:58, Peter Eisentraut &lt;peter.eisentraut@2ndquadrant.com&gt; wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">On 08/12/2018 08:42, Pavlo Golub wrote:
<br>
&gt; Dumb and simple. List of languages, list of resources, links to .pot and
<br>
&gt; .po files.
<br>
&gt; 
<br>
&gt; Example:
<br>
&gt; GET /resources
<br>
&gt; GET /languages
<br>
&gt; GET /psql.pot
<br>
&gt; GET /pt_BR/postgres.po
<br>

<br>
You can already get the .po and .pot files.
<br></p></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Well, yes. Manually. I meant to get list of resources and languages. Then go through lists and download files. Now I need parse html to get links.</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"><p dir="ltr">

<br>
Adding a file with languages would be easy, but what exactly would it mean?
<br>

<br>
- all languages ever seen across any branch
<br>
- all languages in the current branch
<br>
- all languages for a catalog
<br>
- all languages qualified
<br>
- etc<br></p></blockquote></div></div></div><div dir="auto">Languages for current major version, I think, e.g. 10.x, 11.x, 9.6.x etc.</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"><p dir="ltr">

<br>
I don't know what you mean by "resources".
<br>

</p></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Resource is an application. Each .pot file corresponds to the resource. This term is from translators world.&nbsp;</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"><p dir="ltr"><br>
-- 
<br>
Peter Eisentraut&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; http://www.2ndQuadrant.com/
<br>
PostgreSQL Development, 24x7 Support, Remote DBA, Training &amp; Services
<br>
</p>
</blockquote></div><br></div></div></div>

^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: API for babel.postgresql.org
@ 2018-12-29 22:56  Daniele Varrazzo <daniele.varrazzo@gmail.com>
  parent: Pavlo Golub <pavlo.golub@cybertec.at>
  0 siblings, 0 replies; 12+ messages in thread

From: Daniele Varrazzo @ 2018-12-29 22:56 UTC (permalink / raw)
  To: Pavlo Golub <pavlo.golub@cybertec.at>; +Cc: pgsql-translators

On Wed, Dec 5, 2018 at 11:53 AM Pavlo Golub <pavlo.golub@cybertec.at> wrote:
>
> Greetings, Pgsql-translators.
>
> Is there any API for https://babel.postgresql.org/?
>
> Since .pot files are not part of the repository sources, neither
> .po files with translation ratio less then 80, I cannot use github
> integration.

You can find scripts here to download files from babel and integrate
them with your work.

https://github.com/dvarrazzo/postgresql-it

-- Daniele




^ permalink  raw  reply  [nested|flat] 12+ messages in thread


end of thread, other threads:[~2018-12-29 22:56 UTC | newest]

Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05 10:53 API for babel.postgresql.org Pavlo Golub <pavlo.golub@cybertec.at>
2018-12-29 22:56 ` Daniele Varrazzo <daniele.varrazzo@gmail.com>
2018-12-08 07:42 Re: API for babel.postgresql.org Pavlo Golub <pavlo.golub@cybertec.at>
2018-12-08 08:00 ` Alexander Lakhin <exclusion@gmail.com>
2018-12-08 08:13   ` Pavlo Golub <pavlo.golub@cybertec.at>
2018-12-08 10:00     ` Alexander Lakhin <exclusion@gmail.com>
2018-12-08 20:13   ` Alvaro Herrera <alvherre@2ndquadrant.com>
2018-12-08 20:23     ` Pavlo Golub <pavlo.golub@cybertec.at>
2018-12-12 17:58 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2018-12-12 18:29   ` Pavlo Golub <pavlo.golub@cybertec.at>

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