【问题标题】:HTML lang attribute: what is the role of the locale?HTML lang 属性:语言环境的作用是什么?
【发布时间】:2017-04-04 00:47:27
【问题描述】:

我知道lang 属性的作用是向相关软件指示页面或部分的语言。

某些语言还包括语言环境的可能性。在我的情况下,它会类似于 <html lang="en-au"> 在澳大利亚表示英语。

我已阅读:

What is lang attribute of the <html> tag used for?

但它根本没有提到locale,更不用说解释了。

问题是,如果有的话,语言环境是如何使用的?

【问题讨论】:

标签: html locale lang


【解决方案1】:

理想情况下,例如:

<input type="date" lang="en-AU" /> 

将配置输入以在澳大利亚可接受的方式显示日期。这与也使用英语的加拿大不同。

这就是答案。

【讨论】:

    【解决方案2】:

    关于语言和区域设置标识符的 W3C 规范:https://www.w3.org/TR/ltli/

    关于属性组成的 IETF 规范:http://www.ietf.org/rfc/rfc3066.txt

    它是系统/平台/操作系统/用户特定的,并且基于您使用的技术/语言,有多种方法可以确定它和它的使用情况。

    例如

    苹果/iOS:https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/InternationalizingLocaleData/InternationalizingLocaleData.html

    甲骨文: https://docs.oracle.com/cd/E23824_01/html/E26033/glmbx.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-09-22
      • 2020-04-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-22
      相关资源
      最近更新 更多