CakePHP缓存i18n翻译 [英] CakePHP cache i18n translate

查看:101
本文介绍了CakePHP缓存i18n翻译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我忘记翻译内容时,在Project VIEW的某个位置,我更改文件 /app/Locale/por/LC_MESSAGES/default.po 并将其发送回服务器。

When I forget to translate something, somewhere Project VIEW, I change the file /app/Locale/por/LC_MESSAGES/default.po and sending it back to the server.

但是大多数情况下,这个'新翻译',需要HOURS来查看,简而言之:我只是发送文件,清理缓存和浏览器CakePHP,

But mostly, this 'new translation', takes HOURS to be viewed, in short: I just send the file, cleaned the cache and browser CakePHP, press F5, and ... NOTHING HAPPENS.

原因是什么?

<?php echo $this->Form->input('Item.0.description', array('label' => false, 
'class' => 'span12', 'div' => array('class' => 'span7'), 'rows' => 3,
'placeholder' => __('Type the description'))); ?>


推荐答案

要强制语言更新, code> / tmp / cache 目录中的code> persist 和模型如果启用视图缓存,您还必须清除视图

To force the language to update you can empty the persistent and models directories in the /tmp/cache directory. If view caching is enabled you'll have to clean out views as well.

设置为 2 (这是在开发期间使用框架的值)和 persistent 目录中填充新的缓存文件,覆盖旧的,每次加载视图。因此, debug 切换和后续的浏览器刷新可能会清除旧的语言文件。

Caching is disabled when debug is set to 2 (which is the value for using the framework during development) and the persistent directory is populated with new cache files, overwriting the old ones, each time a view is loaded. So the debug switch and subsequent browser refresh might cleaned the old language files for you.

这篇关于CakePHP缓存i18n翻译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆