I18n hierarchy rules: en->en_US, ja->ja_JP, fr->fr_CA?

When making addons localizable are there any rules for when I don’t need to write the whole language code like “fr_CA” and can just use “fr”?

For example I’ve been using “en” in the “_locale” to cover both US english and UK english.

I’ve been using “fr” to represent both “fr_FR” and “fr_CA” and I presume if a French Canadian or French French user installs my addon they will see it localized in French even if they were French Canadian.

Is this assumption correct?

It’s explained in Concepts -> Internationalization -> Localized String Selection