Re: [PATCH 0/9] Incremental po/git.pot update and new l10n workflow
- From
Jiang Xin <worldhello.net@gmail.com>
- Date
- May 4, 2022, 12:41 UTC
- Message-ID
- <20220504124121.12683-1-worldhello.net@gmail.com>
- In-Reply-To
- <cb74f3b-c2e9-947f-8f89-f51e79b17825@softwolves.pp.se>
On Tue, 3 May 2022, Peter Krefting wrote:
Show 7 quoted lines
> I do agree that checking in git.pot does create a lot of noise, but ther are > other ways of fixing that than deleting the file completely. I am also > translating for dpkg, and there they run "xgettext --add-location=file" to > remove the line numbers from the POT and PO files (requires GNU gettext > 0.19; they also use "po4a --porefs=noline" for manual page translations, but > we do not have translation for manual pages for Git, yet). This reduces diff > noise considerably.
To evaluate the impact of different formats of po files on the size of the repository, I tailored the git repository with only "po/*" files with history, and all "*.po" files are converted using "msgcat" into different format in 3 different branches. See:
https://github.com/jiangxin/git-po-filtered
* For po files with file-location:
$ git clone --single-branch \
--branch po-with-file-location \
git@github.com:jiangxin/git-po-filtered.git \
po-with-file-location $ du -sh po-with-file-location/.git/objects
28M po-with-file-location/.git/objects* For po files with file name only:
$ git clone --single-branch \
--branch po-with-file \
git@github.com:jiangxin/git-po-filtered.git \
po-with-file $ du -sh po-with-file/.git/objects
6.1M po-with-file/.git/objects* For po files without file-location:
$ git clone --single-branch \
--branch po-no-file-location \
git@github.com:jiangxin/git-po-filtered.git \
po-no-file-location $ du -sh po-no-file-location/.git/objects
6.2M po-no-file-location/.git/objectsFrom the above command output we can see that by removing line numbers from po files, the size of the repository can be greatly reduced.
> I have been doing updates semi-off-line from my laptop for the last few > months, without a proper build environment, and having the history for the > POT file available for diffing has been useful. >
"po/git.pot" will be generated periodically at the following location, where you can get "po/git.pot" if you don't have a build environment at hand.
* https://github.com/git-l10n/git-po/tree/pot/master/po
Show 6 quoted lines
> > * L10n contributors can start translations at any time, even before the > > l10n announcing l10n window open. We must have a new l10n workflow, > > see patch 9/9. > > You can always re-generate the POT file locally and not commit it, to update > the PO files. That has not been a problem.
File-location meta info in po file can help l10n tools to locate context easily. E.g.: When editing po file using Emacs (with po-mode), press the key "s" (source) will open another window showing context of the specific l10n message.
But if there is no file-location in "po/git.pot", we have no way to generate po/XX.po with proper file-location. While if we store po/git.pot with file location in git repository, repository size will get biger and biger. As how to commit a po/XX.po without file locaiton automatically, we add some instructions in patch 9/9, and we can also rewrite l10n CI pipeline to validate po files from l10n contributors.
-- Jiang Xin