将 CodeIgniter 的日历翻译为另一种语言
我正在尝试将 CodeIgniter 的日历对象翻译为希伯来语。
我根据需要制作了希伯来语日历翻译文件(“希伯来语”文件夹下的 calender_lang.php)并加载了日历(英文)。
但是,我不明白如何一次性翻译整个日历。 我应该对所有事情都使用循环吗?
我不明白如何使用:
$this->lang->line('language_key');
更改日历的语言。
我正在使用:
echo $this->calendar->generate();
显示日历。
您的快速帮助将不胜感激...:)
I'm trying to translate CodeIgniter's calendar object to Hebrew.
I made Hebrew-calendar translation files (calender_lang.php under a 'hebrew' folder) as required and loaded the calendar (in english).
However, I don't understand how to translate the whole calender in one time.
Should I use a loop for everything?
I can't understand how to use:
$this->lang->line('language_key');
to change the language of my calendar.
I'm using:
echo $this->calendar->generate();
to show the calendar.
you quick help would be appreciated... :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
解决了。
我发现加载库的顺序很重要。
首先,加载语言库。并且还 - 加载解析器库。
然后:
solved.
i see there is importance to the order you load your libraries.
first, load the language library. and also - load the parser library.
then:
您还可以尝试在加载日历之后、生成日历之前加载一种“新”语言。就我而言,它正在工作:
这将替换日历加载期间加载的翻译。您需要使用与原始 lang 文件中相同的数组键进行翻译,只需将其从 system/language/english/calendar_lang.php 复制到您的语言位置并翻译即可。
You may also try to load a 'new' language after loading the calendar and before generating the one. In my case it's working:
This will replace the translation loaded during calendar load. You need to have the same array keys for your translation as they are in original lang file, simply copy it from
system/language/english/calendar_lang.php
to your language location and translate.