ice framework documentation ice doc v1.10.1
Methods
  • __construct(array $options) : void
    I18n constructor.
  • fetch() : void
    Return the last I18n created.
  • lang(string $lang) : string
    Get and set the target language.
  • iso(variable $lang, bool $country) : string
    Get ISO language code.
  • get(string $str, variable $form, string $lang) : string
    Returns specified form of a string translation. No parameters are replaced.
  • load(string $lang) : array
    Load language from the file.
  • plural(string $str, int $count, string $lang) : void
    Returns translation of a string with right plural form.
  • pluralRules(string $code) : void
    Plural rules lazy initialization.
  • _(string $str, array $values, variable $context, string $lang) : string
    Alias of translate.
  • translate(string $str, array $values, variable $context, string $lang) : string
    Translation/internationalization function. strtr() or sprintf is used for replacing parameters.
Methods Details
  • public function __construct(array $options)

    I18n constructor.
  • public static function fetch()

    Return the last I18n created.
  • public function lang(string $lang)

    Get and set the target language.
  • public function iso(variable $lang, bool $country)

    Get ISO language code.
  • public function get(string $str, variable $form, string $lang)

    Returns specified form of a string translation. No parameters are replaced.
    If no translation exists, the original string will be returned.
  • private function load(string $lang)

    Load language from the file.
  • public function plural(string $str, int $count, string $lang)

    Returns translation of a string with right plural form.
    If no translation exists, the original string will be returned.
  • protected function pluralRules(string $code)

    Plural rules lazy initialization.
  • public function _(string $str, array $values, variable $context, string $lang)

    Alias of translate.
  • public function translate(string $str, array $values, variable $context, string $lang)

    Translation/internationalization function. strtr() or sprintf is used for replacing parameters.
  • internal function zephir_init_properties_Ice_I18n()