|
| 1 | +# Git Attributes for PO Files |
| 2 | +# |
| 3 | +# This file configures Git filters to automatically strip location information |
| 4 | +# from PO files when committing, producing cleaner diffs and saving repository |
| 5 | +# space. |
| 6 | +# |
| 7 | +# Two filter types are used: |
| 8 | +# 1. gettext-no-location: Strips both filenames and line numbers |
| 9 | +# (e.g., removes "#: main.c:123" entirely) |
| 10 | +# 2. gettext-no-line-number: Preserves filenames but removes line numbers, which |
| 11 | +# requires gettext 0.20 or higher |
| 12 | +# (e.g., "#: main.c:123" becomes "#: main.c") |
| 13 | +# |
| 14 | +# See `po/README.md` for instructions on setting up the required filter drivers. |
| 15 | + |
| 16 | +# Default: Strip the whole location comments for all .po files |
| 17 | +*.po filter=gettext-no-location |
| 18 | + |
| 19 | +# Legacy, unmaintained PO files: filter disabled to avoid index vs |
| 20 | +# working-tree mismatch (these files still have location comments). |
| 21 | +el.po -filter |
| 22 | +is.po -filter |
| 23 | +it.po -filter |
| 24 | +ko.po -filter |
| 25 | +pl.po -filter |
| 26 | +pt_PT.po -filter |
| 27 | + |
| 28 | +# These files use gettext-no-line-number (keep filenames, strip line |
| 29 | +# numbers). The choice is per l10n team preference. Requires gettext 0.20+. |
| 30 | +# The only benefit is locating source files from location comments when |
| 31 | +# the .po file is not updated from the POT via make po-update. |
| 32 | +ca.po filter=gettext-no-line-number |
| 33 | +id.po filter=gettext-no-line-number |
| 34 | +zh_CN.po filter=gettext-no-line-number |
| 35 | +zh_TW.po filter=gettext-no-line-number |
0 commit comments