Translator 1.0.0 and related packages
2021-05-13
1384次浏览
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
- redis
- apidoc
- Yii 2.0
- Yii 1.1
- mongodb
- mailer
- extensions
- gii
- twig
- queue
- runner
- http 客户端
- console
- validation
- sphinx
- cache
- widget
- translator
- hydrator
- error handler
- db
- symfonymailer
- log
- http
- config
- assets
- swiftmailer
- 图书
- imagine
- csrf
- elasticsearch
- swagger
- IDE
- i18n
- router
- definitions
- fastroute
- logging
- smarty
- user