We use the BCP 47 format for language codes. This is a combination of ISO 639-3 and ISO 3166-1. For example, en-US represents the English language as it is used in the United States, where words like "color" are spelled without a "u", while en-GB represents English as used in the United Kingdom, where the same word is spelled "colour".
When specifying a language code, you should use the 2-letter code defined by ISO 639-1 if one exists, as it is more commonly recognized and widely supported. If a 2-letter code is not available for a particular language, then use the corresponding 3-letter code from ISO 639-3. For example, use fr for French and de for German, but use tyv for Tuvan, which does not have a 2-letter equivalent.