Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 718 Bytes

README.md

File metadata and controls

33 lines (25 loc) · 718 Bytes

i18next-php

PHP class for basic i18next functionality.

Features

  • Support for variables
  • Support for basic plural forms
  • Support for basic sprintf

Usage

// init i18next instance
i18next::init('en');

// get translation by key
echo i18next::getTranslation('common.dog');

Methods

i18next::init( string $languageKey [, string $path = null ] );

Loads translation.json from given path.

i18next::init('en', 'my/path/');

mixed i18next::getTranslation( string $key [, array $variables = array() ] );

Returns translated string by key.

i18next::getTranslation('common.cat', array('count' => 2, 'lng' => 'fi'));