From 830278caaf674be91e7471b8d5c0b3128c3d60e5 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 3 Dec 2015 16:47:48 +0000 Subject: [PATCH] Making mo files --- translate | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/translate b/translate index ed06bcd2..5fcbcf0d 100755 --- a/translate +++ b/translate @@ -90,10 +90,17 @@ function install_translations { do # convert json to mo if [ -f /usr/bin/i18next-conv ]; then - if [ -f locale/${lang}/${COMMAND_NAME}.json ]; then - i18next-conv -l ${lang} -s locale/${lang}/${COMMAND_NAME}.json -t /usr/share/locale/${lang}/${COMMAND_NAME}.mo + if [ ! -f locale/${lang}/${COMMAND_NAME}.mo ]; then + if [ -f locale/${lang}/${COMMAND_NAME}.json ]; then + i18next-conv -l ${lang} -s locale/${lang}/${COMMAND_NAME}.json -t locale/${lang}/${COMMAND_NAME}.mo + fi fi fi + + # install the mo + if [ -f locale/${lang}/${COMMAND_NAME}.mo ]; then + cp locale/${lang}/${COMMAND_NAME}.mo /usr/share/locale/${lang}/${COMMAND_NAME}.mo + fi done done }