To add localization rake task to your RubyMotion project.
Add this line to your application's Gemfile:
gem 'motion-localization'
And then execute:
$ bundle
And add this line to your application's Rakefile:
require 'motion-localization'
Move to your RubyMotion project directory and run rake task localization:create
with lang_code
rake localization:create lang_code=en
rake localization:create lang_code=ja
Google it for more informatoin.
- InfoPlist.strings: App name localization.
- Localizable.strings: In app string localization.
NSBundle.mainBundle.localizedStringForKey(key, value:default, table:nil)
BubbleWrap.localized_string(:foo, 'fallback')
BW.localized_string(:foo, 'fallback')
"hello".localized # => NSBundle.mainBundle.localizedStringForKey("hello", value:nil, table:nil)
"hello"._ # == "hello".localized
"hello".localized('Hello!', 'hello_table') # => ...("hello", value:'Hello!', table:'hello_table')
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request