From a50b6c45ca90dbed6bf615a3d34b3d5b440239f1 Mon Sep 17 00:00:00 2001 From: Kevin CHEN <33132228+KevinZonda@users.noreply.github.com> Date: Sat, 4 Sep 2021 15:56:54 +0100 Subject: Fix a typo in Web/API/HTMLCanvasElement/getContext, zh-CN (#2315) fix #1156 --- files/zh-cn/web/api/htmlcanvaselement/getcontext/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'files/zh-cn/web/api') diff --git a/files/zh-cn/web/api/htmlcanvaselement/getcontext/index.html b/files/zh-cn/web/api/htmlcanvaselement/getcontext/index.html index 07c0e6820c..b33d9bf95c 100644 --- a/files/zh-cn/web/api/htmlcanvaselement/getcontext/index.html +++ b/files/zh-cn/web/api/htmlcanvaselement/getcontext/index.html @@ -78,7 +78,7 @@ var ctx = canvas.getContext(contextType, contextA
  • -

    premultipliedAlpha: 表明排版引擎讲假设绘制缓冲区包含预混合alpha通道的{{jsxref("boolean")}}值。

    +

    premultipliedAlpha: 表明排版引擎将假设绘制缓冲区包含预混合alpha通道的{{jsxref("boolean")}}值。

  • preserveDrawingBuffer: 如果这个值为{{jsxref("true")}}缓冲区将不会被清除,会保存下来,直到被清除或被使用者覆盖。

    -- cgit v1.2.3-54-g00ecf From 9fc2dfcce134d40437620b5b63e09ca2b397f720 Mon Sep 17 00:00:00 2001 From: Robert Zhao <52877222+zhao-robert@users.noreply.github.com> Date: Sat, 4 Sep 2021 23:55:16 +0800 Subject: Add Web/API/Navigator/language, zh-CN (#2327) * add zh-cn/web/api/navigator/language * Update zh-cn/web/api/navigator/language Modify an incorrectly used period. * add spaces to web/api/navigator/language --- files/zh-cn/web/api/navigator/language/index.html | 50 +++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 files/zh-cn/web/api/navigator/language/index.html (limited to 'files/zh-cn/web/api') diff --git a/files/zh-cn/web/api/navigator/language/index.html b/files/zh-cn/web/api/navigator/language/index.html new file mode 100644 index 0000000000..a4e3508ec7 --- /dev/null +++ b/files/zh-cn/web/api/navigator/language/index.html @@ -0,0 +1,50 @@ +--- +title: Navigator.language +slug: Web/API/Navigator/language +tags: + - API + - Language + - Navigator + - Property + - Read-only + - Reference +browser-compat: api.Navigator.language +translation_of: Web/API/Navigator/language +--- +
    {{APIRef("HTML DOM")}}
    + +

    Navigator.language 为只读属性,返回一个表示用户偏好语言(通常是浏览器界面语言)的字符串。

    + +

    语法

    + +
    const lang = navigator.language
    +
    + +

    + +

    一个 {{domxref("DOMString")}}。lang存储了一个在 BCP 47 中定义的语言版本。一些有效的语言版本代码示例包括: “en”、“en-US”、“fr”、“fr-FR”、“es-ES” 等。

    + +

    请注意,在 iOS 10.2 之前的 Safari 中,返回的语言版本代码是小写的: “en-us”、“fr-fr” 等。

    + +

    示例

    + +
    if (/^en\b/.test(navigator.language)) {
    +  doLangSelect(window.navigator.language);
    +}
    +
    + +

    规格

    + +{{Specifications}} + +

    浏览器兼容性

    + +

    {{Compat}}

    + +

    更多参见

    + + -- cgit v1.2.3-54-g00ecf From ef22c6b7659e5df135eb68f05a2e2e93f7dcb8a5 Mon Sep 17 00:00:00 2001 From: Kevin CHEN <33132228+KevinZonda@users.noreply.github.com> Date: Sat, 4 Sep 2021 20:06:04 +0100 Subject: Fix syntax highlight in Web/API/URL/searchParams, zh-CN (#2319) * add syntax highlight * remove duplicate tag --- files/zh-cn/web/api/url/searchparams/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'files/zh-cn/web/api') diff --git a/files/zh-cn/web/api/url/searchparams/index.html b/files/zh-cn/web/api/url/searchparams/index.html index d4d775aed0..f782dc15c4 100644 --- a/files/zh-cn/web/api/url/searchparams/index.html +++ b/files/zh-cn/web/api/url/searchparams/index.html @@ -18,7 +18,7 @@ translation_of: Web/API/URL/searchParams

    语法

    -
    const urlSearchParams = url.searchParams
    +
    const urlSearchParams = url.searchParams

    属性值

    -- cgit v1.2.3-54-g00ecf From 5394433d6158422292de835dbcc55e75821bbe7b Mon Sep 17 00:00:00 2001 From: Kevin CHEN <33132228+KevinZonda@users.noreply.github.com> Date: Sat, 4 Sep 2021 20:08:01 +0100 Subject: Fix example code in Web/API/URL/searchParams, zh-CN (#2320) * fix #150 * Update index.html --- files/zh-cn/web/api/url/searchparams/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'files/zh-cn/web/api') diff --git a/files/zh-cn/web/api/url/searchparams/index.html b/files/zh-cn/web/api/url/searchparams/index.html index f782dc15c4..a3ac04aded 100644 --- a/files/zh-cn/web/api/url/searchparams/index.html +++ b/files/zh-cn/web/api/url/searchparams/index.html @@ -26,7 +26,7 @@ translation_of: Web/API/URL/searchParams

    例子

    -

    如果你的 URL 是 https://example.com/?name=Jonathan&age=18 ,你可以这样解析 URL,然后得到 nameage 的值。

    +

    如果你的 URL 是 https://example.com/?name=Jonathan%20Smith&age=18 ,你可以这样解析 URL,然后得到 nameage 的值。

    let params = (new URL(document.location)).searchParams;
     let name = params.get('name'); // is the string "Jonathan Smith".
    -- 
    cgit v1.2.3-54-g00ecf