Skip to content

Commit e7db067

Browse files
committed
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>
1 parent de4201a commit e7db067

16 files changed

Lines changed: 155 additions & 4487 deletions

File tree

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ gitk-wish: gitk GIT-TCLTK-VARS
7070
$(PO_TEMPLATE): gitk
7171
$(XGETTEXT) -kmc -LTcl -o $@ gitk
7272
update-po:: $(PO_TEMPLATE)
73-
$(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
73+
$(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U --add-location $p $(PO_TEMPLATE) ; )
74+
@echo "Before committing changes, ensure that a clean-filter is installed:"; \
75+
echo; \
76+
echo " git config filter.gettext-no-location.clean \"msgcat --no-location -\""
7477
$(ALL_MSGFILES): %.msg : %.po
7578
@echo Generating catalog $@
7679
$(MSGFMT) --statistics --tcl -l $(basename $(notdir $<)) -d $(dir $@) $<

po/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/*.po filter=gettext-no-location

0 commit comments

Comments
 (0)