Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 55097a53594c5141430969e3a3cf79bb > files > 77

mlmmj-1.2.17.1-2.fc15.i686.rpm

#!/bin/bash
#
# Build script for generating the MLMMJ moderation web interface locales
#

set -e

LOCALE_TRANS=fr_FR
WEB_SCRIPT_FILES=mlmmj-moderation.php

if [ ! -d translations ]; then
	echo "Wrong working directory." >&2
	exit 1
fi

echo "===> Managing internationalizations and localizations"

echo "=> Extracting strings from sources"
xgettext $WEB_SCRIPT_FILES -o translations/templates.pot

echo "=> Merging in every language .po file:"
for i in $LOCALE_TRANS; do
	echo -n "$i "
	msgmerge -s -U "translations/$i.po" translations/templates.pot
done

echo "=> Creating l10n folders"
for i in $LOCALE_TRANS; do
	mkdir -p "translations/locale/$i/LC_MESSAGES"
done

echo "=> Creating binary formats of language files:"
for i in $LOCALE_TRANS; do
	echo -n $i" "
	msgfmt -c -v -o "translations/locale/$i/LC_MESSAGES/messages.mo" \
		"translations/$i.po"
done