2017 © Pedro Peláez
 

library i18n

I18n Component for messages internationalization of your application.

image

flextype-components/i18n

I18n Component for messages internationalization of your application.

  • Tuesday, July 10, 2018
  • by Awilum
  • Repository
  • 1 Watchers
  • 0 Stars
  • 86 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 62 % Grown

The README.md

I18n Component

version MIT License, (*1)

I18n Component for messages internationalization of your application., (*2)

Installation

composer require flextype-components/i18n

Usage

use Flextype\Component\I18n\I18n;

Add translation keys, (*3)

I18n::add(['auth_login' => 'Login', 'auth_password' => 'Password'], [],'en_US');

Returns translation of a string. If no translation exists, the original string will be returned. No parameters are replaced., (*4)

$translated_string = I18n::find('auth_login');

Global Translation/Internationalization function. Accepts an translation key and returns its translation for selected language. If the given translation key is not available in the current dictionary the translation key will be returned., (*5)

// Display a translated message
echo __('auth_login', 'auth');

// With parameter replacement
echo __('auth_welcome_message', [':username' => $username], 'en_US');

Set default locale, (*6)

I18n::$locale = 'en_US';

License

See LICENSE, (*7)

The Versions

10/07 2018

dev-master

9999999-dev https://github.com/flextype-components/i18n

I18n Component for messages internationalization of your application.

  Sources   Download

MIT

The Requires

  • php ^7.1.3

 

translation text i18n internationalization string

10/07 2018

v1.1.0

1.1.0.0 https://github.com/flextype-components/i18n

I18n Component for messages internationalization of your application.

  Sources   Download

MIT

The Requires

  • php ^7.1.3

 

translation text i18n internationalization string

13/05 2018

v1.0.1

1.0.1.0 https://github.com/flextype-components/i18n

I18n Component for messages internationalization of your application.

  Sources   Download

MIT

The Requires

  • php ^7.1.3

 

translation text i18n internationalization string

30/04 2018

v1.0.0

1.0.0.0 https://github.com/flextype-components/i18n

I18n Component for messages internationalization of your application.

  Sources   Download

MIT

The Requires

  • php ^7.1.3

 

translation text i18n internationalization string