lang: Add git diff filter instructions for po files

This commit is contained in:
Yuri D'Elia 2022-10-13 23:08:52 +02:00
parent b846b9b70d
commit 2a0f0bcd19
2 changed files with 15 additions and 1 deletions

3
.gitattributes vendored
View File

@ -1 +1,2 @@
lang/po/*.po text eol=crlf lang/po/*.po text eol=crlf diff=po
lang/po/*.pot text diff=po

View File

@ -91,6 +91,19 @@ The new language needs to be explicitly added to the list of bundled languages i
At this point the new language should be picked-up normally. See [how to build an internationalized firmware](#building-an-internationalized-firmware) and use ``lang-check.py`` for [previewing the translation](#typo-or-incorrect-translation-in-existing-text) without having to perform a complete rebuild. At this point the new language should be picked-up normally. See [how to build an internationalized firmware](#building-an-internationalized-firmware) and use ``lang-check.py`` for [previewing the translation](#typo-or-incorrect-translation-in-existing-text) without having to perform a complete rebuild.
### Diffing translations
po/pot files contain file+line annotations for each translation which are convenient while translating but result in unwieldy diffs.
To alleviate the problem when using git you can add the following snippet to your ``~/.config/git/config`` or ``~/.gitconfig`` file to automatically remove position changes using the ``msgcat`` utility:
```
[diff "po"]
textconv = msgcat --no-location --sort-output
```
This requires ``gettext`` to be installed.
## Internal details ## Internal details
TODO TODO