Translator 1.0.0 and related packages
2021-05-13
1743次浏览
First release of translator package was published. This package allows translating messages into several languages. It can work with both Yii-based applications and standalone PHP applications.
Translations in the code looks like the following:
// single translation
$messageIdentificator = 'submit';
echo $translator->translate($messageIdentificator);
// output: `Submit message`
// translation with plural
$messageIdentificator = 'multiHumans';
echo $translator->translate($messageIdentificator, ['n' => 3]);
// output: `3 humans
Mutliple messages sources and formatters were released as well:
Additional packages that are pretty stable but not released yet are database message source and console command for extracting message IDs from the source code.
新闻归档
热门标签
- yii3
- 扩展
- 发布
- yii2
- debug
- view
- auth client
- html
- bootstrap
- release
- mongodb
- redis
- apidoc
- Yii 1.1
- validation
- Yii 2.0
- http
- runner
- extensions
- console
- error handler
- gii
- mailer
- cache
- http 客户端
- queue
- twig
- hydrator
- translator
- widget
- sphinx
- router
- log
- symfonymailer
- assets
- config
- db
- swagger
- middleware
- imagine
- elasticsearch
- 图书
- swiftmailer
- widgets
- definitions
- i18n
- IDE
- fastroute
- csrf
- user