| @@ 153-157 (lines=5) @@ | ||
| 150 | ||
| 151 | // https://code.spip.net/@lang_typo |
|
| 152 | function lang_typo($lang = '') { |
|
| 153 | if (!$lang) { |
|
| 154 | $lang = isset($GLOBALS['lang_objet']) |
|
| 155 | ? $GLOBALS['lang_objet'] |
|
| 156 | : $GLOBALS['spip_lang']; |
|
| 157 | } |
|
| 158 | if ($lang == 'eo' |
|
| 159 | or $lang == 'fr' |
|
| 160 | or strncmp($lang, 'fr_', 3) == 0 |
|
| @@ 841-849 (lines=9) @@ | ||
| 838 | ||
| 839 | // On peut passer explicitement la langue dans le tableau |
|
| 840 | // On utilise le même nom de variable que la globale |
|
| 841 | if (isset($args['spip_lang'])) { |
|
| 842 | $lang = $args['spip_lang']; |
|
| 843 | // On l'enleve pour ne pas le passer au remplacement |
|
| 844 | unset($args['spip_lang']); |
|
| 845 | } // Sinon on prend la langue du contexte |
|
| 846 | else { |
|
| 847 | $lang = $GLOBALS['spip_lang']; |
|
| 848 | } |
|
| 849 | $text = $traduire($texte, $lang); |
|
| 850 | ||
| 851 | if (!strlen($text)) { |
|
| 852 | if (!$o['force']) { |
|