0013324: create mo files for extra translations during build
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 10 Jul 2017 10:18:28 +0000 (12:18 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 10 Jul 2017 11:23:06 +0000 (13:23 +0200)
https://forge.tine20.org/view.php?id=13324

Change-Id: I11405cfb90c1caf0fa2a3de2b2609315e1038ac2
Reviewed-on: http://gerrit.tine20.com/customers/5068
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Jenkins CI (http://ci.tine20.com/)
tine20/build.xml

index 21532e0..0432802 100644 (file)
                 }
 
                 foreach (Tinebase_Translation::getTranslationDirs() as $appName => $translationPath) {
+                    // TODO do this for all apps??
+                    /*
+                    if ($this->appName !== $appName) {
+                        continue;
+                    }
+                    */
                     foreach (scandir($translationPath) as $poFile) {
                         if (substr($poFile, -3) == '.po') {
                             $langName = substr($poFile, 0, -3);
                             `cd "$translationPath"
                             msgfmt -o $langName.mo $poFile`;
+                        } else if (substr($poFile, -5) == 'extra') {
+                            // TODO improve detection of files/directories
+                            $extraTranslationPath = $translationPath . '/extra';
+                            foreach (scandir($extraTranslationPath) as $app) {
+                                foreach (scandir($extraTranslationPath . '/' . $app) as $extraPoFile) {
+                                    if (substr($extraPoFile, -3) == '.po') {
+                                        $langName = substr($extraPoFile, 0, -3);
+                                        `cd "$extraTranslationPath/$app"
+                                        msgfmt -o $langName.mo $extraPoFile`;
+                                    }
+                                }
+                            }
                         }
                     }
                 }