imip-agent

Annotated tools/i18n_format.sh

1336:5e4371f01764
2017-10-17 Paul Boddie Introduced convenience methods for ensuring URI values from object properties.
paul@1005 1
#!/bin/sh
paul@1005 2
paul@1201 3
# This tool compiles textual messages from the message catalogues for
paul@1201 4
# imip-agent using the gettext software.
paul@1201 5
#
paul@1201 6
# Copyright (C) 2015, 2016 Paul Boddie <paul@boddie.org.uk>
paul@1201 7
#
paul@1201 8
# This program is free software; you can redistribute it and/or modify it under
paul@1201 9
# the terms of the GNU General Public License as published by the Free Software
paul@1201 10
# Foundation; either version 3 of the License, or (at your option) any later
paul@1201 11
# version.
paul@1201 12
#
paul@1201 13
# This program is distributed in the hope that it will be useful, but WITHOUT
paul@1201 14
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
paul@1201 15
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
paul@1201 16
# details.
paul@1201 17
#
paul@1201 18
# You should have received a copy of the GNU General Public License along with
paul@1201 19
# this program.  If not, see <http://www.gnu.org/licenses/>.
paul@1201 20
paul@1158 21
if ! which msgfmt > /dev/null 2>&1 ; then
paul@1158 22
    exit 1
paul@1158 23
fi
paul@1158 24
paul@1005 25
DOMAIN=imip-agent
paul@1005 26
paul@1005 27
for FILENAME in messages/*.po ; do
paul@1005 28
    LOCALE_ID=`basename "$FILENAME" ".$DOMAIN.po"`
paul@1008 29
    mkdir -p "locale/$LOCALE_ID/LC_MESSAGES"
paul@1005 30
    msgfmt -o "locale/$LOCALE_ID/LC_MESSAGES/$DOMAIN.mo" "$FILENAME"
paul@1005 31
done