Skip to main content

phrase/phrase-ota-i18n

phrase-ota-i18n is a Ruby gem that replaces the default Rails i18n backend with a Phrase-backed one. Instead of reading translations from local YAML files, your application fetches the current release from the Phrase CDN at runtime. Publishing a new release in Phrase Strings propagates to all running instances without a redeploy. If Phrase is unreachable, the gem falls back to the locale files bundled with your application.

Installation

Add to your Gemfile:
Then run:

Setup

Run the Rails generator to create the initializer:
Both parameters are required: Both values are available in the Phrase Strings dashboard after creating a distribution, or via the Distributions API.

Managing releases

Create and publish releases using the Strings API or the Phrase Strings dashboard. There is no version targeting for Rails releases — all running instances always receive the latest published release. To publish releases automatically on a schedule, use release triggers.