当我在 Project VIEW 的某处忘记翻译某些内容时,我会更改文件 /app/Locale/por/LC_MESSAGES/default.po 并将其发送回服务器。
但大多数情况下,这个“新翻译”需要 HOURS 才能被查看,简而言之:我只是发送文件,清除缓存和浏览器 CakePHP,按 F5,然后... 什么都没发生。
为什么?
[编辑]
<?php echo $this->Form->input('Item.0.description', array('label' => false,
'class' => 'span12', 'div' => array('class' => 'span7'), 'rows' => 3,
'placeholder' => __('Type the description'))); ?>
最佳答案
要强制更新语言,您可以清除 /tmp/cache
目录中的 persistent
和 models
目录。如果启用了 View 缓存,您还必须清除 views
。
当 debug
设置为 2
(这是在开发期间使用框架的值)并且 persistent
目录是填充了新的缓存文件,每次加载 View 时都会覆盖旧的缓存文件。因此 debug
开关和随后的浏览器刷新可能会为您清除旧的语言文件。
关于php - CakePHP 缓存国际化翻译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13518603/