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 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器