kohana 语言资源国际化、本地化
2024-10-07 09:08:02
语言配置开关:
root@DESKTOP-I4OIMJC /cygdrive/e/html/tproject/framebota/platform
# grep -n2 'I18n::lang' bootstrap.php
76- * Set the default language
77- */
78:I18n::lang('zh-cn');//en-us
79-
80-if (isset($_SERVER['SERVER_PROTOCOL']))
2、语言包
root@DESKTOP-I4OIMJC /cygdrive/e/html/tproject/combotawork/application/i18n/zh
# pwd
/cygdrive/e/html/tproject/combotawork/application/i18n/zh root@DESKTOP-I4OIMJC /cygdrive/e/html/tproject/combotawork/application/i18n/zh
# ll
总用量 4.0K
----------+ 1 root ???????? 2.4K 5月 22 11:07 cn.php root@DESKTOP-I4OIMJC /cygdrive/e/html/tproject/combotawork/application/i18n/zh
# head -n5 cn.php
<?php defined('SYSPATH') or die('No direct script access.'); return array(
'pageFirst'=>'首页',
'pagePrevious'=>'上一页',
3、使用
<?php defined('SYSPATH') or die('No direct script access.'); /**
* 订单操作
* @author liuchao
* @since 20190522
*/
class Controller_Orders_Order extends Controller
{ /**
* liuchao 20190522
* 订单列表列表控制器
*/
public function before()
{
parent::before();
} /**
* liuchao 20190522
* 订单列表
*/
public function action_index()
{
$v = View::factory();
$v = View::set('error', I18n::get('cash_error'));
$this->response->body($v);
}
}
最新文章
- PYTHON 随机验证码生成
- SOUI中做的一个磁力吸附效果
- 操作系统开发系列—1.HelloWorld ●
- [LintCode] Binary Tree Paths 二叉树路径
- 使用TabLayout快速实现一个导航栏
- python自学笔记
- 【MySQL案件】mysql登录-S失败
- C语言一些知识点回顾
- nested exception is java.sql.SQLException: IO 错误
- Jenkins--发送邮件配置
- npm cnpm +nodejs
- windows tensorboard http://0.0.0.0:6006 无法访问 解决方法 - using chrome and localhost as ip
- 《linux 字符处理》- grep/sort/uniq/tr/paste
- Android:如何获取屏幕的宽高
- How did I Install DCGAN
- Northwestern European Regional Contest 2017-I题- Installing Apps题解
- 第11章—使用对象关系映射持久化数据—SpringBoot+SpringData+Jpa进行查询修改数据库
- wk_10.md
- 【[SDOI2017]序列计数】
- Linux安装vsftpd