我想使用字符串,所以我不必为每种语言都有if语句。
在每个项目中,都有一个名为“i18n”的目录。在“en”的子目录中,有一个名为“strings.xml”的文件。
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="name">Hello</string>
</resources>
在您的代码中,您可以像这样引用它:
L('name');
您可以阅读有关全局L函数here的更多信息。
在寻找Titanium帮助时总是尝试搜索'wiki titanium {keywords}',因为Appcelerator Wiki有很多好东西,但是SEO不好。这是指南https://wiki.appcelerator.org/display/guides/Internationalizing+your+Application/
最新的答案是2012年,所以this is the current location of the documentation。如果它被移动,搜索“Axway SDK How-tos Internationalization”