Skip to content

Instantly share code, notes, and snippets.

@alroniks
Created June 24, 2013 08:17
Show Gist options
  • Save alroniks/5848521 to your computer and use it in GitHub Desktop.
Save alroniks/5848521 to your computer and use it in GitHub Desktop.
<?php
$from = "en";
$to = "ru";
$_lang = [];
$dir = "/home/ik/dev2/revolution/core/lexicon/" . $from;
$files = scandir($dir);
foreach ($files as $file) {
if ($file != '..' and $file != '.') {
include_once $dir . '/' . $file;
}
}
$en = $_lang;
$_lang =[];
$dir = "/home/ik/dev2/revolution/core/lexicon/" . $to;
$files = scandir($dir);
foreach ($files as $file) {
if ($file != '..' and $file != '.') {
include_once $dir . '/' . $file;
}
}
$ru = $_lang;
$i = 1;
foreach ($en as $key => $value) {
if (!array_key_exists($key, $ru)) {
echo '0 [',$key,']', ' = ', $value, '
';
$i++;
} else {
if ($value == $ru[$key]) {
echo '1 [', $key, ']', ' = ', $value, '('.$ru[$key].')
';
$i++;
}
}
}
echo $i,'
';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment