Learn R Programming

poio (version 0.0-4)

language_codes: Language codes supported by GNU gettext

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

data(language_codes)

ALLOWED_LANGUAGE_REGEX

Arguments

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.

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

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab