gitk: commit translation files without file information

File information in the translation files is only helpful for the
translators, but is not needed to compile the message catalogs. On top
of that, file information is rather volatile and leads to large patches
that do not carry essential information. For this reason, Git project
has opted to remove the file information from its translation files.
Let's do that in this project, too.

Rewrite the update-po target to generate *.po files that do contain
file information for the benefit of translators. Configure a clean
filter under the name "gettext-no-location", which is the same that
the Git project uses. It is expected that translators have already
configured their repository suitably. Nevertheless, write a reminder
as part of the update-po target.

Apply the clean-filter to the translation files.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
This commit is contained in:
Johannes Sixt
2026-03-02 09:14:48 +01:00
parent de4201af7d
commit e7db0670ee
16 changed files with 155 additions and 4487 deletions

View File

@@ -70,7 +70,10 @@ gitk-wish: gitk GIT-TCLTK-VARS
$(PO_TEMPLATE): gitk
$(XGETTEXT) -kmc -LTcl -o $@ gitk
update-po:: $(PO_TEMPLATE)
$(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
$(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U --add-location $p $(PO_TEMPLATE) ; )
@echo "Before committing changes, ensure that a clean-filter is installed:"; \
echo; \
echo " git config filter.gettext-no-location.clean \"msgcat --no-location -\""
$(ALL_MSGFILES): %.msg : %.po
@echo Generating catalog $@
$(MSGFMT) --statistics --tcl -l $(basename $(notdir $<)) -d $(dir $@) $<

1
po/.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
/*.po filter=gettext-no-location

310
po/ca.po

File diff suppressed because it is too large Load Diff

316
po/de.po

File diff suppressed because it is too large Load Diff

310
po/es.po

File diff suppressed because it is too large Load Diff

339
po/fr.po

File diff suppressed because it is too large Load Diff

310
po/hu.po

File diff suppressed because it is too large Load Diff

310
po/it.po

File diff suppressed because it is too large Load Diff

325
po/ja.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

395
po/ru.po

File diff suppressed because it is too large Load Diff

326
po/sv.po

File diff suppressed because it is too large Load Diff

389
po/ta.po

File diff suppressed because it is too large Load Diff

310
po/vi.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff