This add-on is operated by Dynport GmbH
Painless Software Localization for Engineers.
Last updated 22 February 2018
PhraseApp is an online editor for all common language file and locale formats including YAML, JSON, Gettext (.po), Properties, XLIFF, Android, iOS, ResX etc. You can always access your locale files and translations from within our online Translation Center.
With PhraseApp your translation workflow will get much easier:
- Add a new feature to your app that requires translations
- Push new keys to PhraseApp or create them manually within our Translation Center
- Deploy your new code to your staging environment and let your copywriters and translators change finalize the content and translations
- Pull the updated locale files from PhraseApp and deploy changed translations to production
PhraseApp comes with an In-Context Editor for Rails, AngularJS, Django and Symfony. You can edit your copy or translations directly on your site without having to deal with localization files at all.
Your copywriters and translators will see the context of a certain text. While changing it they can immediately see if the length of the text fits in the given space or what the intention of a certain piece of text is.
Free your developers from having to deal with the content and structure of localization files by automating translation workflow with our API.
Provisioning the add-on
PhraseApp can be attached to a Heroku application via the heroku command:
$ heroku addons:create phrase -----> Adding phrase to sharp-mountain-4005... done, v18 (free)
Once the add-on has been provisioned, a
PHRASE_ACCESS_TOKEN and a
PHRASE_PROJECT_ID setting will be available in your app configuration.
It contains your oauth access token which allows you to connect to the PhraseApp API:
$ heroku config | grep PHRASE_ACCESS_TOKEN PHRASE_ACCESS_TOKEN => 4bd4474ce91066bb53d23f49d61f8747
It also contains the project id to access your automatically created project in PhraseApp:
$ heroku config | grep PHRASE_PROJECT_ID PHRASE_PROJECT_ID => ba0c61b5346588a9f4109c263572e305
After you have set up a staging environment and provisioned the add-on, you need to prepare your application to connect with PhraseApp:
Add the gem
phraseapp-in-context-editor-ruby gem to your staging environment:
group :development, :staging do gem 'phraseapp-in-context-editor-ruby' end
and install it by executing the bundle command:
$ bundle install
Ruby on Rails
phraseapp-in-context-editor-ruby gem by executing the Rails generator:
$ bundle exec rails generate phraseapp_in_context_editor:install --access-token=YOUR_PHRASE_ACCESS_TOKEN --project-id=YOUR_PHRASE_PROJECT_ID
phraseapp_in_context_editor.rb initializer file in
config/initializers and replace the auth token with a more flexible call to the env setting provided by the Heroku addon:
PhraseApp::InContextEditor.configure do |config| ... config.enabled = (ENV['RACK_ENV'] == 'staging') config.access_token = ENV['PHRASE_ACCESS_TOKEN'] config.project_id = ENV['PHRASE_PROJECT_ID'] ... end
<head> ... <%= phraseapp_in_context_editor_js %> ... </head>
Set the load path
Your application needs to know that it should use the PhraseApp locales. This can be achieved by setting the i18n load path in your application config.
Pushing existing locale files
Besides managing your projects and locale files through the web interface you can also use the PhraseApp Command Line Client to push your locales:
$ phraseapp push
Deploying the application
You can now deploy your application to your staging system:
$ git push staging master
Once deployed, open it in your browser:
$ heroku open
You should now see your application ready to be translated with the PhraseApp In-Context-Editor.
After you have finished translating you need to deploy the new localization files to your production system:
$ phraseapp pull $ git add ./config/locales $ git commit -m "added new translations"
You can now push the changes to your production repository and deploy your production system with your new translation content:
$ git push heroku master
You can remove the PhraseApp add-on via your Heroku CLI:
$ heroku addons:remove phrase -----> Removing PhraseApp from sharp-mountain-4005... done, v20 (free)
Before removing PhraseApp please make sure that you have downloaded all translations from your account. After deprovisioning your account will be shut down and your account data will be deleted.
All PhraseApp support and runtime issues should be logged with Heroku Support.
Additional resources are available at: