Add new locales and restructure how they are handled.

We now build the dba/supported_locales.sql file from po/locale.values
files for each locale, and we are also fetching the translations from
transifex.net in order to build them.

This commit also adds support for some new locales, especially
Brazilian Portuguese and Mexican Spanish.
This commit is contained in:
Andrew McMillan committed 2011-08-25 12:45:33 +12:00
1 parent 27deec06ac
commit 504651a3f5
36 files changed
+5446 -3891

No files matched your search

+17 -2
View File
@@ -25,8 +25,23 @@ xgettext --no-location --add-comments=Translators --keyword=translate --keyword=
sed 's.^"Content-Type: text/plain; charset=CHARSET\\n"."Content-Type: text/plain; charset=UTF-8\\n".' ${PODIR}/messages.tmp > ${PODIR}/messages.pot
rm ${PODIR}/messages.tmp ${PODIR}/pofilelist.tmp
locale_list() {
ls ${PODIR}/*.po | cut -f2 -d/ | cut -f1 -d.
}
for LOCALE in `grep VALUES dba/supported_locales.sql | cut -f2 -d"'" | cut -f1 -d'_'` ; do
build_supported_locales() {
echo "TRUNCATE supported_locales;"
echo "INSERT INTO supported_locales ( locale, locale_name_en, locale_name_locale )"
echo " VALUES( 'en', 'English', 'English' );"
for LOCALE in `locale_list`; do
echo "INSERT INTO supported_locales ( locale, locale_name_en, locale_name_locale )"
cat ${PODIR}/${LOCALE}.values
done
}
build_supported_locales >dba/supported_locales.sql
for LOCALE in `locale_list` ; do
[ "${LOCALE}" = "en" ] && continue
if [ ! -f ${PODIR}/${LOCALE}.po ] ; then
cp ${PODIR}/messages.pot ${PODIR}/${LOCALE}.po
@@ -34,7 +49,7 @@ for LOCALE in `grep VALUES dba/supported_locales.sql | cut -f2 -d"'" | cut -f1 -
msgmerge --no-fuzzy-matching --quiet --width 105 --update ${PODIR}/${LOCALE}.po ${PODIR}/messages.pot
done
for LOCALE in `grep VALUES dba/supported_locales.sql | cut -f2 -d"'" | cut -f1 -d'_'` ; do
for LOCALE in `locale_list` ; do
[ "${LOCALE}" = "en" ] && continue
mkdir -p ${LOCALEDIR}/${LOCALE}/LC_MESSAGES
msgfmt ${PODIR}/${LOCALE}.po -o ${LOCALEDIR}/${LOCALE}/LC_MESSAGES/${APPLICATION}.mo