PhraseApp In-Context-Editor for Ruby
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.
PhraseApp 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 Phraseapp 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
Install the gem via
gem install phraseapp-in-context-editor-ruby
or add it to your
Gemfile when using bundler:
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 find the ID of your project in your project settings in Translation Center.
<%= phraseapp_in_context_editor_js %>
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.