我正在尝试使用cakephp 2改变我的网站语言。x。我已经创建了语言翻译和配置设置的PO文件。它的工作很好与网站菜单的链接。我通过像下面这样改变链接来实现这一点:
<li id='start'><?php echo $this->Html->link(__d('default','Start', true),array('controller'=>'sensors','action'=>'dashboard')) ?></li>
我需要翻译工作的文本是写在highmaps和highcharts,像下面:
<script>
here is some script ...
text : 'Top 10 Country'
</script>
我希望文本前10个国家被翻译。如果我像下面这样定义它:
<script>
here is some script ...
text : '__d(Top 10 Country)'
</script>
然后打印整个文本作为内部字符串。请帮助我,我该如何翻译这些文本。谢谢。
<script>
here is some script ...
text : "<?= __('Top 10 Country'); ?>"
</script>