Skip to content

Commit c3f589e

Browse files
committed
docs(l10n): move location-less filter to a separate section
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
1 parent 1f2588d commit c3f589e

File tree

1 file changed

+38
-35
lines changed

1 file changed

+38
-35
lines changed

po/README.md

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -159,41 +159,6 @@ It will:
159159
and these location lines will help translation tools to locate
160160
translation context easily.
161161

162-
Once you are done testing the translation (see below), it's better
163-
to commit a location-less "po/XX.po" file to save repository space
164-
and make a user-friendly patch for review.
165-
166-
To save a location-less "po/XX.po" automatically in repository, you
167-
can:
168-
169-
First, check which filter is configured for your "po/XX.po" file:
170-
171-
```
172-
git check-attr filter po/XX.po
173-
```
174-
175-
The filter configuration is defined in the "po/.gitattributes" file.
176-
177-
Then define the driver for the filter. Most languages use the
178-
"gettext-no-file-no-location" clean filter, which strips out both filenames and
179-
locations from the comments. To set this up, run the following command:
180-
181-
```shell
182-
git config --global filter.gettext-no-file-no-location.clean \
183-
"msgcat --no-location -"
184-
```
185-
186-
Some languages use the "gettext-no-location" clean filter, which preserves
187-
filenames but not locations. For these, install gettext version 0.20 or higher
188-
and setup the driver as below:
189-
190-
```shell
191-
git config --global filter.gettext-no-location.clean \
192-
"msgcat --add-location=file -"
193-
```
194-
195-
You're now ready to ask the l10n coordinator to pull from you.
196-
197162

198163
## Fuzzy translation
199164

@@ -232,6 +197,44 @@ git-po-helper check-commits <rev-list-opts>
232197
```
233198

234199

200+
## Preparing a "XX.po" file for commit
201+
202+
Once you are done testing the translation, it's better to commit a
203+
location-less "po/XX.po" file to save repository space and make a
204+
user-friendly patch for review.
205+
206+
To save a location-less "po/XX.po" automatically in repository, you
207+
can:
208+
209+
First, check which filter is configured for your "po/XX.po" file:
210+
211+
```
212+
git check-attr filter po/XX.po
213+
```
214+
215+
The filter configuration is defined in the "po/.gitattributes" file.
216+
217+
Then define the driver for the filter. Most languages use the
218+
"gettext-no-file-no-location" clean filter, which strips out both filenames and
219+
locations from the comments. To set this up, run the following command:
220+
221+
```shell
222+
git config --global filter.gettext-no-file-no-location.clean \
223+
"msgcat --no-location -"
224+
```
225+
226+
Some languages use the "gettext-no-location" clean filter, which preserves
227+
filenames but not locations. For these, install gettext version 0.20 or higher
228+
and setup the driver as below:
229+
230+
```shell
231+
git config --global filter.gettext-no-location.clean \
232+
"msgcat --add-location=file -"
233+
```
234+
235+
You're now ready to ask the l10n coordinator to pull from you.
236+
237+
235238
## Marking strings for translation
236239

237240
(This is done by the core developers).

0 commit comments

Comments
 (0)