imip-agent

tools/i18n_messages.sh

1261:1aa985ba6e76
2017-09-13 Paul Boddie Moved period removal logic into the data module.
     1 #!/bin/sh     2      3 # This tool extracts textual messages from the imip-agent program files, using     4 # the gettext software to merge updated messages with the existing catalogues.     5 #     6 # Copyright (C) 2015, 2016 Paul Boddie <paul@boddie.org.uk>     7 #     8 # This program is free software; you can redistribute it and/or modify it under     9 # the terms of the GNU General Public License as published by the Free Software    10 # Foundation; either version 3 of the License, or (at your option) any later    11 # version.    12 #    13 # This program is distributed in the hope that it will be useful, but WITHOUT    14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    15 # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more    16 # details.    17 #    18 # You should have received a copy of the GNU General Public License along with    19 # this program.  If not, see <http://www.gnu.org/licenses/>.    20     21 # Obtain messages from the Python files.    22     23   find imiptools imipweb -type f -name '*.py' \    24 | xargs xgettext -d imip-agent --sort-by-file \    25                  --copyright-holder="Paul Boddie <paul@boddie.org.uk>" \    26                  --package-name="imip-agent" --package-version=`hg id | cut -d ' ' -f 1`    27     28 # Set the default charset.    29     30   sed "s/CHARSET/UTF-8/" imip-agent.po \    31 > imip-agent.pot    32     33 # Remove the original file.    34     35 rm imip-agent.po    36     37 # Merge messages with the existing translations.    38     39 for FILENAME in messages/*.po ; do    40     msgmerge --update "$FILENAME" imip-agent.pot    41 done