Skip to contents

A valid language code is a string in the format of xx-YY, where xx is a two-letter lowercase language code and YY is a two-letter uppercase country code. For example, en-GB for English (United Kingdom) and nl-BE for Dutch (Belgium).

Usage

validate_language(language)

Arguments

language

A string to validate

Value

The input language code if it is valid, otherwise an error message.