According to Django Documentation:
locale name
A locale name, either a language specification of the form
ll
or a combined language and country specification of the formll_CC
. Examples:it
,de_AT
,es
,pt_BR
. The language part is always in lower case and the country part in upper case. The separator is an underscore.language code
Represents the name of a language. Browsers send the names of the languages they accept in the Accept-Language HTTP header using this format. Examples:
it
,de-at
,es
,pt-br
. Language codes are generally represented in lower-case, but the HTTP Accept-Language header is case-insensitive. The separator is a dash.
Questions:
- When I see
it
ores
in someone's code, how can I tell whether it's a locale name or a language code? - When should we use locale code, and when to use language code?