IMPROVEMENT in cache languages files for plugins

This commit is contained in:
Julio Cesar Laura
2014-08-28 14:20:42 -04:00
parent 0908dcebe0
commit e6deb9a9ce

View File

@@ -288,7 +288,12 @@ class Translation extends BaseTranslation
}
if (!file_exists(PATH_PLUGINS . $plugin . PATH_SEP . 'translations' . PATH_SEP . $plugin . '.' . $languageId . '.po')) {
return;
if (!file_exists(PATH_PLUGINS . $plugin . PATH_SEP . 'translations' . PATH_SEP . $plugin . '.en.po')) {
return;
}
$languageFile = PATH_PLUGINS . $plugin . PATH_SEP . 'translations' . PATH_SEP . $plugin . '.en.po' ;
} else {
$languageFile = PATH_PLUGINS . $plugin . PATH_SEP . 'translations' . PATH_SEP . $plugin . '.' . $languageId . '.po' ;
}
$translation = Array ();
$translationJS = Array ();
@@ -304,7 +309,7 @@ class Translation extends BaseTranslation
foreach ($translations as $key => $row) {
$translation[$key] = $row;
}
$languageFile = PATH_PLUGINS . $plugin . PATH_SEP . 'translations' . PATH_SEP . $plugin . '.' . $languageId . '.po' ;
G::LoadSystem( 'i18n_po' );
$POFile = new i18n_PO( $languageFile );
$POFile->readInit();