laravel-localization icon indicating copy to clipboard operation
laravel-localization copied to clipboard

Fixed values for `lang` and `hreflang` attribute

Open arttiger opened this issue 2 years ago • 2 comments

Regional langs xx_YY it's not a valid value for that attribute. It should be xx-YY

arttiger avatar Sep 06 '21 06:09 arttiger

The regional value is used internally for setting the regional locale (so formatLocalized works in Carbon) and is in the correct format for that.

rickwest avatar Sep 10 '21 12:09 rickwest

In this case, in my opinion, the regional key should be renamed tolocalewhich will correspond to the Carbon documentation. And to each language add the hreflang key, which will be used for SEO for<link rel = "alternate" hreflang = "{{$ properties ['hreflang']}}" href = "#">and in what value the locale key will be specified in xx-YY format. If you now use the format xx_YY for hreflang service validator.w3.org reports that this is an incorrect format.

image

arttiger avatar Sep 14 '21 13:09 arttiger