Intl.DisplayNames是ECMAScript 2021(ES2021)中引入的一个新的国际化API,它可以用于获取特定语言环境下的字符串表示。 以下是一个简单的示例,展示如何使用Intl.DisplayNames对象将英文字符串翻译成中文: 代码语言:javascript 复制 const displayNames = new Intl.DisplayNames(['zh-Hans-CN'], { type: 'language'...
[印记中文](https://docschina.org/) - React 中文文档. Contribute to docschina/zh-hans.reactjs.org development by creating an account on GitHub.
所以,“zh”依然可以作为主语言,然后在extlang的位置标示方言,即这样的格式。同时它也支持直接把方言作为主语言使用,即这样的格式。 弄清方言带来的困惑之后,我个人的建议是使用“zh”作为主语言。我不想进行政治讨论也不想研究深奥的学术问题,建议只使用“zh”做主语言子标签的唯一理由是避免混乱。现在为数不多(就...
Simplified Chinese translation of Gatsbyjs.org. Contribute to gatsbyjs/gatsby-zh-Hans development by creating an account on GitHub.
例如:zh表示中文,en表示英语,mai表示迈蒂利语。 详细取值范围,请查阅ISO 639(ISO制定的语言编码标准)。 文字 表示设备使用的文字类型,由1个大写字母(首字母)和3个小写字母组成。例如:Hans表示简体中文,Hant表示繁体中文。 详细取值范围,请查阅ISO 15924(ISO制定的文字编码标准)。 国家或地区 表示用...
importReactfrom'react';importReactDOMfrom'react-dom';importAppfrom'./App';import{IntlProvider}from'react-intl';ReactDOM.render(<IntlProvider locale="zh-Hans-CN"><App/></IntlProvider>,document.getElementById('root')); 上面的代码中,我们将本地化设置为简体中文。
Description Learn JS Programming "The Easy Way" with this Detailed Programming Tutorial designed with Simplicity in Mind. Suited for everybody from Beginners to Professionals Whether you want to learn JavaScript Programming as a Hobby, for School/College, or want to build a Career in the field, ...
在文件组织中指定的i18n文件夹内放置语言资源文件,其中语言资源文件的命名是由语言、文字、国家或地区的限定词通过中划线连接组成,其中文字和国家或地区可以省略,如zh-Hant-HK(中国香港地区使用的繁体中文)、zh-CN(中国使用的简体中文)、zh(中文)。命名规则如下:...
let scriptNames = new Intl.DisplayNames(['zh-CN'], {type: 'script'}); scriptNames.of('Hans'); // 简体 scriptNames.of('Latn'); // 拉丁文 scriptNames = new Intl.DisplayNames(['en'], {type: 'script'}); scriptNames.of('Hans'); // Simplified ...
letscriptNames=newIntl.DisplayNames(['zh-CN'], {type: 'script'});scriptNames.of('Hans'); // 简体scriptNames.of('Latn'); // 拉丁文scriptNames=newIntl.DisplayNames(['en'], {type: 'script'});scriptNames.of('Hans'); // SimplifiedscriptNames.of('Latn'); // Latin ...