evolution-cms / evolution

Welcome to the new evolution of MODX Evolution!
GNU General Public License v3.0
260 stars 95 forks source link

Translation synchronization with English #853

Open AgelxNash opened 5 years ago

AgelxNash commented 5 years ago

I think, the translations that nobody synchronization we should be deleted.

Translations checks via script

<?php
$paths = [
    'manager/includes/lang/',
    'install/lang/',
    'manager/includes/lang/errormsg/'
];
$lang = 'russian-UTF8';

foreach ($paths as $path) {
    print $path . PHP_EOL;
    $main = $path . 'english.inc.php';

    include_once $main;
    $mainLang = array_keys($_lang);
    unset($_lang);

    $new = array();

    $files = glob($path . $lang . '.inc.php');

    if (empty($files)) {
        print "\t" . 'File not found: ' . $path . $lang . '.inc.php' . PHP_EOL;
    } else {
        foreach ($files as $file) {
            if ($file !== $main) {
                if (stripos(php_strip_whitespace($file), 'eval(\'?>\' . $contents);') !== false) {
                    continue;
                }
                include_once $file;
                $new[] = array_diff(array_keys($_lang), $mainLang);
                $notTranslate = array_diff($mainLang, array_keys($_lang));
                if (!empty($notTranslate)) {
                    $name = basename($file, '.inc.php');
                    print "\t" . $name . ' => ' . count($notTranslate) . PHP_EOL . implode(
                            PHP_EOL,
                            array_map(function ($val) {
                                return "\t\t" . $val;
                            }, $notTranslate)
                        ) . PHP_EOL;
                }
                unset($_lang, $notTranslate);
            }
        }
    }
    $new = array_unique(array_reduce($new, function ($acc, $item) {
        return array_merge($acc, is_array($item) ? $item : [$item]);
    }, []));

    if (!empty($new)) {
        print_r($new);
    }
    unset($mainLang, $new, $files);
}
Nicola1971 commented 5 years ago

have we abandoned transifex?

Nicola1971 commented 5 years ago

Note: on transfex, some language are more up to date than on github (using your script i found just 8 missing strings in italian language). screenshot-www transifex com-2018 11 02-19-48-14

I have updated Italian Language for missing strings and pulled

Nicola1971 commented 5 years ago

For https://github.com/evolution-cms/evolution/issues/859 German from transifex + https://github.com/evolution-cms/evolution/commit/e5da5675ce0687d2b11c3a4d9052381f312c777e

Missing only 6 strings

@Deesen

german.inc.zip

risingisland commented 5 years ago

Question, are both "spanish-utf8.inc.php" & "spanish.inc.php" files really necessary?

I see many langs using two files, one redirecting to the other. Seems like we could just replace the the content of ".inc.php" with its "-utf8.php" counterpart and drop several un-needed files from the langs folder.

Updated Spanish lang: spanish-utf8.inc.php.zip

AgelxNash commented 5 years ago

I also think that files with recoding should be deleted. UTF-8 should be standard