This Ruby gem is for use with Ruby (Rails, Sinatra) applications only. Check out the documentation to learn how to set up the In-Context Editor with other technologies.
Phrase is the translation management solution for web and mobile applications. Collaborate with your team, find professional translators and stay on top of the process.
Try out Phrase for free and start translating your app!
Note: This gem documentation to learn how to install the In-Context Editor with other technologies.
How awesome would it be if translators could simply browse your website and edit text along the way? Our In-Context Editor offers just that. It provides translators with useful contextual information which improves overall translation quality. See our documentation on how to set it up: In-Context Editor Setup.
Install the gem via gem install
:
gem install phraseapp-in-context-editor-ruby
or add it to your Gemfile
when using bundler:
gem 'phraseapp-in-context-editor-ruby'
and install it:
$ bundle install
Next, create the initializer file by executing the Rails generator:
$ bundle exec rails generate phraseapp_in_context_editor:install --access-token=<YOUR_TOKEN> --project-id=<YOUR_PROJECT_ID>
You can create and manage access tokens in your profile settings or via the Authorizations API.
You can find the ID of your project in your project settings in Translation Center.
Next, add the Javascript helper to your Rails application layout file:
<%= phraseapp_in_context_editor_js %>
If you don't want to use the helper but add the plain Javascript yourself, head over to our documentation to learn more.
Restart your application to see the In-Context Editor in action!
Please note that outdated certificates or old versions of OpenSSL may cause connection issues, especially on Mac OSX. We recommend using Ruby 2.2.2 with OpenSSL 1.0.2d or later. If you experience OpenSSL-related errors, try the following.
Upgrade OpenSSL using Homebrew:
$ brew upgrade openssl
$ brew install openssl
If you are using RVM, also run:
$ rvm osx-ssl-certs status all
$ rvm osx-ssl-certs update all
As a workaround, you can disable SSL certificate verification in your config/initializers/phraseapp_in_context_editor.rb
by adding the following line:
config.skip_ssl_verification = true
This is not recommended and should only be used as a temporary workaround.
- Phrase API Documentation
- In-Context-Editor Demo
- Localization Guides and Software Translation Best Practices
Please contact [email protected] and we can take more direct action toward finding a solution.