<commit_before>Internationalization
====================

Internationalization (I18N) refers to the process of designing a software application so that it can be adapted to
various languages and regions without engineering changes. For Web applications, this is of particular importance
because the potential users may be worldwide. Yii offers a full spectrum of I18N features that support message
translation, view translation, date and number formatting.


## Locale and Language <span id="locale-language"></span>

### Locale

Locale is a set of parameters that defines the user's language, country and any special variant preferences
that the user wants to see in their user interface. It is usually identified by an ID consisting of a language
ID and a region ID. 

For example, the ID `en-US` stands for the locale of "English and the United States".

For consistency reasons, all locale IDs used in Yii applications should be canonicalized to the format of
`ll-CC`, where `ll` is a two- or three-letter lowercase language code according to
[ISO-639](http://www.loc.gov/standards/iso639-2/) and `CC` is a two-letter country code according to
[ISO-3166](http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html).
More details about locale can be found in the
[documentation of the ICU project](http://userguide.icu-project.org/locale#TOC-The-Locale-Concept).

### Language

In Yii, we often use the term "language" to refer to a locale.

A Yii application uses two kinds of languages: 
* [[yii\base\Application::$sourceLanguage|source language]]: This refers to the language in which the text messages in the source code are written.
* [[yii\base\Application::$language|target language]]: This is the language that should be used to display content to end users.

The so-called message translation service mainly translates a text message from source language to target language.

### Configuration
You can configure application languages in the "application configuration" like the following:

```php
return [
    // set target language to be Russian
    'language' => 'ru-RU',
    
    // set source language to be English
    'sourceLanguage' => 'en-US',
    
    ......
];
```
<commit_msg>Fixes #14427: ISO-3166 link updated [skip ci]<commit_after>Internationalization
====================

Internationalization (I18N) refers to the process of designing a software application so that it can be adapted to
various languages and regions without engineering changes. For Web applications, this is of particular importance
because the potential users may be worldwide. Yii offers a full spectrum of I18N features that support message
translation, view translation, date and number formatting.


## Locale and Language <span id="locale-language"></span>

### Locale

Locale is a set of parameters that defines the user's language, country and any special variant preferences
that the user wants to see in their user interface. It is usually identified by an ID consisting of a language
ID and a region ID. 

For example, the ID `en-US` stands for the locale of "English and the United States".

For consistency reasons, all locale IDs used in Yii applications should be canonicalized to the format of
`ll-CC`, where `ll` is a two- or three-letter lowercase language code according to
[ISO-639](http://www.loc.gov/standards/iso639-2/) and `CC` is a two-letter country code according to
[ISO-3166](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes).
More details about locale can be found in the
[documentation of the ICU project](http://userguide.icu-project.org/locale#TOC-The-Locale-Concept).

### Language

In Yii, we often use the term "language" to refer to a locale.

A Yii application uses two kinds of languages: 
* [[yii\base\Application::$sourceLanguage|source language]]: This refers to the language in which the text messages in the source code are written.
* [[yii\base\Application::$language|target language]]: This is the language that should be used to display content to end users.

The so-called message translation service mainly translates a text message from source language to target language.

### Configuration
You can configure application languages in the "application configuration" like the following:

```php
return [
    // set target language to be Russian
    'language' => 'ru-RU',
    
    // set source language to be English
    'sourceLanguage' => 'en-US',
    
    ......
];
```

{'fraction_non_alphanumeric': 0.08819569120287253, 'fraction_numerical': 0.012342908438061042, 'mean_word_length': 4.415552855407047, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 1, 'lorem ipsum': 0, 'www.': 3, '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': '4121969', 'n_tokens_mistral': 1175, 'n_tokens_neox': 1122, 'n_words': 568}