• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mattheworiordan/json.i18n-for-Titanium-Mobile: Localization library for Titanium ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

mattheworiordan/json.i18n-for-Titanium-Mobile

开源软件地址(OpenSource Url):

https://github.com/mattheworiordan/json.i18n-for-Titanium-Mobile

开源编程语言(OpenSource Language):

JavaScript 100.0%

开源软件介绍(OpenSource Introduction):

json.i18n has a simple goal: To provide a more robust, easier to use, and generally nicer looking localization solution for Titanium based on JSON.

To use its features, include the json.i18n.js file before you require access to localized resources.

Ti.include('vendor/json.18n.js');

SETUP

You will need to create your localised resources as JSON files in /Resources/i18n/*.json Example:

In each JSON file, you can define any object structure you like for the resources such as, but you must ensure you use valid JSON (i.e. enclosed in double quotation marks)

{
  "parent": {
    "child": {
      "value1": "1",
      "value2": "2".
      "value3": "Supports interpolation %s"
    }
  }
}

USE WITHIN YOUR APP

i18n.getString('parent.child.value1') -> "1"
i18n.getFormattedString('parent.child.value3','value') -> Supports interpolation value

A shortcut also exists for the getFormattedString method as follows:

I('parent.child.value3','value') -> Supports interpolation value

EXAMPLE APP

I strongly urge you to look at the sample application that is included at https://github.com/mattheworiordan/json.i18n-for-Titanium-Mobile/tree/master/example. It is very straightforward and provides good examples of how the localized resources fallback to defaults.

CONTACT INFORMATION

json.i18n was made by Matthew O'Riordan (www.mattheworiordan.com).

Please provide feedback, I will happily add to this very simple little library.

I can be contacted through my website -- www.mattheworiordan.com




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
ClearCorp/odoo-costa-rica: Odoo Costa Rica Localization发布时间:2022-08-16
下一篇:
quarkusio/quarkusio.github.io: Website for Quarkus project发布时间:2022-08-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap