language_codes: Language codes supported by GNU gettext

Description Usage Format Details Note References Examples

Description

This dataset contains the language and country code values that are accepted by GNU gettext. Its primary purpose is to allow checking of the "Language" field of PO translation files.

Usage

1
2
3

Format

language_codes is a list with two character vector elements.

language

Lowercase two letter ISO 639-1 codes, and some lowercase three letter ISO 639-2 codes representing languages.

country

Uppercase two letter ISO 3166-1 alpha-2 code representing countries and territories.

An object of class character of length 1.

Details

Valid "Language" field values consist of a language code taken from the language element of this dataset, optionally followed by an underscore and a country code taken from the country element of this dataset.

Note

The language element of the dataset contains all of ISO 639-1 as well as the value "mo", for "Moldavian", which isn't an official ISO code. It also contains a subset of ISO 639-2, for rare languages where there is no ISO 629-1 code. The country element is identical to ISO 3166-1 alpha-2.

References

The dataset was generated from these the contents of these webpages: https://www.gnu.org/software/gettext/manual/html_node/Usual-Language-Codes.html#Usual-Language-Codes https://www.gnu.org/software/gettext/manual/html_node/Rare-Language-Codes.html#Rare-Language-Codes https://www.gnu.org/software/gettext/manual/html_node/Country-Codes.html#Country-Codes

Examples

1
2
3
4
5
6
7
8
# The dataset contains:
e <- new.env()
utils::data(language_codes, package = "poio", envir = e)
e$language_codes

# Allowed values in the language field can be matched like this
# (though it will be automatically done in generate_po_from_pot)
stringi::stri_detect_regex(c("it", "nl_BE", "xxx"), ALLOWED_LANGUAGE_REGEX)

RL10N/poio documentation built on April 27, 2020, 3:50 a.m.