Can I use custom language / country code combinations in hreflang?(我可以在 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:
hreflanga/area 的代码>hreflangfor链接
hreflangfora/areahreflangforlink
在 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-GL 是 hreflang/lang 的有效值:
Thus da-GL is a valid value for hreflang/lang:
da是 language 丹麦语 的子标签-是 子标签分隔符李>GL是 region 格陵兰 的子标签
dais the subtag for the language Danish-is the subtag separatorGLis the subtag for the region Greenland
这篇关于我可以在 hreflang 中使用自定义语言/国家代码组合吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:我可以在 hreflang 中使用自定义语言/国家代码组合吗?
基础教程推荐
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
