i18n

i18n is a cursor rule for Cursor from wintermeyer/cursor-rails-rules. It costs 0 tokens per session (804 once invoked), scanned A, original, MIT.

Internationalization guidelines for a Rails application that supports multiple languages and regional settings. They define English and German defaults, translation files, naming rules, and Rails configuration.

In plain words
What is it for?
Use them when adding languages, translation keys, locale files, or translated interface text to a Rails application.
Why use it?
They provide a consistent way to store and retrieve translated text across models, views, controllers, and shared messages.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use them when adding languages, translation keys, locale files, or translated interface text to a Rails application.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/wintermeyer/cursor-rails-rules/i18n
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/wintermeyer/cursor-rails-rules

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for i18n

README.md
[![agentmods](https://agentmods.dev/badge/rules/wintermeyer/cursor-rails-rules/i18n/github.svg)](https://agentmods.dev/rules/wintermeyer/cursor-rails-rules/i18n)
Your own site
<a href="https://agentmods.dev/rules/wintermeyer/cursor-rails-rules/i18n"><img src="https://agentmods.dev/badge/rules/wintermeyer/cursor-rails-rules/i18n/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for i18n

Your own site · 80×15
<a href="https://agentmods.dev/rules/wintermeyer/cursor-rails-rules/i18n"><img src="https://agentmods.dev/badge/rules/wintermeyer/cursor-rails-rules/i18n.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 804 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00804
Opus 5.5 $0.00000 $0.00322
Sonnet 5.5 $0.00000 $0.00161
Haiku 4.5 $0.00000 $0.00080

Measured 2mo ago against content hash 4d5dd939f98f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

i18n scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/i18n.mdc · 155 lines

How it starts

The opening of the file, as written. The whole thing — 155 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Base I18n Standards

We always assume that the application supports multiple languages and locales. By default we go with English as the primary language and German as the secondary language.

Check if the 'rails-i18n' gem is installed. If not add it to the Gemfile:

gem 'rails-i18n', '~> 8.0.0'

and run a bundle install.

Configuration

  1. Setup
# config/application.rb
config.i18n.default_locale = :en
config.i18n.available_locales = [:en, :de]
config.i18n.fallbacks = true
  1. Directory Structure
config/locales/
├── en/
│   ├── models/
│   ├── views/
│   └── controllers/
└── de/
    ├── models/
    ├── views/
    └── controllers/

Key Structure

  1. Namespace Hierarchy
en:
  models:      # Model-specific translations
  views:       # View-specific translations
  controllers: # Controller-specific messages
  helpers:     # Form helpers and labels
  common:      # Shared translations
  1. Key Naming
  • Use lowercase
  • Use dots for nesting
  • Use underscores for words
  • Keep keys descriptive
  • Follow Ruby naming conventions

Implementation

  1. In Views
<%= t('.title') %>                     # Lazy lookup
<%= t('views.users.index.title') %>    # Full key
<%= t('.welcome', name: @user.name) %> # With interpolation
  1. In Controllers
flash[:notice] = t('.success')
redirect_back_or_to root_path, notice: t('.created')
  1. In Models
validates :status, inclusion: { in: %w[pending active],
  message: ->(object, data) { I18n.t("models.#{object.class.name.downcase}.errors.invalid_status") } }
  1. In Mailers
mail(
  to: @user.email,
  subject: t('.welcome_subject', name: @user.name)
)

Best Practices

  1. Key Organization
  • Group by feature/module
  • Use consistent nesting levels
  • Keep keys short but meaningful
  • Document non-obvious keys
  1. Translation Management
  • Use YAML for static content
  • Use Ruby for dynamic content
  • Keep translations DRY
  • Regular sync with translators
  1. Performance
  • Use lazy lookup when possible
  • Cache common translations
  • Avoid deep nesting
  • Preload translations in production

Read the full file on GitHub · 155 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 155 lines · 0 tokens per session scan A 4d5dd939f98f

Subscribe to this mod's changes

i18n is a cursor rule published in the GitHub repository wintermeyer/cursor-rails-rules (37 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 804 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.