Bläddra i källkod

Making mo files

Bob Mottram 9 år sedan
förälder
incheckning
830278caaf
1 ändrade filer med 9 tillägg och 2 borttagningar
  1. 9
    2
      translate

+ 9
- 2
translate Visa fil

@@ -90,10 +90,17 @@ function install_translations {
90 90
         do
91 91
             # convert json to mo
92 92
             if [ -f /usr/bin/i18next-conv ]; then
93
-                if [ -f locale/${lang}/${COMMAND_NAME}.json ]; then
94
-                    i18next-conv -l ${lang} -s locale/${lang}/${COMMAND_NAME}.json -t /usr/share/locale/${lang}/${COMMAND_NAME}.mo
93
+                if [ ! -f locale/${lang}/${COMMAND_NAME}.mo ]; then
94
+                    if [ -f locale/${lang}/${COMMAND_NAME}.json ]; then
95
+                        i18next-conv -l ${lang} -s locale/${lang}/${COMMAND_NAME}.json -t locale/${lang}/${COMMAND_NAME}.mo
96
+                    fi
95 97
                 fi
96 98
             fi
99
+
100
+            # install the mo
101
+            if [ -f locale/${lang}/${COMMAND_NAME}.mo ]; then
102
+                cp locale/${lang}/${COMMAND_NAME}.mo /usr/share/locale/${lang}/${COMMAND_NAME}.mo
103
+            fi
97 104
         done
98 105
     done
99 106
 }