paliari/php-i18n

Installs: 3 321

Dependents: 1

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/paliari/php-i18n

1.2.0 2019-05-21 16:38 UTC

This package is auto-updated.

Last update: 2025-09-22 07:53:23 UTC


README

Installation

$ composer require paliari/php-i18n

Configuration

Create your yml locale files inside some folder in your project. See the yml file example:

pt-BR:
  hello: Olá I18n
  user:
    name: Nome do usuário
  errors:
    messages:
      unauthorized: Não autorizado

You can use multiple languages and multiple files for each language, ex:

  • pt-BR.yml
  • models.pt-BR.yml
  • errors.pt-BR.yml
  • en.yml
  • models.en.yml
  • errors.en.yml

Say to the plugin where this files were placed

\Paliari\I18n::instance()->addLocalesPath(__DIR__ . '/config/locales')->setCurrentLocale('pt-BR');

Usage

Paliari\I18n::instance()->hum('hello');

Authors