Skip to content

Commit

Permalink
Merge branch 'main' into Notification
Browse files Browse the repository at this point in the history
  • Loading branch information
skyclouds2001 authored Nov 20, 2023
2 parents e17653c + c4d1672 commit cc01af5
Show file tree
Hide file tree
Showing 643 changed files with 15,164 additions and 6,451 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/pr-check_redirects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ on:
pull_request:
branches:
- main
paths:
- .nvmrc
- files/**
- .github/workflows/pr-check_redirects.yml

jobs:
check_redirects:
Expand All @@ -18,19 +14,35 @@ jobs:
steps:
- uses: actions/checkout@v4

# This is a "required" workflow so path filtering can not be used:
# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks
# We have to rely on a custom filtering mechanism to run the checks only if required files are modified.
- uses: dorny/paths-filter@v2
name: See if any file needs checking
id: filter
with:
filters: |
required_files:
- ".nvmrc"
- "files/**"
- ".github/workflows/pr-check_redirects.yml"
- uses: actions/checkout@v4
if: steps.filter.outputs.required_files == 'true'
with:
repository: mdn/content
path: mdn/content

- name: Setup Node.js environment
if: steps.filter.outputs.required_files == 'true'
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"
cache-dependency-path: mdn/content/yarn.lock

- name: Install all yarn packages
if: steps.filter.outputs.required_files == 'true'
working-directory: ${{ github.workspace }}/mdn/content
run: |
yarn --frozen-lockfile
Expand All @@ -39,6 +51,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check redirects file(s)
if: steps.filter.outputs.required_files == 'true'
env:
CONTENT_ROOT: ${{ github.workspace }}/mdn/content/files
CONTENT_TRANSLATED_ROOT: ${{ github.workspace }}/files
Expand Down
38 changes: 12 additions & 26 deletions docs/zh-cn/translation-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,20 @@
## 元数据

每个文档的开头都会有元数据,大致的结构如下
每个文档的开头都会有元数据,但在翻译本地化文档时,我们不需要将上游文档中的所有元数据字段都复制到本地化文档中。对于 `page-type``browser-compat``spec-urls` 等元数据被用于站点管理和自动化数据处理,本地化文档中无需包含它们。此外,出于追踪文档同步情况的目的,我们在基本的元数据类别的基础上引入了 `l10n.sourceCommit`,用于记录对应英文文档的最新提交。本地化文档中应该使用的元数据说明如下

```yaml
---
title: atob() global function
short-title: atob()
slug: Web/API/atob
page-type: web-api-global-function
browser-compat: api.atob
---
```

其中:

- `title` 为文档的大标题
- `short-title` 为显示在侧边栏和面包屑中的短标题
- `slug` 为与网页 URL 相关的元数据(URL path 部分的规则为:`/<locale>/docs/<slug>`
- `page-type` 为页面的类型,将被用于站点管理和自动化数据处理
- `browser-compat`[**浏览器兼容性表**][]对应的宏所使用的元数据

在简体中文文档翻译中,请适当翻译 `title` 元数据,以方便他人根据标题检索内容,`slug` 元数据则应与翻译对应的英文文档保持不变。对于 `page-type``browser-compat` 以及部分文档中使用的 `spec-urls` 元数据,它们被用于站点管理和自动化数据处理,而 yari 平台会自动将这些元数据由英文文档合并到本地化文档中。若没有特殊的需要,请将这些元数据从简体中文文档中移除。对于 `short-title`,如果简体中文文档采用的短标题与英文文档相同,则无需添加(仅在使用与英文文档*不同*的短标题时添加该元数据)。
- `title`(必须):为文档的大标题
- `short-title`(可选):为显示在侧边栏和面包屑中的短标题,若本地化文档采用的短标题与英文文档相同,则无需添加该元数据
- `slug`(必须):为与网页 URL 相关的元数据(URL path 部分的规则为:`/<locale>/docs/<slug>`),请与对应的英文文档保持一致
- `l10n.sourceCommit`(可选):为对应英文文档的最新提交的 SHA 值,请在完整同步英文文档翻译后更新或添加该元数据

最终在简体中文文档中呈现的元数据如下所示:

```yaml
title: atob() 全局函数
slug: Web/API/atob
title: HTMLAnchorElement:hash 属性
slug: Web/API/HTMLAnchorElement/hash
l10n:
sourceCommit: a3d9f61a8990ba7b53bda9748d1f26a9e9810b18
```
## 翻译标题和 ID
Expand Down Expand Up @@ -80,13 +67,13 @@ If you are new to HTML, CSS, JavaScript, etc., try our [Learn web development](/
例如,对于以下链接:

```md
Reference to [Live sample macros](/en-US/docs/MDN/Structures/Live_samples#live_sample_macros).
Reference to [Live sample macros](/en-US/docs/MDN/Writing_guidelines/Page_structures/Live_samples#live_sample_macros).
```

请对应中文文档,更新其片段标识:

```md
参考:[运行实例宏](/zh-CN/docs/MDN/Structures/Live_samples#运行实例宏)。
参考:[运行实例宏](/zh-CN/docs/MDN/Writing_guidelines/Page_structures/Live_samples#运行实例宏)。
```

> 请注意,无论指向的本地化文档是否存在,都请让链接指向本地化文档。yari 平台可以在指向本地化文档的链接不存在的情况下,自动将其回落到对应英文版本的链接。
Expand Down Expand Up @@ -129,7 +116,7 @@ Reference to [Live sample macros](/en-US/docs/MDN/Structures/Live_samples#live_s

简体中文标点符号参考资源:

- [教育部《标点符号用法](https://www.moe.gov.cn/ewebeditor/uploadfile/2015/01/13/20150113091548267.pdf)
- [GB/T 15834―2011 标点符号用法](<https://people.ubuntu.com/~happyaron/l10n/GB(T)15834-2011.html>)
- [维基百科:标点符号](https://zh.wikipedia.org/zh-cn/标点符号)

### 中文和拉丁语系文字间加空格
Expand Down Expand Up @@ -208,5 +195,4 @@ Like this.
英文文档中使用了一些常见标题,为了保持简体中文文档的一致性,请在翻译时参考术语表中的[标题和表格的翻译](glossary.md#标题表格)

[如何使用 markdown 来撰写文档]: https://developer.mozilla.org/zh-CN/docs/MDN/Writing_guidelines/Howto/Markdown_in_MDN
[**浏览器兼容性表**]: https://developer.mozilla.org/zh-CN/docs/MDN/Writing_guidelines/Page_structures/Compatibility_tables
[运行实例]: https://developer.mozilla.org/zh-CN/docs/MDN/Writing_guidelines/Page_structures/Live_samples
14 changes: 13 additions & 1 deletion files/es/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,7 @@
/es/docs/Web/API/Canvas_API/A_basic_ray-caster /es/docs/orphaned/Web/API/Canvas_API/A_basic_ray-caster
/es/docs/Web/API/Canvas_API/Tutorial/Compositing/Ejemplo /es/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
/es/docs/Web/API/Canvas_API/Tutorial/Compositing/Example /es/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
/es/docs/Web/API/Console/tabla /es/docs/Web/API/console/table
/es/docs/Web/API/Console/tabla /es/docs/Web/API/console/table_static
/es/docs/Web/API/Constraint_validation/invalid_event /es/docs/Web/API/HTMLInputElement/invalid_event
/es/docs/Web/API/Coordinates /es/docs/Web/API/GeolocationCoordinates
/es/docs/Web/API/Coordinates/latitude /es/docs/Web/API/GeolocationCoordinates/latitude
Expand Down Expand Up @@ -1751,6 +1751,18 @@
/es/docs/Web/API/XMLHttpRequest/FormData /es/docs/Web/API/FormData
/es/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest /es/docs/Web/API/XMLHttpRequest_API/Using_XMLHttpRequest
/es/docs/Web/API/XMLHttpRequest/onreadystatechange /es/docs/Web/API/XMLHttpRequest/readystatechange_event
/es/docs/Web/API/console/assert /es/docs/Web/API/console/assert_static
/es/docs/Web/API/console/count /es/docs/Web/API/console/count_static
/es/docs/Web/API/console/dir /es/docs/Web/API/console/dir_static
/es/docs/Web/API/console/dirxml /es/docs/Web/API/console/dirxml_static
/es/docs/Web/API/console/error /es/docs/Web/API/console/error_static
/es/docs/Web/API/console/info /es/docs/Web/API/console/info_static
/es/docs/Web/API/console/log /es/docs/Web/API/console/log_static
/es/docs/Web/API/console/table /es/docs/Web/API/console/table_static
/es/docs/Web/API/console/time /es/docs/Web/API/console/time_static
/es/docs/Web/API/console/timeEnd /es/docs/Web/API/console/timeend_static
/es/docs/Web/API/console/trace /es/docs/Web/API/console/trace_static
/es/docs/Web/API/console/warn /es/docs/Web/API/console/warn_static
/es/docs/Web/API/event.defaultPrevented /es/docs/Web/API/Event/defaultPrevented
/es/docs/Web/API/event.which /es/docs/Web/API/UIEvent/which
/es/docs/Web/Accesibilidad /es/docs/Web/Accessibility
Expand Down
24 changes: 12 additions & 12 deletions files/es/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -5702,51 +5702,51 @@
"modified": "2019-08-30T08:42:12.082Z",
"contributors": ["ajuanjojjj", "fcanellas", "vlguerrero", "chrisdavidmills"]
},
"Web/API/console/assert": {
"Web/API/console/assert_static": {
"modified": "2019-03-23T22:47:53.587Z",
"contributors": ["Takumakun", "AlePerez92", "danycoro"]
},
"Web/API/console/count": {
"Web/API/console/count_static": {
"modified": "2019-03-23T22:07:26.644Z",
"contributors": ["deluxury", "roberbnd"]
},
"Web/API/console/dir": {
"Web/API/console/dir_static": {
"modified": "2020-11-11T11:46:41.122Z",
"contributors": ["jomoji", "laloptk"]
},
"Web/API/console/dirxml": {
"Web/API/console/dirxml_static": {
"modified": "2019-03-23T22:18:03.809Z",
"contributors": ["aeroxmotion"]
},
"Web/API/console/error": {
"Web/API/console/error_static": {
"modified": "2019-03-23T22:06:32.134Z",
"contributors": ["BrodaNoel"]
},
"Web/API/console/info": {
"Web/API/console/info_static": {
"modified": "2019-03-23T22:12:32.604Z",
"contributors": ["Lwissitoon"]
},
"Web/API/console/log": {
"Web/API/console/log_static": {
"modified": "2019-03-23T22:19:48.741Z",
"contributors": ["BrodaNoel", "fcanellas"]
},
"Web/API/console/table": {
"Web/API/console/table_static": {
"modified": "2019-03-23T22:20:30.589Z",
"contributors": ["AlePerez92"]
},
"Web/API/console/time": {
"Web/API/console/time_static": {
"modified": "2019-03-18T21:42:22.745Z",
"contributors": ["jotaoncode"]
},
"Web/API/console/timeEnd": {
"Web/API/console/timeend_static": {
"modified": "2020-10-15T22:13:11.825Z",
"contributors": ["xlhector10"]
},
"Web/API/console/trace": {
"Web/API/console/trace_static": {
"modified": "2019-03-23T22:22:51.545Z",
"contributors": ["Axl-Nolasco"]
},
"Web/API/console/warn": {
"Web/API/console/warn_static": {
"modified": "2020-10-15T21:53:36.780Z",
"contributors": ["juanluisrp", "oderflaj"]
},
Expand Down
90 changes: 45 additions & 45 deletions files/es/glossary/base64/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ function b64ToUint6(nChr) {
return nChr > 64 && nChr < 91
? nChr - 65
: nChr > 96 && nChr < 123
? nChr - 71
: nChr > 47 && nChr < 58
? nChr + 4
: nChr === 43
? 62
: nChr === 47
? 63
: 0;
? nChr - 71
: nChr > 47 && nChr < 58
? nChr + 4
: nChr === 43
? 62
: nChr === 47
? 63
: 0;
}

function base64DecToArr(sBase64, nBlocksSize) {
Expand Down Expand Up @@ -169,14 +169,14 @@ function uint6ToB64(nUint6) {
return nUint6 < 26
? nUint6 + 65
: nUint6 < 52
? nUint6 + 71
: nUint6 < 62
? nUint6 - 4
: nUint6 === 62
? 43
: nUint6 === 63
? 47
: 65;
? nUint6 + 71
: nUint6 < 62
? nUint6 - 4
: nUint6 === 62
? 43
: nUint6 === 63
? 47
: 65;
}

function base64EncArr(aBytes) {
Expand Down Expand Up @@ -224,27 +224,27 @@ function UTF8ArrToStr(aBytes) {
aBytes[++nIdx] -
128
: nPart > 247 && nPart < 252 && nIdx + 4 < nLen /* five bytes */
? ((nPart - 248) << 24) +
((aBytes[++nIdx] - 128) << 18) +
((aBytes[++nIdx] - 128) << 12) +
((aBytes[++nIdx] - 128) << 6) +
aBytes[++nIdx] -
128
: nPart > 239 && nPart < 248 && nIdx + 3 < nLen /* four bytes */
? ((nPart - 240) << 18) +
((aBytes[++nIdx] - 128) << 12) +
((aBytes[++nIdx] - 128) << 6) +
aBytes[++nIdx] -
128
: nPart > 223 && nPart < 240 && nIdx + 2 < nLen /* three bytes */
? ((nPart - 224) << 12) +
((aBytes[++nIdx] - 128) << 6) +
aBytes[++nIdx] -
128
: nPart > 191 && nPart < 224 && nIdx + 1 < nLen /* two bytes */
? ((nPart - 192) << 6) + aBytes[++nIdx] - 128
: /* nPart < 127 ? */ /* one byte */
nPart,
? ((nPart - 248) << 24) +
((aBytes[++nIdx] - 128) << 18) +
((aBytes[++nIdx] - 128) << 12) +
((aBytes[++nIdx] - 128) << 6) +
aBytes[++nIdx] -
128
: nPart > 239 && nPart < 248 && nIdx + 3 < nLen /* four bytes */
? ((nPart - 240) << 18) +
((aBytes[++nIdx] - 128) << 12) +
((aBytes[++nIdx] - 128) << 6) +
aBytes[++nIdx] -
128
: nPart > 223 && nPart < 240 && nIdx + 2 < nLen /* three bytes */
? ((nPart - 224) << 12) +
((aBytes[++nIdx] - 128) << 6) +
aBytes[++nIdx] -
128
: nPart > 191 && nPart < 224 && nIdx + 1 < nLen /* two bytes */
? ((nPart - 192) << 6) + aBytes[++nIdx] - 128
: /* nPart < 127 ? */ /* one byte */
nPart,
);
}

Expand All @@ -265,14 +265,14 @@ function strToUTF8Arr(sDOMStr) {
nChr < 0x80
? 1
: nChr < 0x800
? 2
: nChr < 0x10000
? 3
: nChr < 0x200000
? 4
: nChr < 0x4000000
? 5
: 6;
? 2
: nChr < 0x10000
? 3
: nChr < 0x200000
? 4
: nChr < 0x4000000
? 5
: 6;
}

aBytes = new Uint8Array(nArrLen);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Hemos _congelado_ todo el contenido localizado (lo que significa que no aceptare

### Español (es)

- Discusiones: [Matrix (canal #mdn-l10n-es)](https://chat.mozilla.org/#/room/#mdn-l10n-es:mozilla.org), [Telegram (canal MDN l10n ES)](https://t.me/+Dr6qKQCAepw4MjFj), [Discord (MDN Web Docs Community ,canal #spanish)](https://discord.gg/aZqEtMrbr7)
- Discusiones: [Matrix (canal #mdn-l10n-es)](https://chat.mozilla.org/#/room/#mdn-l10n-es:mozilla.org), [Telegram (canal MDN l10n ES)](https://t.me/+Dr6qKQCAepw4MjFj), [Discord (MDN Web Docs Community ,canal #spanish)](/discord)
- Colaboradores actuales: [Graywolf9](https://github.com/Graywolf9), [JuanVqz](https://github.com/JuanVqz), [Jalkhov](https://github.com/Jalkhov), [marcelozarate](https://github.com/marcelozarate), [davbrito](https://github.com/davbrito), [Vallejoanderson](https://github.com/Vallejoanderson).

> **Nota:** Si quiere hablar sobre la posibilidad de _descongelar_ una localización, las [directrices sobre lo que se requiere se pueden encontrar aquí](https://github.com/mdn/translated-content/blob/main/PEERS_GUIDELINES.md#activating-a-locale)
Expand Down
Loading

0 comments on commit cc01af5

Please sign in to comment.