宝典:第九式 多语言localization插件

首先是插件安装
  这个都知道RAILS_ROOT下运行
ruby script\plugin install localization 


插件的使用
  语言包建立在RAILS_ROOT/lang/目录下,我们就建立一个名为zh_CN.rb的文件。内容如下:

Localization.define('zh_CN') do |l| 
l.store 'Manage', '管理'
l.store 'Users', '用户'
end 
 
然后在application.rb文件中加入如下内容,定义需要使用的语言名:

Localization.lang = 'zh_CN'  


再打开一个模板文件,在其中输入如下内容:

<%= _("Manage") %> 

 启动Rails项目,浏览这个页面,看看是不是输出的是中文呢?
This is currently the most complete localization system available for Unity. Supports Unity UI, Unity 2D, TextMesh Pro, NGUI, 2D ToolKit, SVG Importer, Standard Components Localizes Image, Text, Sounds, Fonts, Sprites, Atlases, Prefabs, TextMeshes, Dropdowns and more. Auto Translation Built-in support for Google Translator to automatically localize all your labels into any language. Google Spreadsheets and CSV files Link external Spreadsheets and any change will be automatically downloaded, even after the game is released. Detect and Fix Errors Parse scenes to find missing or unused translations as well as duplicated or similar terms. Sub-Object Translations Set Secondary terms to change not just text and images, but also which Fonts and Atlases are used per language. Callbacks and Parameters Translations can be modified to insert Scores, Names and Game Variables using the languages grammar. Plurals Built-in rules for each language covering those that just need singular/plural forms up to those that use 6 variants. Right to Left Languages Correct rendering of RTL languages with support for line wrapping and alignment. Save Memory Create Fonts with only the characters you are using. Link your AssetBundles to add more localized content. Easy and Efficient Edit and Preview all your translations in one location, then, at runtime only the current language is loaded. Using fast lookups to access it. Reuse Translations Set texts to be automatically shown as UPPER CASE, lower case, Upper first, Title Case, etc. In Game Dynamic Translations Easy API to translate chat messages and other dynamic texts at runtime App Name and Store Localization Translate the name of your game to all languages and show in the Android/IOS store which languages your game support Simple yet Powerful Editors Intuitive inspectors allow you Preview, Edit, Categorize, Create, Parse and Filter even large sources. Compile Time Checking Bake translations into script constants to avoid Typo
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值