From f63b44c984ada32f3891b631b35b427814005552 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 7 Sep 2017 05:43:50 -0400 Subject: [PATCH] i18n: smash things back from unspecified charset to UTF-8 --- ci/txpull.sh | 2 ++ ci/txpush.sh | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ci/txpull.sh b/ci/txpull.sh index 6c5b20b2b..772ac0e32 100755 --- a/ci/txpull.sh +++ b/ci/txpull.sh @@ -60,6 +60,7 @@ for MODULE_DIR in $(find src/modules -maxdepth 1 -mindepth 1 -type d) ; do if [ -d ${MODULE_DIR}/lang ]; then # Convert PO files to MO files for POFILE in $(find ${MODULE_DIR} -name "*.po") ; do + sed -i'' '/^"Content-Type/s/CHARSET/UTF-8/' $POFILE msgfmt -o ${POFILE%.po}.mo $POFILE done git add --verbose ${MODULE_DIR}/lang/* @@ -69,6 +70,7 @@ for MODULE_DIR in $(find src/modules -maxdepth 1 -mindepth 1 -type d) ; do done for POFILE in $(find lang -name "python.po") ; do + sed -i'' '/^"Content-Type/s/CHARSET/UTF-8/' $POFILE msgfmt -o ${POFILE%.po}.mo $POFILE done git add --verbose lang/python* diff --git a/ci/txpush.sh b/ci/txpush.sh index cb2499f3e..fe6d7170f 100755 --- a/ci/txpush.sh +++ b/ci/txpush.sh @@ -56,8 +56,10 @@ for MODULE_DIR in $(find src/modules -maxdepth 1 -mindepth 1 -type d) ; do MODULE_NAME=$(basename ${MODULE_DIR}) if [ -d ${MODULE_DIR}/lang ]; then ${PYGETTEXT} -p ${MODULE_DIR}/lang -d ${MODULE_NAME} -o ${MODULE_NAME}.pot ${MODULE_DIR}/*.py - if [ -f ${MODULE_DIR}/lang/${MODULE_NAME}.pot ]; then - tx set -r calamares.${MODULE_NAME} --source -l en ${MODULE_DIR}/lang/${MODULE_NAME}.pot + POTFILE="${MODULE_DIR}/lang/${MODULE_NAME}.pot" + if [ -f "$POTFILE" ]; then + sed -i'' '/^"Content-Type/s/CHARSET/UTF-8/' "$POTFILE" + tx set -r calamares.${MODULE_NAME} --source -l en "$POTFILE" tx push --source --no-interactive -r calamares.${MODULE_NAME} fi else @@ -68,6 +70,8 @@ done if test -n "$SHARED_PYTHON" ; then ${PYGETTEXT} -p lang -d python -o python.pot $SHARED_PYTHON - tx set -r calamares.python --source -l en lang/python.pot + POTFILE="lang/python.pot" + sed -i'' '/^"Content-Type/s/CHARSET/UTF-8/' "$POTFILE" + tx set -r calamares.python --source -l en "$POTFILE" tx push --source --no-interactive -r calamares.python fi