I always seem to have to look this stuff up, so I'm putting it here to re-reference and share:
BCP47 is the "Best Current Practice" for encoding languages as defined by the IETF. It incorporates two standards: IS0 639.2 for the language part of the code, and ISO 3166-1 for the region, e.g., en-US is english as used in the US.
Get ISO 639.2 codes here.