| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
cd "$(dirname "$0")/.." || exit 1 |
| 4 |
truncate -s0 po/nfoview.pot |
| 5 |
|
| 6 |
# Python code |
| 7 |
xgettext \ |
| 8 |
--output=po/nfoview.pot \ |
| 9 |
--join-existing \ |
| 10 |
--from-code=UTF-8 \ |
| 11 |
--language=Python \ |
| 12 |
--keyword=_:1 \ |
| 13 |
--keyword=__:1 \ |
| 14 |
--keyword=d_:2 \ |
| 15 |
--keyword=n_:1,2 \ |
| 16 |
--add-comments=TRANSLATORS: \ |
| 17 |
nfoview/*.py |
| 18 |
|
| 19 |
# GtkBuilder XML files |
| 20 |
xgettext \ |
| 21 |
--output=po/nfoview.pot \ |
| 22 |
--join-existing \ |
| 23 |
--from-code=UTF-8 \ |
| 24 |
data/*.ui |
| 25 |
|
| 26 |
# AppData XML file |
| 27 |
xgettext \ |
| 28 |
--output=po/nfoview.pot \ |
| 29 |
--join-existing \ |
| 30 |
--from-code=UTF-8 \ |
| 31 |
data/io.otsaloma.nfoview.appdata.xml.in |
| 32 |
|
| 33 |
# Desktop file |
| 34 |
xgettext \ |
| 35 |
--output=po/nfoview.pot \ |
| 36 |
--join-existing \ |
| 37 |
--from-code=UTF-8 \ |
| 38 |
--language=Desktop \ |
| 39 |
--keyword= \ |
| 40 |
--keyword=Name \ |
| 41 |
--keyword=Comment \ |
| 42 |
--keyword=Keywords \ |
| 43 |
--add-comments=TRANSLATORS: \ |
| 44 |
data/io.otsaloma.nfoview.desktop.in |
| 45 |
|
| 46 |
# XXX: Fix charset=CHARSET which causes msggrep to fail. |
| 47 |
sed -i s/charset=CHARSET/charset=UTF-8/ po/nfoview.pot |
| 48 |
|
| 49 |
# Remove AppData entries that shouldn't be translated. |
| 50 |
msggrep \ |
| 51 |
--invert-match \ |
| 52 |
--msgid \ |
| 53 |
--regexp="^Osmo Salomaa$" \ |
| 54 |
--output-file=po/tmp.pot \ |
| 55 |
po/nfoview.pot && mv -f po/tmp.pot po/nfoview.pot |