No commit activity in last 3 years
No release in over 3 years
Localization rake task for RubyMotion
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0

Runtime

~> 1.3
>= 0
 Project Readme

motion-localization

To add localization rake task to your RubyMotion project.

Installation

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'

Usage

Creating localization files

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

After creating localization files

Google it for more informatoin.

Edit localization files

  • InfoPlist.strings: App name localization.
  • Localizable.strings: In app string localization.

Use localize method in your code

NSBundle.mainBundle.localizedStringForKey(key, value:default, table:nil)

with BubbleWrap

BubbleWrap.localized_string(:foo, 'fallback')
BW.localized_string(:foo, 'fallback')

with sugercube

"hello".localized  # => NSBundle.mainBundle.localizedStringForKey("hello", value:nil, table:nil)
"hello"._          # == "hello".localized
"hello".localized('Hello!', 'hello_table')  # => ...("hello", value:'Hello!', table:'hello_table')

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request