/** * The function sets current locale. * * @static * @access public * @param string $locale The current locale. */ public static function set($locale) { if (!$locale) { $locale = 'en_US'; } return self::$locale = $locale; }
/** * Sets the locale for Lilina * * Loads the .mo file in LANGDIR constant path from Lilina root. * The translated (.mo) file is named based off of the locale. * * @param string $locale A language code like 'en' or 'en-us' or 'x-sneddy', will be lowercased */ public static function set($locale) { self::$locale = strtolower($locale); self::load('default', LILINA_PATH . LANGDIR . "/{$locale}.mo"); }
/** * @method set * @cat Catégorie dans laquelle appliquer les valeurs locales * @desc Appliquer les valeurs locales en fonctions de la langue du client */ public static function set($cat = LC_ALL) { self::$locale = setlocale($cat, self::$locales[self::getLangCode()]); return self::get(); }
public static function t($id, $parameters = [], $locale = null) { return Locale::locale()->trans($id, $parameters, $locale); }