Just playing with the HTML Helper link
method
Putting __() around a string makes it ready for internationalization in CakePHP. You create a translation file using poedit or somesuch and then CakePHP will automagically replace the contents with the other language when told to.
But discovered you can't do this:
echo $this->Html->link(
__('Hello James')
, 'https://toggen.com.au/blog');
You must add ", true
" to tell it to return when it's not being echoed.
echo $this->Html->link(
__('Hello James', true)
, 'https://toggen.com.au/blog');
So if you see dead link text in your CakePHP application which uses __() then check to make sure you use __('Your Text', true).
0 Comments