Bug 1091185 - weblate uses different formatting than gettext
weblate uses different formatting than gettext
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Translations
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Markéta Machová
Karl Eichwalder
Depends on:
  Show dependency treegraph
Reported: 2018-04-27 09:16 UTC by Arvin Schnell
Modified: 2018-10-22 14:24 UTC (History)
3 users (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Arvin Schnell 2018-04-27 09:16:52 UTC
After doing a "make merge" for libstorage-ng the resulting diff is much
bigger then required due do different formatting of weblate and gettext.

Have a look at https://github.com/openSUSE/libstorage-ng/pull/523/files.

E.g. in cs.po weblate places an empty string at the beginning of
very msgstr. In ar.po additionally long messages are split into several

This makes even a cursory review extra hard.
Comment 1 Tomáš Chvátal 2018-05-02 12:48:56 UTC
Weblate uses gettext to generate this stuff too.

It probably just uses different linewrap than your merge command which adds --no-wrap...

Per-se this is not a bug of weblate at all.
Comment 2 Stanislav Brabec 2018-05-02 14:12:11 UTC
This is not a bug.

But it is a reasonable feature request.

Gettext po files have a variable format, especially wrapping of long lines, wrapping around "\n" and adding empty string in top of multilines are not standardized.

Weblate itself does not use gettext, but translation-tools (python gettext library).

Weblate does not offer formattion options.

msgmerge supports --no-wrap and --width=NUMBER and --escape/--no-escape

It is possible to adjust Makefile to generate files more similar to Weblate.
Comment 3 Stanislav Brabec 2018-10-15 15:45:14 UTC
There is a difference:
translate-toolkit attempts to emulate the default gettext formatting.

libstorage-ng/po/Makefile.am adds --no-wrap argument to mesmerge.

--no-wrap generates po files with non-standard formatting.

I propose to remove --no-wrap.

Maybe there will be still some minor differences between gettext and translate-toolkit, but this change should eliminate these large diffs.
Comment 4 Markéta Machová 2018-10-17 13:29:52 UTC
I have created https://github.com/openSUSE/libstorage-ng/pull/582.

There is one last problem with preamble, where gettext breaks line at '-' character while weblate does not break it, but it is a minor bug and I am not going to fix it.

As soon as upstream accepts the pull request I would consider this bug as fixed.
Comment 5 Markéta Machová 2018-10-22 14:24:33 UTC
upstream accepted the fix