Debian Codegraph @

update-po.sh

raw symbols SCIP
1 #!/bin/bash
2
3 set -x
4
5 # Copyright (C) 2017 by Mike Gabriel <[email protected]>
6 #
7 # This package is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; version 3 of the License.
10 #
11 # This package is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>
18
19 GETTEXT_DOMAIN=$(cat CMakeLists.txt | grep 'set.*(.*GETTEXT_PACKAGE' | sed -r -e 's/.*\"([^"]+)\"\)/\1/')
20
21 cp po/${GETTEXT_DOMAIN}.pot po/${GETTEXT_DOMAIN}.pot~
22
23 cd po/
24 cat LINGUAS | while read lingua; do
25 if [ ! -e ${lingua}.po ]; then
26 msginit --input=${GETTEXT_DOMAIN}.pot --locale=${lingua} --no-translator --output-file=$lingua.po
27 else
28 intltool-update --gettext-package ${GETTEXT_DOMAIN} $(basename ${lingua})
29 fi
30
31 sed -E \
32 -e 's/\.xml\.in\.h:/.xml.in:/g' \
33 -e 's/\.ini\.in\.h:/.ini.in:/g' \
34 -e 's/\.xml\.h:/.xml:/g' \
35 -e 's/\.ini\.h:/.ini:/g' \
36 -e 's@^#: \.\./@#: @g' \
37 -e 's@(:[0-9]+) \.\./@\1 @g' \
38 -i ${lingua}.po
39
40 done
41 cd - 1>/dev/null
42
43 mv po/${GETTEXT_DOMAIN}.pot~ po/${GETTEXT_DOMAIN}.pot