我可以在hreflang中使用自定义语言/国家/地区代码组合吗? [英] Can I use custom language / country code combinations in hreflang?

查看:120
本文介绍了我可以在hreflang中使用自定义语言/国家/地区代码组合吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用14种语言国际化一个大型网站。



我发现我们想要定位的一些语言/国家没有lang-cc条目在各种列表中,例如例如,在格陵兰广泛使用丹麦语。

例如,丹麦语在格陵兰广泛使用。

我们正在将我们的网站翻译成丹麦语,供丹麦用户使用。



因此,将翻译内容提供给丹麦语在格陵兰的演讲者,但是lang / country的代码并没有列在我们发现的资源中(特别是在谷歌格陵兰存在的情况下 - google.gl)。

我们可以安全地在 hreflang 中使用 da-gl ,并作为一个子目录来定位格陵兰的丹麦人,即使这种组合是没有在我们发现的各种资源中列出?



(请注意,我们不能简单地将格陵兰的用户重定向到针对丹麦的丹麦版本​​,因为它们存在差异在货币和运输价格,我们正试图避免任何基于IP的重定向/内容定制。)

解决方案

没有有效组合列表,因为没有人可以(也不应该)定义哪些语言是在哪些区域或哪些语言变体存在。

HTML5定义 hreflang 属性可以具有的内容:





在网站管理员SE上,我解释了这意味着什么(对于 lang 属性,但它是同样的 hreflang ):我的答案是我在哪里得到属性'lang'值列表 - wh在标准覆盖这个,为SEO优化?



正如你所看到的,你只需要遵循 BCP 47 ,并从语言标签注册表



因此 da-GL 是一个 hreflang / lang 的有效值:


  1. da 语言的子标签丹麦语

  2. - 子标记分隔符

  3. GL 区域的子标签格陵兰


I'm internationalizing a large website in 14 languages.

I have found that some of the language/countries we want to target do not have lang-cc entries in various lists, e.g. dot net cultures, language-codes-and-iso-country-codes-for-html5.

As an example, Danish is widely spoken in Greenland.

We are translating our site in to Danish for users in Denmark.

It therefore makes sense to offer the translated content to Danish speakers in Greenland, however the lang/country code for this is not listed in resources we have found (especially as Google Greenland exists - google.gl).

So, can we safely use da-gl in hreflang and as a sub directory to target Danish speakers in Greenland even though that combination is not listed in the various resources we've found?

(Please note that we can't simply redirect users from Greenland to the Danish version targeted at Denmark as there are differences in currency and shipping prices, and we are trying to avoid any IP based redirection / content customisation.)

解决方案

There is no list of "valid" combinations, as nobody can (nor should!) define which languages are spoken in which regions, or which linguistic variations exist.

HTML5 defines which content the hreflang attribute can have:

On Webmasters SE, I explained what this means (for the lang attribute, but it’s the same for hreflang): my answer to "Where do I get a list of attribute 'lang' values - what standard covers this, for SEO optimization?"

As you see, you only have to follow the rules from BCP 47 and choose tags from the Language Subtag Registry.

Thus da-GL is a valid value for hreflang/lang:

  1. da is the subtag for the language Danish
  2. - is the subtag separator
  3. GL is the subtag for the region Greenland

这篇关于我可以在hreflang中使用自定义语言/国家/地区代码组合吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆