Merge pull request #2502 from Jennydmz/master

BUG_13887 Permite eliminacion del lenguaje actual.
This commit is contained in:
julceslauhub
2014-07-15 16:09:50 -04:00

View File

@@ -152,17 +152,25 @@ try {
$oContent = new Content(); $oContent = new Content();
$aRow = $oDataset->getRow(); $aRow = $oDataset->getRow();
//THERE IS NO ANY CASE STARTED FROM THES LANGUAGE if($locale != "en"){ //Default Lengage 'en'
if ($aRow[0] == 0) { //so we can delete this language if($locale != SYS_LANG){ //Current lenguage
try { //THERE IS NO ANY CASE STARTED FROM THES LANGUAGE
Content::removeLanguageContent( $locale ); if ($aRow[0] == 0) { //so we can delete this language
$trn->removeTranslationEnvironment( $locale ); try {
echo G::LoadTranslation( 'ID_LANGUAGE_DELETED_SUCCESSFULLY' ); Content::removeLanguageContent( $locale );
} catch (Exception $e) { $trn->removeTranslationEnvironment( $locale );
echo $e->getMessage(); echo G::LoadTranslation( 'ID_LANGUAGE_DELETED_SUCCESSFULLY' );
} } catch (Exception $e) {
echo $e->getMessage();
}
} else {
echo str_replace( '{0}', $aRow[0], G::LoadTranslation( 'ID_LANGUAGE_CANT_DELETE' ) );
}
} else {
echo str_replace( '{0}', $aRow[0], G::LoadTranslation( 'ID_LANGUAGE_CANT_DELETE_CURRENTLY' ) );
}
} else { } else {
echo str_replace( '{0}', $aRow[0], G::LoadTranslation( 'ID_LANGUAGE_CANT_DELETE' ) ); echo str_replace( '{0}', $aRow[0], G::LoadTranslation( 'ID_LANGUAGE_CANT_DELETE_DEFAULT' ) );
} }
break; break;
} }