The HTML5 specification defines hreflang
like this:
The hreflang attribute on a elements that create hyperlinks, if present, gives the language of the linked resource. It is purely advisory. The value must be a valid BCP 47 language tag. [BCP47] User agents must not consider this attribute authoritative — upon fetching the resource, user agents must use only language information associated with the resource to determine its language, not metadata included in the link to the resource.
(see https://www.w3.org/TR/html5/links.html#attr-hyperlink-hreflang)
BCP47 is IETF document "Tags for Identifying Languages". It details how a language tag is formed and its possible content.
The parsing is basically language[-script][-region]*("-" variant)*("-" extension)
:
- the first part is the language as defined in ISO 639-1 Alpha-2 codes, so
en
from your case, with optional extended language subtags,
- the script is 4 characters, so not your case here (it is optional),
- the region is from ISO 3166-1, country codes, and it is preferred to be in uppercase, hence
CA
,
- variant subtags are defined as used to indicate additional, well-recognized
variations that define a language or its dialects that are not
covered by other available subtags. but they are at least 4 characters (see point 4 of 2.2.5)
So en-ca-ab
does not seem valid to me.
The ISO 3166-2 code for Alberta in Canada is "CA-AB", but you can not use it as a variant as is (because of its hyphen and because each variant is registered in a registry).
In fact if you input your string at http://unicode.org/cldr/utility/languageid.jsp you will see it is labeled as invalid.
I also see no registration for "Alberta" in https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
In short, do you really think/need to define the English Canadian language as spoken in Alberta because it is so different from English Canadian, which would be the valid en-CA
language tag?
Remember that you are identifying a language, not a geography. If you want to specify that part of your website is related only to this specific province (for example if you provide services only there), then it is not a language issue, and hence should have nothing to do with hreflang
.