php - php intl参数格式化不适用于yii2
问题描述
我用过https://www.yiiframework.com/doc/guide/2.0/en/tutorial-i18n#parameter-formatting
但在我的服务器上,它显示为一个完整的字符串,没有任何国际影响。
我的代码是这样的:
echo \Yii::t('app', 'There {n,plural,=0{are no cats} =1{is one cat} other{are # cats}}!', ['n' => $n]);
预期结果:
// When $n = 0, it may produce "There are no cats!"
// When $n = 1, it may produce "There is one cat!"
// When $n = 42, it may produce "There are 42 cats!"
但它在这里显示整个表达式而没有任何效果
解决方案
推荐阅读
- php - PHP - 转换数组多维键
- c - 如何在 Clang 中使用 WebAssembly 引用类型
- reactjs - 在 React/Material ui 路由中设置默认活动选项卡
- jackson - 如何防止杰克逊序列化/反序列化 POJO?
- node.js - 如何创建 API 密钥系统并在 Node js 和 express 中的受保护路由中使用它
- html - 我的 css 不工作,但没有错误
- c - 基本 C - 切换案例重复
- python - Pandas:基于匹配多级列条件的新列值
- vue.js - 如何从 vue 中的路由参数传入子组件内的更多数据值?
- kubernetes - 豆荚从同一持久卷中读取输入文件的正确方法?