Site Audit false positive: valid 3-letter language code "mfe" flagged as invalid hreflang / HTML lang
Paul Schell
Hi Ahrefs team,
Site Audit flags the language code "mfe" (Morisyen / Mauritian Creole) on our site as invalid in three checks:
- hreflang: "mfe – Invalid"
- Self-hreflang: "mfe – Invalid"
- HTML lang: "mfe – Invalid"
Example URL: https://tiraz.mu/mfe/check/
(The other values on the same page, "en" and "x-default", are accepted.)
I think this is a false positive:
- hreflang values and the HTML lang attribute are BCP 47 language tags (RFC 5646). Section 2.2.1 allows the primary language subtag to be a 2- or 3-letter ISO 639 code. A 3-letter code is to be used when the language has no ISO 639-1 (2-letter) code.
- Morisyen has no ISO 639-1 code. Its ISO 639-3 code is "mfe", and "mfe" is listed as a language subtag in the IANA Language Subtag Registry. That makes "mfe" the correct tag for this language, not just an allowed one.
- The HTML standard defines the lang attribute as a BCP 47 language tag, so lang="mfe" is valid HTML.
It looks like the validator only accepts ISO 639-1 (2-letter) codes. Could you extend it to accept all language subtags from the IANA registry, or at least 3-letter ISO 639-2/639-3 codes for languages without a 2-letter code? Many languages are affected, not just Morisyen.
Thanks!