Completed
Pull Request — master (#39)
by
unknown
09:06
created
ecrire/inc/traduire.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	static $dirs = array();
42 42
 	$liste = array();
43 43
 	foreach (creer_chemin() as $dir) {
44
-		if (!isset($dirs[$a = $dir . $dirname])) {
44
+		if (!isset($dirs[$a = $dir.$dirname])) {
45 45
 			$dirs[$a] = (is_dir($a) || !$a);
46 46
 		}
47 47
 		if ($dirs[$a]) {
@@ -67,20 +67,20 @@  discard block
 block discarded – undo
67 67
  **/
68 68
 function chercher_module_lang($module, $lang = '') {
69 69
 	if ($lang) {
70
-		$lang = '_' . $lang;
70
+		$lang = '_'.$lang;
71 71
 	}
72 72
 
73 73
 	// 1) dans un repertoire nomme lang/ se trouvant sur le chemin
74 74
 	if ($f = ($module == 'local'
75
-		? find_in_path($module . $lang . '.php', 'lang/')
76
-		: find_langs_in_path($module . $lang . '.php', 'lang/'))
75
+		? find_in_path($module.$lang.'.php', 'lang/')
76
+		: find_langs_in_path($module.$lang.'.php', 'lang/'))
77 77
 	) {
78 78
 		return is_array($f) ? $f : array($f);
79 79
 	}
80 80
 
81 81
 	// 2) directement dans le chemin (old style, uniquement pour local)
82 82
 	return (($module == 'local') or strpos($module, '/'))
83
-		? (($f = find_in_path($module . $lang . '.php')) ? array($f) : false)
83
+		? (($f = find_in_path($module.$lang.'.php')) ? array($f) : false)
84 84
 		: false;
85 85
 }
86 86
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
  **/
105 105
 function charger_langue($lang, $module = 'spip') {
106 106
 	static $langs = array();
107
-	$var = 'i18n_' . $module . '_' . $lang;
107
+	$var = 'i18n_'.$module.'_'.$lang;
108 108
 	if (!isset($langs[$lang])) {
109 109
 		$langs[$lang] = array();
110 110
 		if ($lang) {
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
 	}
120 120
 	foreach ($langs[$lang] as $l) {
121 121
 		if ($fichiers_lang = chercher_module_lang($module, $l)) {
122
-			$GLOBALS['idx_lang'] = 'i18n_' . $module . '_' . $l;
122
+			$GLOBALS['idx_lang'] = 'i18n_'.$module.'_'.$l;
123 123
 			include(array_shift($fichiers_lang));
124 124
 			surcharger_langue($fichiers_lang);
125 125
 			if ($l !== $lang) {
126
-				$GLOBALS[$var] = &$GLOBALS['i18n_' . $module . '_' . $l];
126
+				$GLOBALS[$var] = &$GLOBALS['i18n_'.$module.'_'.$l];
127 127
 			}
128
-			$GLOBALS['lang_' . $var] = $l;
128
+			$GLOBALS['lang_'.$var] = $l;
129 129
 			#spip_log("module de langue : ${module}_$l.php", 'traduire');
130 130
 			break;
131 131
 		}
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	foreach ($fichiers as $fichier) {
164 164
 		if (!isset($surcharges[$fichier])) {
165 165
 			$idx_lang_normal = $GLOBALS['idx_lang'];
166
-			$GLOBALS['idx_lang'] = $GLOBALS['idx_lang'] . '@temporaire';
166
+			$GLOBALS['idx_lang'] = $GLOBALS['idx_lang'].'@temporaire';
167 167
 			include($fichier);
168 168
 			$surcharges[$fichier] = $GLOBALS[$GLOBALS['idx_lang']];
169 169
 			unset($GLOBALS[$GLOBALS['idx_lang']]);
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		}
172 172
 		if (is_array($surcharges[$fichier])) {
173 173
 			$GLOBALS[$GLOBALS['idx_lang']] = array_merge(
174
-				(isset($GLOBALS[$GLOBALS['idx_lang']]) ? (array)$GLOBALS[$GLOBALS['idx_lang']] : array()),
174
+				(isset($GLOBALS[$GLOBALS['idx_lang']]) ? (array) $GLOBALS[$GLOBALS['idx_lang']] : array()),
175 175
 				$surcharges[$fichier]
176 176
 			);
177 177
 		}
@@ -249,27 +249,27 @@  discard block
 block discarded – undo
249 249
 	} else {
250 250
 		$modules = array('spip', 'ecrire');
251 251
 		$code = $ori;
252
-		$ori_complet = implode('|', $modules) . ':' . $ori;
252
+		$ori_complet = implode('|', $modules).':'.$ori;
253 253
 	}
254 254
 
255 255
 	$desc = new SPIP_Traductions_Description();
256 256
 
257 257
 	// parcourir tous les modules jusqu'a ce qu'on trouve
258 258
 	foreach ($modules as $module) {
259
-		$var = "i18n_" . $module . "_" . $lang;
259
+		$var = "i18n_".$module."_".$lang;
260 260
 
261 261
 		if (empty($GLOBALS[$var])) {
262 262
 			charger_langue($lang, $module);
263 263
 			// surcharges persos -- on cherche
264 264
 			// (lang/)local_xx.php et/ou (lang/)local.php ...
265
-			if (!isset($local['local_' . $lang])) {
265
+			if (!isset($local['local_'.$lang])) {
266 266
 				// redéfinir la langue en cours pour les surcharges (chercher_langue a pu le changer)
267 267
 				$GLOBALS['idx_lang'] = $var;
268 268
 				// ... (lang/)local_xx.php
269
-				$local['local_' . $lang] = chercher_module_lang('local', $lang);
269
+				$local['local_'.$lang] = chercher_module_lang('local', $lang);
270 270
 			}
271
-			if ($local['local_' . $lang]) {
272
-				surcharger_langue($local['local_' . $lang]);
271
+			if ($local['local_'.$lang]) {
272
+				surcharger_langue($local['local_'.$lang]);
273 273
 			}
274 274
 			// ... puis (lang/)local.php
275 275
 			if (!isset($local['local'])) {
@@ -283,8 +283,8 @@  discard block
 block discarded – undo
283 283
 		if (isset($GLOBALS[$var][$code])) {
284 284
 			$desc->code = $code;
285 285
 			$desc->module = $module;
286
-			if (isset($GLOBALS['lang_' . $var]))
287
-				$desc->langue = $GLOBALS['lang_' . $var];
286
+			if (isset($GLOBALS['lang_'.$var]))
287
+				$desc->langue = $GLOBALS['lang_'.$var];
288 288
 			$desc->texte = $GLOBALS[$var][$code];
289 289
 			break;
290 290
 		}
@@ -338,11 +338,11 @@  discard block
 block discarded – undo
338 338
 	if (!$desc->mode and $desc->texte) {
339 339
 		// ne pas modifier 2 fois l'affichage
340 340
 		$desc->mode = 'traduction';
341
-		$classe = 'debug-traduction' . ($desc->module == 'ecrire' ? '-prive' : '');
341
+		$classe = 'debug-traduction'.($desc->module == 'ecrire' ? '-prive' : '');
342 342
 		$desc->texte = '<span '
343
-			. 'lang=' . $desc->langue
344
-			. ' class=' . $classe
345
-			. ' title=' . $modules . '(' . $desc->langue . ')>'
343
+			. 'lang='.$desc->langue
344
+			. ' class='.$classe
345
+			. ' title='.$modules.'('.$desc->langue.')>'
346 346
 			. $desc->texte
347 347
 			. '</span>';
348 348
 		$desc->texte = str_replace(
Please login to merge, or discard this patch.