1. Help Center
  2. Setup
  3. Set up Phrase for Website translation

Ruby Motion

This guide describes how to set up your first project as well how to setup and configure the Phrase RubyMotion gem.

Localize RubyMotion Projects with Phrase


This guide describes how to set up your first project as well how to setup and configure the Phrase RubyMotion gem.

  1. Add Project in Phrase
  2. Setup PhraseApp Rubymotion gem
  3. Browse RubyMotion app to upload new keys and translations


RubyMotion is a toolchain for iOS, OS X and Android development that lets you create iPhone, iPad, Mac and Android apps in Ruby.

Our phraseapp-rubymotion gem lets you connect your RubyMotion application to Phrase and benefit from the best internationalization workflow for your (iOS) projects.

Installing the gem

Add the phraseapp-rubymotion gem to your project using bundler:

gem 'phraseapp-rubymotion'

or manually:

$ gem install phraseapp-rubymotion

and require it in your Rakefile.

Initialize your project

Let’s tell Phrase a little bit about the app we’re building. Add the Access Token and Project ID to your application’s Rakefile:

Motion::Project::App.setup do |app|
  app.name = "Test Application"
  app.development do
    app.phraseapp do
      app.phraseapp.enabled = true
      app.phraseapp.access_token = "YOUR_ACCESS_TOKEN"
      app.phraseapp.project_id = "YOUR_PROJECT_ID"

You will find the Project ID in your project settings and you can generate Access Tokens in your profile settings.

This will automatically create the phraseapp_config.rb configuration file in your app folder during every build process.

Please make sure that you only enable Phrase in development mode and never in release mode!


Using Phrase with phraseapp-rubymotion lets you send new translations to the Phrase API automatically without having to write them into your Localizable.strings file or uploading them - just by browsing the app.

Localizing Strings

The first step towards a localized app is to localize all strings by extending them with their localized counterparts. This can be done by simply calling the #__ method on each string that is implemented by phraseapp-rubymotion:

"Hello World"

now becomes:

"Hello World".__

or (when using a fallback translation):

"Hello World".__("My fallback translation")

Of course you can use more generic names for your keys as well, such as:


Learn more about localization in iOS

API communication

Simply build and run your app (in the simulator). When in development mode, phraseapp-rubymotion will send all of your localized strings to Phrase automatically! Log into Phrase and check your newly created keys. If you already have your localization files in the correct place, it will transmit translations as well.

When all of your translations are completed in Phrase, it’s time to bundle them with your app. You can fetch all translations from the API and store them in our RubyMotion project by using our command line client.

  1. Install the Phrase command line client

Download the latest Phrase Client and follow the setup instructions.

2. Configure the command line tool for your project

To initialize the project configuration, just follow the instructions to initialize the Phrase command line tool:

$ phraseapp init

This will guide you through the necessary steps to configure your sources and targets for your project. Make sure you select strings as your locale file format.

3. Download locale files

Once you have finished working on your translation in Translation Center you might want to download the data back into your project. This can be done by executing the pull command:

$ phraseapp pull

Optional: Upload locale files

Besides adding translations magically through browsing the app, you can of course also upload your existing locale files to Phrase. Just execute the push command:

$ phraseapp push

All existing locale files will be uploaded to your Phrase project. Log into Translation Center to see your existing translations and add new languages or keys.


Further reading