API for babel.postgresql.org

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

API for babel.postgresql.org

Pavlo Golub
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:[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: API for babel.postgresql.org

Peter Eisentraut-6
On 05/12/2018 11:53, Pavlo Golub 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.
>
> Thus I hope some API may help me a lot. Thanks in advance

What kind of functionality are you hoping such an API would provide?

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

Reply | Threaded
Open this post in threaded view
|

Re: API for babel.postgresql.org

Pavlo Golub


On Dec 8, 2018 09:19, Peter Eisentraut <[hidden email]> wrote:

On 05/12/2018 11:53, Pavlo Golub 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.
>
> Thus I hope some API may help me a lot. Thanks in advance

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


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


Reply | Threaded
Open this post in threaded view
|

Re: API for babel.postgresql.org

Alexander Lakhin-2
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
Reply | Threaded
Open this post in threaded view
|

Re: API for babel.postgresql.org

Pavlo Golub


On Dec 8, 2018 10:00, Alexander Lakhin <[hidden email]> wrote:
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.

Yes, please. Would be awesome. Thanks



Best regards,
Alexander

Reply | Threaded
Open this post in threaded view
|

Re: API for babel.postgresql.org

Alexander Lakhin-2

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 (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




pg-messages.tar.bz2 (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: API for babel.postgresql.org

Alvaro Herrera-9
In reply to this post by Alexander Lakhin-2
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

Reply | Threaded
Open this post in threaded view
|

Re: API for babel.postgresql.org

Pavlo Golub


On Dec 8, 2018 22:13, Alvaro Herrera <[hidden email]> wrote:

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)

+1 from me for API


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


Reply | Threaded
Open this post in threaded view
|

Re: API for babel.postgresql.org

Peter Eisentraut-6
In reply to this post by Pavlo Golub
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

Reply | Threaded
Open this post in threaded view
|

Re: API for babel.postgresql.org

Pavlo Golub


On Dec 12, 2018 19:58, Peter Eisentraut <[hidden email]> wrote:

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.


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.


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

Languages for current major version, I think, e.g. 10.x, 11.x, 9.6.x etc.


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


Resource is an application. Each .pot file corresponds to the resource. This term is from translators world. 


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


Reply | Threaded
Open this post in threaded view
|

Re: API for babel.postgresql.org

Daniele Varrazzo
In reply to this post by Pavlo Golub
On Wed, Dec 5, 2018 at 11:53 AM Pavlo Golub <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: API for babel.postgresql.org

Pavlo Golub


On Dec 30, 2018 00:56, Daniele Varrazzo <[hidden email]> wrote:

On Wed, Dec 5, 2018 at 11:53 AM Pavlo Golub <[hidden email]> 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.


Thanks a lot! Will give them a try.


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

-- Daniele