dongpangbu4016 2012-01-11 01:30
浏览 52
已采纳

CakePHP 2.0.5表单输入日期时间语言

How I change language of input datetime in Cakephp 2.0.5?

In CakePHP 1.3, I use default.po, and works great.

 // app/Config/core.php
 Configure::write('Config.language', 'pt-br');

 // app/Locale/pt_br/LC_MESSAGES/default.po    
 msgid "January"
 msgstr "Janeiro"
 ....

In Cakephp 2.0.5, default.po doesn't work.

My input is that:

 <?php echo $this->Form->input('melhor_horario', array('dateFormat' => 'DMYHS',
 'separator' => ' de ', 'minYear' => date('Y'), 'maxYear' => date('Y') + 1, 
 'timeFormat' => 24, 'interval' => 15, 'class' => 'span2', 
 'default' => date('Y-m-d 15:00', strtotime('sunday')))) ?>
  • 写回答

1条回答 默认 最新

  • doushanlv5184 2012-02-29 15:36
    关注

    You need to put the translations in a correct domain. Cake 2 uses "cake" domain internally, so the correct path is Locale/[lang]/LC_MESSAGES/cake.po

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计