Changeset 90095 in spip-zone
- Timestamp:
- Jun 10, 2015, 10:39:38 PM (6 years ago)
- Location:
- _plugins_/trad-lang/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/trad-lang/trunk/formulaires/tradlang_importer_langue.php
r90036 r90095 74 74 if(file_exists($dest_po)){ 75 75 lire_fichier($dest_po,$contenu_po); 76 preg_match_all(',(\#\, php-format|\#\, fuzzy\, php-format).*msgstr (.*)\#,Uims', $contenu_po,$matches);76 preg_match_all(',(\#\, php-format|\#\, fuzzy\, php-format).*msgstr "(.*)\n(\n|\Z),Uims', $contenu_po,$matches); 77 77 $array_po = array(); 78 78 foreach($matches[0] as $match){ 79 79 $statut = "OK"; 80 preg_match(',\#\| msgid \"(.*)\"\n,Uims',$match,$matches); 81 preg_match(',msgstr \"(.*)\n\#,Uims',$match,$matches_str); 80 preg_match(',msgstr \"(.*)\n(\n|\Z),Uims',$match,$matches_str); 82 81 $str = rtrim(trim($matches_str[1]),'"'); 83 82 $str = trim(str_replace("\"\n\"","\n",$str)); 83 preg_match(',\#\| msgid \"(.*)\"\n,Uims',$match,$matches); 84 if(!isset($matches[1]) || $matches[1] == ''){ 85 preg_match(',\nmsgid \"(.*)\nmsgstr,Uims',$match,$matches_str_orig); 86 $str_orig = rtrim(trim($matches_str_orig[1]),'"'); 87 $str_orig = trim(str_replace("\"\n\"","",$str_orig)); 88 $matches[1] = sql_getfetsel('id','spip_tradlangs','id_tradlang_module='.intval($id_tradlang_module)." AND str=".sql_quote($str_orig)); 89 } 84 90 if(preg_match(',\#\, fuzzy\, php-format,',$match,$matches_statut)) 85 91 $statut = "MODIF"; 86 92 if($str != '') 87 $array_po[$matches[1]] = array('str'=>$str, 'statut'=>$statut);93 $array_po[$matches[1]] = array('str'=>$str, 'statut'=>$statut); 88 94 } 89 95 $modifs = array(); … … 192 198 else{ 193 199 lire_fichier($dest,$contenu_po); 194 preg_match_all(',(\#\, php-format|\#\, fuzzy\, php-format).*msgstr (.*)\#,Uims', $contenu_po,$matches);200 preg_match_all(',(\#\, php-format|\#\, fuzzy\, php-format).*msgstr "(.*)\n(\n|\Z),Uims', $contenu_po,$matches); 195 201 $array_po = array(); 196 202 foreach($matches[0] as $match){ 197 203 $statut = "OK"; 198 preg_match(',\#\| msgid \"(.*)\"\n,Uims',$match,$matches); 199 preg_match(',msgstr \"(.*)\n\#,Uims',$match,$matches_str); 204 preg_match(',msgstr \"(.*)\n(\n|\Z),Uims',$match,$matches_str); 200 205 $str = rtrim(trim($matches_str[1]),'"'); 201 206 $str = trim(str_replace("\"\n\"","\n",$str)); 207 preg_match(',\#\| msgid \"(.*)\"\n,Uims',$match,$matches); 208 if(!isset($matches[1]) || $matches[1] == ''){ 209 preg_match(',\nmsgid \"(.*)\nmsgstr,Uims',$match,$matches_str_orig); 210 $str_orig = rtrim(trim($matches_str_orig[1]),'"'); 211 $str_orig = trim(str_replace("\"\n\"","",$str_orig)); 212 $matches[1] = sql_getfetsel('id','spip_tradlangs','id_tradlang_module='.intval($id_tradlang_module)." AND str=".sql_quote($str_orig)); 213 } 202 214 if(preg_match(',\#\, fuzzy\, php-format,',$match,$matches_statut)) 203 215 $statut = "MODIF"; 204 216 if($str != '') 205 $array_po[$matches[1]] = array('str'=>$str, 'statut'=>$statut);217 $array_po[$matches[1]] = array('str'=>$str, 'statut'=>$statut); 206 218 } 207 219 $langues_base = sql_allfetsel('id,str,statut','spip_tradlangs','id_tradlang_module='.intval($id_tradlang_module).' AND lang='.sql_quote($lang)); … … 227 239 $erreurs['fichier_langue'] = _T('tradlang:erreur_upload_aucune_modif'); 228 240 } 229 spip_log($modifs,'test.'._LOG_ERREUR);230 241 return $erreurs; 231 242 } … … 264 275 if(!count($modifs)) 265 276 $erreurs['message_erreur'] = _T('tradlang:erreur_upload_choisir_une'); 266 spip_log($modifs,'test.'._LOG_ERREUR);267 277 return $erreurs; 268 278 } … … 325 335 else if(file_exists($dest = $dir_lang.$fichier_po)){ 326 336 lire_fichier($dest,$contenu_po); 327 preg_match_all(',(\#\, php-format|\#\, fuzzy\, php-format).*msgstr (.*)\#,Uims', $contenu_po,$matches);337 preg_match_all(',(\#\, php-format|\#\, fuzzy\, php-format).*msgstr "(.*)\n(\n|\Z),Uims', $contenu_po,$matches); 328 338 $array_po = array(); 329 339 foreach($matches[0] as $match){ 330 340 $statut = "OK"; 331 preg_match(',\#\| msgid \"(.*)\"\n,Uims',$match,$matches); 332 preg_match(',msgstr \"(.*)\n\#,Uims',$match,$matches_str); 341 preg_match(',msgstr \"(.*)\n(\n|\Z),Uims',$match,$matches_str); 333 342 $str = rtrim(trim($matches_str[1]),'"'); 334 343 $str = trim(str_replace("\"\n\"","\n",$str)); 335 if(preg_match(',\#\, fuzzy\, php-format,',$match,$matches_statut)){ 344 preg_match(',\#\| msgid \"(.*)\"\n,Uims',$match,$matches); 345 if(!isset($matches[1]) || $matches[1] == ''){ 346 preg_match(',\nmsgid \"(.*)\nmsgstr,Uims',$match,$matches_str_orig); 347 $str_orig = rtrim(trim($matches_str_orig[1]),'"'); 348 $str_orig = trim(str_replace("\"\n\"","",$str_orig)); 349 $matches[1] = sql_getfetsel('id','spip_tradlangs','id_tradlang_module='.intval($id_tradlang_module)." AND str=".sql_quote($str_orig)); 350 } 351 if(preg_match(',\#\, fuzzy\, php-format,',$match,$matches_statut)) 336 352 $statut = "MODIF"; 337 }338 353 if($str != '') 339 $array_po[$matches[1]] = array('str'=>$str, 'statut'=>$statut);354 $array_po[$matches[1]] = array('str'=>$str, 'statut'=>$statut); 340 355 } 341 356 -
_plugins_/trad-lang/trunk/paquet.xml
r89637 r90095 2 2 prefix="tradlang" 3 3 categorie="outil" 4 version="2.4. 1"4 version="2.4.2" 5 5 etat="stable" 6 6 compatibilite="[3.0.0;3.1.*]"
Note: See TracChangeset
for help on using the changeset viewer.