<commit_before>Rails Internationalization (I18n) API
=====================================

The Ruby I18n (shorthand for _internationalization_) gem which is shipped with Ruby on Rails (starting from Rails 2.2) provides an easy-to-use and extensible framework for **translating your application to a single custom language** other than English or for **providing multi-language support** in your application.

The process of "internationalization" usually means to abstract all strings and other locale specific bits (such as date or currency formats) out of your application. The process of "localization" means to provide translations and localized formats for these bits.[^1]

So, in the process of _internationalizing_ your Rails application you have to:

* Ensure you have support for i18n.
* Tell Rails where to find locale dictionaries.
* Tell Rails how to set, preserve and switch locales.

In the process of _localizing_ your application you'll probably want to do the following three things:

* Replace or supplement Rails' default locale — e.g. date and time formats, month names, Active Record model names, etc.
* Abstract strings in your application into keyed dictionaries — e.g. flash messages, static text in your views, etc.
* Store the resulting dictionaries somewhere.

This guide will walk you through the I18n API and contains a tutorial on how to internationalize a Rails application from the start.

After reading this guide, you will know:

--------------------------------------------------------------------------------
<commit_msg>Complete a sentence in i18n guide's introduction<commit_after>Rails Internationalization (I18n) API
=====================================

The Ruby I18n (shorthand for _internationalization_) gem which is shipped with Ruby on Rails (starting from Rails 2.2) provides an easy-to-use and extensible framework for **translating your application to a single custom language** other than English or for **providing multi-language support** in your application.

The process of "internationalization" usually means to abstract all strings and other locale specific bits (such as date or currency formats) out of your application. The process of "localization" means to provide translations and localized formats for these bits.[^1]

So, in the process of _internationalizing_ your Rails application you have to:

* Ensure you have support for i18n.
* Tell Rails where to find locale dictionaries.
* Tell Rails how to set, preserve and switch locales.

In the process of _localizing_ your application you'll probably want to do the following three things:

* Replace or supplement Rails' default locale — e.g. date and time formats, month names, Active Record model names, etc.
* Abstract strings in your application into keyed dictionaries — e.g. flash messages, static text in your views, etc.
* Store the resulting dictionaries somewhere.

This guide will walk you through the I18n API and contains a tutorial on how to internationalize a Rails application from the start.

After reading this guide, you will know:

* How I18n works in Ruby on Rails
* How to correctly use I18n into a RESTful application in various ways
* How to use I18n to translate ActiveRecord errors or ActionMailer E-mail subjects
* Some other tools to go further with the translation process of your application

--------------------------------------------------------------------------------

{'fraction_non_alphanumeric': 0.1081239041496201, 'fraction_numerical': 0.008766803039158387, 'mean_word_length': 3.8553191489361702, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6398520', 'n_tokens_mistral': 806, 'n_tokens_neox': 748, 'n_words': 468}