| @@ 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 |
|
| @@ 837-845 (lines=9) @@ | ||
| 834 | ||
| 835 | // On peut passer explicitement la langue dans le tableau |
|
| 836 | // On utilise le même nom de variable que la globale |
|
| 837 | if (isset($args['spip_lang'])) { |
|
| 838 | $lang = $args['spip_lang']; |
|
| 839 | // On l'enleve pour ne pas le passer au remplacement |
|
| 840 | unset($args['spip_lang']); |
|
| 841 | } // Sinon on prend la langue du contexte |
|
| 842 | else { |
|
| 843 | $lang = $GLOBALS['spip_lang']; |
|
| 844 | } |
|
| 845 | $text = $traduire($texte, $lang); |
|
| 846 | ||
| 847 | if (!strlen($text)) { |
|
| 848 | if (!$o['force']) { |
|