function updateTranslations($themeDir)
{
    $newTranslations = getTranslations($themeDir);
    if (empty($newTranslations)) {
        return;
    }
    $translations = includeLanguageFiles($themeDir);
    foreach ($newTranslations as $key => $newTranslation) {
        if (is_array($newTranslation)) {
            addTranslation($translations, $key, $newTranslation);
        } elseif ($newTranslation === '[DELETED]') {
            removeTranslation($translations, $key);
        } else {
            throw new Exception('Wrong translation file' . print_r($translations, true));
        }
    }
    if (!empty($translations)) {
        rebuildTranslations($themeDir, $translations);
    }
}
Ejemplo n.º 2
0
        $("#item_Container").animate({left: '34%', opacity: '1', fontSize: "120%", height: "240px", width: "420px"}, a);
    }

    //Karte nach rechts bewegen
    function moveRight(a) {
        $("#item_Container").animate({left: '50%', opacity: '0', fontSize: "100%", height: "200px", width: "350px"}, a);
    }

    //Ich will alle Karten die in der Session stehen
    function getCards() {
<?php 
session_start();
//Start the Session
?>
        solutions = <?php 
echo json_encode(getTranslations());
?>
;
        texts = <?php 
echo json_encode(getTexts());
?>
;
    }
    function showSolution() {
        //Zeige die Lösung zu einer Karte (=Karte drehen)
        $("#item_Container").animate({opacity: '0'}, "middle");
        $("#item_Container").promise().done(function () {
            //Wait until card ist done turning
            //Then change text
            if (!isShownSolution) {
                document.getElementById("item").innerHTML = solutions[aktuell - 1];
*  This module is based on the Collaborative Moodle Modules from
*  NCSA Education Division (http://www.ncsa.uiuc.edu)
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
';
foreach ($langPaths as $langPath) {
    $strings = getTranslations($langPath);
    echo 'now: ' . $langPath . "<br />\n";
    $fileContent = $fileStart;
    foreach ($translationGroups as $group) {
        $fileContent .= "\n// " . $group['name'] . "\n";
        foreach ($group['strings'] as $groupString) {
            $fileContent .= '$string[\'' . $groupString . '\'] = ' . var_export($strings[$groupString], true) . ";\n";
            unset($strings[$groupString]);
        }
    }
    if ($strings) {
        $fileContent .= "\n// " . 'Not Used Anymore' . "\n";
        foreach ($strings as $key => $value) {
            if (!$value) {
                continue;
            }
Ejemplo n.º 4
0
    $contents = file_get_contents($file);
    echo "{$file}:\n";
    $contents = str_replace('_QQ_', '"\\""', $contents);
    $strings = parse_ini_string($contents);
    if ($strings === false) {
        echo "ERROR!\n";
        continue;
    }
    foreach ($strings as $key => $str) {
        if (preg_match('/[^A-Z0-9_\\.]+/u', $key)) {
            echo "ERROR: {$key}!\n";
        }
        //if (preg_match('/"/u', $str)) echo "ERROR: $key=\"$str\"\n";
    }
}
$files = getTranslations('components/com_kunena/language');
foreach ($files as $file) {
    $contents = file_get_contents($file);
    echo "{$file}:\n";
    $contents = str_replace('_QQ_', '"\\""', $contents);
    $strings = parse_ini_string($contents);
    if ($strings === false) {
        echo "ERROR!\n";
        continue;
    }
    foreach ($strings as $key => $str) {
        if (preg_match('/[^A-Z0-9_]+/u', $key)) {
            echo "ERROR: {$key}!\n";
        }
        //if (preg_match('/"/u', $str)) echo "ERROR: $key=\"$str\"\n";
    }
Ejemplo n.º 5
0
<?php

include "functions.php";
//print_r($_GET);
//$languages=array();
if (!isset($_GET['languages'])) {
    $languages = array();
} else {
    $languages = split(',', $_GET['languages']);
}
$first = isset($_POST['start']) ? $_POST['start'] : 0;
$count = isset($_POST['limit']) ? $_POST['limit'] : 25;
$content = getTranslations($languages, $first, $count);
$langKey = $content["translations"];
$results = $content["results"];
foreach ($langKey as $k => $v) {
    $langKey[$k]['key'] = $k;
}
echo "{'results': {$results} , 'rows': [\n";
$i = 0;
foreach ($langKey as $key => $translations) {
    echo "  " . ($i++ > 0 ? "," : "") . json_encode($translations);
}
echo "]}";