| @@ 144-148 (lines=5) @@ | ||
| 141 | ||
| 142 | // https://code.spip.net/@lang_typo |
|
| 143 | function lang_typo($lang = '') { |
|
| 144 | if (!$lang) { |
|
| 145 | $lang = isset($GLOBALS['lang_objet']) |
|
| 146 | ? $GLOBALS['lang_objet'] |
|
| 147 | : $GLOBALS['spip_lang']; |
|
| 148 | } |
|
| 149 | if ($lang == 'eo' |
|
| 150 | or $lang == 'fr' |
|
| 151 | or strncmp($lang, 'fr_', 3) == 0 |
|
| @@ 809-817 (lines=9) @@ | ||
| 806 | ||
| 807 | // On peut passer explicitement la langue dans le tableau |
|
| 808 | // On utilise le même nom de variable que la globale |
|
| 809 | if (isset($args['spip_lang'])) { |
|
| 810 | $lang = $args['spip_lang']; |
|
| 811 | // On l'enleve pour ne pas le passer au remplacement |
|
| 812 | unset($args['spip_lang']); |
|
| 813 | } // Sinon on prend la langue du contexte |
|
| 814 | else { |
|
| 815 | $lang = $GLOBALS['spip_lang']; |
|
| 816 | } |
|
| 817 | $text = $traduire($texte, $lang); |
|
| 818 | ||
| 819 | if (!strlen($text)) { |
|
| 820 | if (!$o['force']) { |
|