0
  C   ˆl–Ü4ý('ÜZÔâ€vã,ÜÅ£�þ]-¬ãdnIjA°ÿ?Â„Î‰¿Á_ŠI|¥ŠGgYâ¯ÁÀ ?÷     # I18n Contribution Guide

## Table of Contents

- [Adding a new locale](#adding-a-new-locale)
  - [Choosing a directory name for a locale](#choosing-a-directory-name-for-a-locale)

  - [index.js](#index.js)

  - [localize](#localize)
    - [localize.ordinalNumber](#localize.ordinalnumber)

    - [localize.era and using buildLocalizeFn function](#localize.era-and-using-buildlocalizefn-function)

    - [Formatting localizers](#formatting-localizers)

    - [localize.quarter](#localize.quarter)

    - [localize.month](#localize.month)

    - [localize.day](#localize.day)

    - [localize.dayPeriod](#localize.dayperiod)

  - [formatLong](#formatlong)
    - [formatLong.dateFormats](#formatlong.dateformats)

    - [formatLong.timeFormats](#formatlong.timeformats)

    - [formatLong.dateTimeFormats](#formatlong.datetimeformats)

  - [formatRelative](#formatrelative)

  - [match](#match)

  - [formatDistance](#formatdistance)

  - [Tests](#tests)

- [Creating a locale with the same language as another locale](#creating-a-locale-with-the-same-language-as-another-locale)

## Adding a new locale

To add a new locale:

- [Choose a directory name for it](#choosing-a-directory-name-for-a-locale).

- Copy the content of an existing locale (e.g. `en-US`) into the newly created directory.

- Replace the values in the content with yours file-by-file.
  Use [CLDR data](https://www.unicode.org/cldr/charts/32/summary/root.html)
  as a point of reference which values to choose.

All locales contain a number of properties:

- [`formatDistance`](#formatdistance) â€” distance localizer function used by `formatDistance` and `formatDistanceStrict`.
- [`formatLong`](#formatlong) â€” contains long date localizer functions used by `format` and `formatRelative`.
- [`formatRelative`](#formatrelative) â€” relative date localizer function used by `formatRelative`.
- [`localize`](#localize) â€” contains functions, which localize the various date values. Required by `format` and `formatRelative`.
- [`match`](#match) â€” contains functions to parse date values. Required by `parse`.
- [`options`](#indexjs) â€” contains the index of the first day of the week for functions such as `startOfWeek`,
  and the value which determines the first week of the year
  for functions like `setWeek`.

### Choosing a directory name for a locale

Use the four letter code for the directory name (e.g. `en-GB`),

Use the two/three letter code:

- if the language code and the country code are the same (e.g. `pt` instead of `pt-PT`).

- if the language is used in only one country (e.g. `fil` instead of `fil-PH`).

- if all countries who use the language
  also use the same regional standards: the first day of the week,
  the week numbering (see: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system),
  calendar date format (see: https://en.wikipedia.org/wiki/Calendar_date)
  and date representation (see: https://en.wikipedia.org/wiki/Date_and_time_representation_by_country
  and: https://en.wikipedia.org/wiki/Date_format_by_country)
  (e.g. `ca` instead of `ca-ES` and `ca-AD`).

### index.js

Locale's `index.js` is where all the properties of the locale are combined in a single file,
documented in JSDoc format.

```javascript
import formatDistance from "./_lib/formatDistance/index.js";
import formatLong from "./_lib/formatLong/index.js";
import formatRelative from "./_lib/formatRelative/index.js";
import localize from "./_lib/localize/index.js";
import match from "./_lib/match/index.js";

/**
 * @type {Locale}
 * @category Locales
 *
 * // Name of the locale.
 * // Inside the parentheses - name of the country - if the locale uses the four letter code, e.g. en-US, fr-CA or pt-BR.
 * @summary English locale (United States).
 *
 * // Name of the language (used by https://date-fns.org/ website)
 * @language English
 *
 * // ISO 639-2 code. See the list here:
 * // https://www.loc.gov/standards/iso639-2/php/code_list.php
 * // Used by https://date-fns.org/ to detect the list of the countries th