This repository is a small Ruby on Rails internalization example that shows how a Rails app can keep product copy in YAML locale files and let Yesglot manage translation updates through pull requests.
The example app is intentionally minimal. The goal is not to demonstrate every Rails feature; it is to show the translation workflow you would use in a real Rails application.
- Rails' built-in
I18n.t/thelpers - YAML locale files under
config/locales - a source language file:
config/locales/en.yml - target language files:
config/locales/es.ymlandconfig/locales/tr.yml - pluralization with
oneandother - interpolation with
%{count} - blank target-language values that Yesglot can translate
Yesglot is an AI-first translation workflow tool for software teams.
At a high level, you connect your GitHub repository, add a yesglot.toml file, point it to your source and target translation files, and Yesglot opens pull requests with generated translation updates.
For Rails apps, that usually means:
- your source language lives in a file like
config/locales/en.yml - your target languages live in files like
config/locales/es.ymlandconfig/locales/tr.yml - your Rails views and controllers use stable translation keys
- Yesglot watches the source locale file for changes
- when source strings change, Yesglot creates a pull request with updated target locale files
That keeps translation changes in the same GitHub review flow your team already uses for code.
The important Rails files are:
example-project/
app/
controllers/
application_controller.rb
home_controller.rb
views/
home/
index.html.erb
config/
application.rb
locales/
en.yml
es.yml
tr.yml
routes.rb
example-project/config/application.rb configures Rails i18n:
config.i18n.available_locales = %i[en es tr]
config.i18n.default_locale = :en
config.i18n.fallbacks = trueexample-project/app/views/home/index.html.erb renders translated text with Rails helpers:
<h1><%= t(".hero_title") %></h1>
<p><%= t(".hero_copy", count: @projects_count) %></p>
<p><%= t(".notifications", count: @unread_notifications) %></p>example-project/config/locales/en.yml is the source language file:
en:
home:
index:
hero_title: "Translate your Rails app with confidence"
hero_copy: "Manage %{count} multilingual projects from one place."
notifications:
one: "You have %{count} unread notification."
other: "You have %{count} unread notifications."The target files keep the same keys under their own locale code:
es:
home:
index:
hero_title: ""
hero_copy: ""Those empty values are the kind of missing translations Yesglot can fill in through a pull request.
Keep your app copy in normal Rails YAML locale files:
config/
locales/
en.yml
es.yml
tr.yml
Use one source language as the source of truth. In this example, English is the source language.
In config/application.rb, define the languages your app supports:
module YourApp
class Application < Rails::Application
config.i18n.available_locales = %i[en es tr]
config.i18n.default_locale = :en
config.i18n.fallbacks = true
end
endYou can then use translation keys from views, controllers, mailers, jobs, and helpers:
<%= t("navigation.sign_in") %>
<%= t(".hero_copy", count: @projects_count) %>Create a project at yesglot.com and connect your GitHub repository.
During setup, Yesglot opens a pull request that adds a yesglot.toml file to the root of your repository. That file tells Yesglot which files to watch and update.
The pull request created by Yesglot should look similar to this:
# https://github.com/yesglot/yesglot.toml
[yesglot]
version = 1
[project]
id = "proj_your_project_id"
technology = "rails"
tracked_branch = "main"
custom_prompt = "This is a Ruby on Rails SaaS app. Keep translations concise and product-friendly."
[source_language]
tag = "en"
path = "config/locales/en.yml"
[[target_language]]
tag = "es"
path = "config/locales/es.yml"
[[target_language]]
tag = "tr"
path = "config/locales/tr.yml"
custom_prompt = "Use natural Turkish. Preserve product names."If your Rails app lives in a subdirectory, Yesglot should include that subdirectory in the paths:
[source_language]
tag = "en"
path = "example-project/config/locales/en.yml"
[[target_language]]
tag = "es"
path = "example-project/config/locales/es.yml"Review the generated paths and language tags, then merge the pull request when the configuration looks correct.
Keep the project.id generated by Yesglot. Do not copy the placeholder ID from this README into a real project, and do not change the generated project ID after setup.
When you add or change product copy, update the source locale file:
en:
checkout:
title: "Complete your order"
submit: "Pay now"Then commit and push that change to the branch Yesglot tracks.
When Yesglot detects changes in the source file, it translates the new or changed strings and opens a pull request that updates the target locale files.
Your workflow becomes:
- Add or update English strings in
config/locales/en.yml. - Commit and push to the tracked branch.
- Review the Yesglot pull request.
- Merge the PR when the translations look good.
- Deploy as usual.
- Keep translation keys stable; changing a key is usually a new translation.
- Translate YAML values, not YAML keys.
- Preserve interpolation variables exactly, such as
%{count}or%{user_name}. - Preserve Rails pluralization keys such as
one,other,zero,few, andmany. - Quote strings that contain YAML-sensitive characters like
:,{,}, or%. - Use relative view keys like
t(".hero_title")when the copy belongs to one template. - Use shared keys like
navigation.sign_inwhen the copy appears in many places.
If you want the simplest setup, use this order:
- Move user-facing copy into Rails locale files.
- Keep one source locale file, usually
config/locales/en.yml. - Add one target locale file per supported language.
- Create a project in Yesglot and connect the repository.
- Review and merge the Yesglot pull request that adds
yesglot.toml. - Let Yesglot create translation pull requests when source strings change.
- Review translations before merging.
This gives your Rails team a localization workflow that stays close to code: source strings in Git, translated files in pull requests, and humans still in control.