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

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

问题描述

我正在用 14 种语言对一个大型网站进行国际化.

I'm internationalizing a large website in 14 languages.

我发现我们要定位的一些语言/国家在各种列表中没有 lang-cc 条目,例如dot net 文化、语言代码和 iso-country-codes-for-html5.

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.

因此,将翻译后的内容提供给格陵兰岛的丹麦语使用者是有意义的,但是我们找到的资源中并未列出此语言/国家/地区代码(尤其是存在 Google 格陵兰岛 - google.gl).

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).

那么,我们能否安全地使用 hreflang 中的 da-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?

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

(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 定义了 hreflang 属性可以包含哪些内容:

HTML5 defines which content the hreflang attribute can have:

  • hreflang for a/area
  • hreflang for link

在 Webmasters SE 上,我解释了这意味着什么(对于 lang 属性,但对于 hreflang 是相同的):我对我在哪里可以获得属性‘lang’值列表 - 什么标准涵盖这个,用于 SEO 优化?"的回答?

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?"

如您所见,您只需遵循 BCP 47 中的规则并从语言子标签注册表.

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

因此 da-GLhreflang/lang 的有效值:

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

  1. dalanguage 丹麦语
  2. 的子标签
  3. -子标签分隔符
  4. GLregion 格陵兰
  5. 的子标签
  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天全站免登陆