如何为 Blogger 添加国际化支持?
是否可以在一个博客中处理多种语言?
是否可以添加自己的翻译而不使用谷歌翻译小部件 http://translate.google.com/translate_tools?
Thanks.
这些应该设置在博客的 html head 中(设计 -> 编辑 HTML,在 之后插入)
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js' type='text/javascript'></script>
<script src='http://csjs.googlecode.com/files/csjs_1.1.3.js' type='text/javascript'></script>
<script src='http://csjs.googlecode.com/files/csjs.lang_1.0.0.js' type='text/javascript'></script>
<script src='http://csjs.googlecode.com/files/csjs.browser_1.0.3.js' type='text/javascript'></script>
<script src='http://csjs.googlecode.com/files/csjs.i18n_1.2.5.js' type='text/javascript'></script>
<script src='http://csjs.googlecode.com/files/csjs.ui_1.0.6.js' type='text/javascript'></script>
<script src='http://csjs.googlecode.com/files/csjs.ui.i18n_1.0.4.js' type='text/javascript'></script>
这帖子看起来很像:
<!-- insert this as a title -->
<div i18n='post1_msg1'> <!-- it is worth to add default text here due to some programs that --></div>
<!-- any HTML controls to be internationalized -->
<div i18n='post1_msg2'><!-- operate blog content (like rss reader) will not download script --></div>
<script type="text/javascript">
i18n.load( {
'en' : {
'post1_msg1' : 'First Post',
'post1_msg2' : 'Post content'
},
'ru' : {
'post1_msg1' : 'Первое сообщение',
'post1_msg2' : 'Текст сообщения'
},
'uk' : {
'post1_msg1' : 'Перше повідомлення',
'post1_msg2' : 'Текст повідомлення'
}
});
</script>
添加语言选择器作为小工具(设计 -> 页面元素 -> 添加小工具 -> 基础知识 -> HTML/JavaScript)。
<div csjs-ctrl-class="csjs.ui.i18n.ListLanguageSwitch"></div>
关于 csjs 库 http://code.google.com/p/csjs/wiki/csjs_i18n.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)