# HG changeset patch # User Paul Boddie # Date 1461362267 -7200 # Node ID 1a4f01ff7336fab7826f804d6c44b28dd9916325 # Parent 73c6d3841f7fe43b69ff46a019657ff19c3b908e Build the translation files when installing if they are absent. diff -r 73c6d3841f7f -r 1a4f01ff7336 tools/i18n_format.sh --- a/tools/i18n_format.sh Fri Apr 22 23:38:31 2016 +0200 +++ b/tools/i18n_format.sh Fri Apr 22 23:57:47 2016 +0200 @@ -1,5 +1,9 @@ #!/bin/sh +if ! which msgfmt > /dev/null 2>&1 ; then + exit 1 +fi + DOMAIN=imip-agent for FILENAME in messages/*.po ; do diff -r 73c6d3841f7f -r 1a4f01ff7336 tools/install.sh --- a/tools/install.sh Fri Apr 22 23:38:31 2016 +0200 +++ b/tools/install.sh Fri Apr 22 23:57:47 2016 +0200 @@ -130,11 +130,22 @@ # Locale directory. -if [ ! "$NO_LOCALE_DIR" ] && [ -e "locale" ]; then - for DIR in "locale/"*"/LC_MESSAGES" ; do - mkdir -p "$INSTALL_DIR/$DIR" - cp "$DIR/"*.mo "$INSTALL_DIR/$DIR/" - done +if [ ! "$NO_LOCALE_DIR" ]; then + + # Make the locale directory if it does not exist. + + if [ ! -e "locale" ]; then + "tools/i18n_format.sh" + fi + + # Only copy the translations if they do now exist. + + if [ -e "locale" ]; then + for DIR in "locale/"*"/LC_MESSAGES" ; do + mkdir -p "$INSTALL_DIR/$DIR" + cp "$DIR/"*.mo "$INSTALL_DIR/$DIR/" + done + fi fi # Run the scheduling module update tool to regenerate the manifest module.