Fixed problem with comments. po

This commit is contained in:
Alvaro Campos
2011-02-24 20:20:35 +00:00
parent a90f980306
commit 79d60939d4

View File

@@ -289,8 +289,26 @@ class languages {
throw new Exception('The .po file has not valid directives for Processmaker!'); throw new Exception('The .po file has not valid directives for Processmaker!');
} }
$identifier = $POFile->translatorComments[0]; foreach($POFile->translatorComments as $a=>$aux){
$context = $POFile->translatorComments[1]; $aux = trim($aux);
if ( $aux == 'TRANSLATION')
$identifier = $aux;
else {
$var = explode('/',$aux);
if ($var[0]=='LABEL')
$context = $aux;
if ($var[0]=='JAVASCRIPT')
$context = $aux;
}
if (preg_match('/^([a-zA-Z_-]+)\/([a-zA-Z_-]+\.xml\?)/', $aux, $match))
$identifier = $aux;
else{
if (preg_match('/^([a-zA-Z_-]+)\/([a-zA-Z_-]+\.xml$)/', $aux, $match))
$context = $aux;
}
}
//$identifier = $POFile->translatorComments[0];
//$context = $POFile->translatorComments[1];
$reference = $POFile->references[0]; $reference = $POFile->references[0];
if( $identifier == 'TRANSLATION') { if( $identifier == 'TRANSLATION') {