CakePHP cache i18n translate

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

But, basically, this “new translation” takes, for example, CLOCK: I just send the file, clear the cache and CakePHP browser, press F5 and ... DO NOT SEE ANYTHING .

For what reason?

[EDIT]

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

To force a language update, you can clear the persistent and models directories in the /tmp/cache . If view caching is enabled, you will also have to clear views .

Caching is disabled if the debug parameter is set to 2 (which is the value to use the framework during development), and the persistent directory is filled with new cache files, overwriting the old ones each time the view is loaded. Thus, the debug switch and subsequent browser update can clear old language files for you.

+9
source

I found a weird solution:

I installed (app / Config / core.php) ...

 Configure::write('debug', 2); // It was 0 

Press, F5 ... wait ... and it works. I came back later ...

  Configure::write('debug', 0); 

Press F5 again and work.

Why? I have no idea.

+1
source

Even if Configure::write('debug', 2); I recommend deleting the deleted folder containing the translations, updating it with a browser (to state that nothing else is being translated), then reload the translation folder.

Works well for me.

0
source

Source: https://habr.com/ru/post/1447808/


All Articles