Statistics
3
1
0
164d
Badges
Dependencies

Localization

Simple Translator for Nette Framework

Requirements

Installation

Install with Composer:

$ composer require zahy/localization

Register extension:

extensions:
	localization: '\ZahyCZ\Localization\DI\Extension'

Configuration:

localization:
  languages: ['cs', 'en']
  locPath: '/../localization'
  storageName: 'ZahyCZ.Localization'

Localization files example:

Example:
	cs: Příklad
	en: Example

Example file name: loc.example.neon

Using

Inject Service:

/**
* Translator
* @var Nette\Localization\ITranslator @inject
*/
public $translator;

Using in PHP:

$this->translator->translate('Example', ['text']);

Using in Latte:

{_'Example', ['text']}

Is this addon outdated? Did you find an issue? Please report it.

Componette Componette admin@componette.com