BUG 9902 Error uploading a new language in Zend ServerSOLVED

- Not loaded correctly.
- scans all languages.
This commit is contained in:
Marco Antonio Nina
2012-10-10 17:07:14 -04:00
parent fc1fd9bf3d
commit 8eec1347dd
4 changed files with 68 additions and 41 deletions

View File

@@ -261,25 +261,34 @@ class Translation extends BaseTranslation {
file_put_contents($filePath, serialize($environments));
}
function removeTranslationEnvironment($locale)
{
$filePath = $this->envFilePath;
if( strpos($locale, self::$localeSeparator) !== false ) {
list($LAN_ID, $IC_UID) = explode('-', strtoupper($locale));
} else {
$LAN_ID = $locale;
$IC_UID = '__INTERNATIONAL__';
}
function removeTranslationEnvironment($locale)
{
$filePath = $this->envFilePath;
if (strpos($locale, self::$localeSeparator) !== false) {
list($LAN_ID, $IC_UID) = explode('-', strtoupper($locale));
} else {
$LAN_ID = $locale;
$IC_UID = '__INTERNATIONAL__';
}
if( file_exists($filePath) ) {
$environments = unserialize(file_get_contents($filePath));
if( ! isset($environments[$LAN_ID][$IC_UID]) )
return NULL;
unset($environments[$LAN_ID][$IC_UID]);
file_put_contents($filePath, serialize($environments));
if (file_exists($filePath)) {
$environments = unserialize(file_get_contents($filePath));
if (!isset($environments[$LAN_ID][$IC_UID])) {
return NULL;
}
unset($environments[$LAN_ID][$IC_UID]);
file_put_contents($filePath, serialize($environments));
if (file_exists(PATH_CORE . "META-INF" . PATH_SEP . "translation.".$locale)) {
G::rm_dir(PATH_DATA . "META-INF" . PATH_SEP . "translation.".$locale);
}
if (file_exists(PATH_CORE . '/content/translations/processmaker.'.$locale.'.po')) {
G::rm_dir(PATH_CORE . '/content/translations/processmaker.'.$locale.'.po');
}
}
}
}
function getTranslationEnvironments(){
$filePath = $this->envFilePath;