> ## Documentation Index
> Fetch the complete documentation index at: https://developers.phrase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ruby on Rails

> OTA gem for Ruby on Rails applications

<Card title="phrase/phrase-ota-i18n" icon="github" horizontal href="https://github.com/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`:

```ruby theme={null}
gem 'phrase-ota-i18n'
```

Then run:

```bash theme={null}
bundle install
```

## Setup

Run the Rails generator to create the initializer:

```bash theme={null}
bundle exec rails generate phrase_ota:install \
  --distribution-id YOUR_DISTRIBUTION_ID \
  --secret-token YOUR_SECRET_TOKEN
```

Both parameters are required:

| Parameter           | Description                                                      |
| ------------------- | ---------------------------------------------------------------- |
| `--distribution-id` | The ID of the distribution you created in Phrase Strings         |
| `--secret-token`    | The environment secret for authenticating against the Phrase CDN |

Both values are available in the Phrase Strings dashboard after creating a distribution, or via the [Distributions API](/en/api/strings/introduction).

## Managing releases

Create and publish releases using the [Strings API](/en/api/strings/introduction) 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](/en/ota/introduction#release-triggers).
