nedryse / simple-translator
Simple implementation of \Nette\Localization\ITranslator interface. Just print the key as is. Usefull when you have no time for managing gettext translation but want translatable application in the future.
Installs: 3 750
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.1
- nedryse/translateable-template-factory: ~1.1
- nette/di: ~2.4
- nette/utils: ~2.4
Requires (Dev)
- phpunit/phpunit: 4.3.*
This package is not auto-updated.
Last update: 2022-06-28 09:14:15 UTC
README
#nedryse/simple-translator (cc)# Pavel Železný (2bfree), 2014 (pavelzelezny.cz)
Requirements
Nette Framework 2.4.0 or higher
Documentation
Simple implementation of \Nette\Localization\ITranslator interface. Just print the key as is. Usefull when you have no time for managing gettext translation but want translatable application in the future.
Instalation
Prefered way to install is by Composer
composer require nedryse/simple-translator:~1.1
Or by manualy adding into the composer.json
{
"require":{
"nedryse/simple-translator": "~1.1"
}
}
Setup
Add following code into the config.neon
common:
extensions:
translator: Nedryse\Nette\Localization\SimpleTranslatorExtension
Usage
In Latte templates of presenters and components you can use standard tlanslator macro
{_'Translatable text'}
{_'We have %d translatable text', $count}
{_'Field %s have to be translated', $fieldName}
{_'Field %s with %d letter have to be translated', $fieldName, $count}