Skip to content

Commit 2a0f0bc

Browse files
committed
lang: Add git diff filter instructions for po files
1 parent b846b9b commit 2a0f0bc

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.gitattributes

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
lang/po/*.po text eol=crlf
1+
lang/po/*.po text eol=crlf diff=po
2+
lang/po/*.pot text diff=po

lang/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,19 @@ The new language needs to be explicitly added to the list of bundled languages i
9191

9292
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.
9393

94+
### Diffing translations
95+
96+
po/pot files contain file+line annotations for each translation which are convenient while translating but result in unwieldy diffs.
97+
98+
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:
99+
100+
```
101+
[diff "po"]
102+
textconv = msgcat --no-location --sort-output
103+
```
104+
105+
This requires ``gettext`` to be installed.
106+
94107
## Internal details
95108

96109
TODO

0 commit comments

Comments
 (0)