WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.58k stars 1.02k forks source link

Po minification addon #3350

Closed Jibec closed 4 years ago

Jibec commented 4 years ago

The structure of po files may have a big impact on the git repository size and change readability.

Here is a Python script to allow po minification: https://libvirt.org/git/?p=libvirt.git;a=blob;f=scripts/minimize-po.py;h=c3052297212e7416fd94866af3b3e5348a41b503;hb=HEAD

This work was done by Daniel P. Berrangé and documented there: https://www.berrange.com/posts/2018/11/29/improved-translation-po-file-handling-by-ditching-gettext-autotools-integration/

I assume this could be a feature of the command line tool.

nijel commented 4 years ago

I don't see much point in doing this in Weblate. In case you want to have minimal PO files in the repository, you have to do that before Weblate is involved. Doing that in Weblate will not have impact on the repository size (actually it will just increase the repository size, because it would create additional commit removing this information).

Most of the things can be controlled by Gettext directly:

Jibec commented 4 years ago

I wanted to share with you this upstream method I never saw before. I am unsure how to really make use of it. But maybe, weblate could be the only one to contain pot and real po? The upstream project would only pull minimized files?

nijel commented 4 years ago

Basically what they use is human readable MO - it contains only things needed at runtime, but removes anything what might be useful for translators. Maybe it's then better to pull MO files directly instead of inventing something in between.

Once https://github.com/WeblateOrg/weblate/issues/3263 is implemented, there will be an option to have bilingual PO files in Weblate and export anything you want. Right now however the PO exports include as much metadata as possible (including suggestions or comments done in Weblate).

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.