i18n

Guide Rails i18n patterns for English and Spanish translations.

Updated Jan 20, 2023
One-click install
npx skills add https://github.com/doncan-orozco/papyro --skill i18n-doncan-orozco
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: i18n
Source: https://github.com/doncan-orozco/papyro/tree/main/.ai/skills/i18n
Command: npx skills add https://github.com/doncan-orozco/papyro --skill i18n-doncan-orozco

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide and best practices for implementing internationalization (i18n) in Rails applications, ensuring consistent and accurate translations for English and Spanish.

Core Features & Use Cases

  • Structured Translation Keys: Enforces fully-qualified keys for clarity and maintainability.
  • Domain-Scoped Translations: Organizes translations by domain (e.g., articles, users) for better management.
  • Error Message Handling: Provides patterns for translating validation and operation errors.
  • Date, Time, Number Formatting: Guides on using I18n helpers for localized formatting.
  • Use Case: When adding a new feature with user-facing text, use this Skill to ensure all strings are properly internationalized for both English and Spanish, following established conventions for views, components, operations, and models.

Quick Start

Follow the guidelines in this Skill to add new English and Spanish translations for a user-facing string.

Frequently Asked Questions about i18n

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure translation keys for internationalization in Rails?

To structure internationalization in Rails, use fully-qualified translation keys and domain-scoped structures for views, components, operations, and error messages. This maintains clarity across English and Spanish locales.

What is the best way to handle Rails i18n for English and Spanish translations?

The best way to handle Rails i18n for English and Spanish is adhering to standard Rails i18n conventions for locale files and pluralization. This includes domain-scoping translations and using fully-qualified keys.

How do I localize date, time, and number formatting in Rails applications?

Localize date, time, and number formatting in Rails applications by using proper I18n helpers. These helpers ensure temporal and numeric displays adhere to localized conventions for the active English or Spanish locale.

How do I translate validation and operation error messages in Rails?

Translate validation and operation error messages in Rails by applying domain-scoped translation patterns. This organizes error handling under specific domains using fully-qualified keys for English and Spanish outputs.

Does this Rails i18n approach support pluralization for Spanish and English?

Yes, this Rails i18n approach supports pluralization for Spanish and English. It adheres to standard Rails i18n conventions for locale files, ensuring correct plural forms are used for views, components, and operations.