Skip to content

Commit

Permalink
Merge branch 'main' into update-redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
yin1999 authored Nov 18, 2023
2 parents 5d3e6ba + a763571 commit a84db2d
Show file tree
Hide file tree
Showing 841 changed files with 9,382 additions and 6,337 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
23 changes: 19 additions & 4 deletions 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 @@ -1648,6 +1648,7 @@
/es/docs/Web/API/File/Using_files_from_web_applications /es/docs/Web/API/File_API/Using_files_from_web_applications
/es/docs/Web/API/File/fileName /es/docs/web/api/file/name
/es/docs/Web/API/FileReader/onload /es/docs/Web/API/FileReader/load_event
/es/docs/Web/API/FormData/Using_FormData_Objects /es/docs/Web/API/XMLHttpRequest_API/Using_FormData_Objects
/es/docs/Web/API/Geolocalización /es/docs/Web/API/Geolocation
/es/docs/Web/API/Geolocation.clearWatch /es/docs/Web/API/Geolocation/clearWatch
/es/docs/Web/API/Geolocation.getCurrentPosition /es/docs/Web/API/Geolocation/getCurrentPosition
Expand Down Expand Up @@ -1748,7 +1749,20 @@
/es/docs/Web/API/WindowTimers/setTimeout /es/docs/Web/API/setTimeout
/es/docs/Web/API/XMLDocument/async /es/docs/Web/API/XMLDocument
/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 Expand Up @@ -1968,7 +1982,7 @@
/es/docs/Web/Guide/HTML/categorias_de_contenido /es/docs/Web/HTML/Content_categories
/es/docs/Web/Guide/Movil /es/docs/Web/Guide/Mobile
/es/docs/Web/Guide/Performance/Usando_web_workers /es/docs/Web/API/Web_Workers_API/Using_web_workers
/es/docs/Web/Guide/Usando_Objetos_FormData /es/docs/Web/API/FormData/Using_FormData_Objects
/es/docs/Web/Guide/Usando_Objetos_FormData /es/docs/Web/API/XMLHttpRequest_API/Using_FormData_Objects
/es/docs/Web/HTML/Atributos /es/docs/Web/HTML/Attributes
/es/docs/Web/HTML/Atributos/accept /es/docs/Web/HTML/Attributes/accept
/es/docs/Web/HTML/Atributos/min /es/docs/Web/HTML/Attributes/min
Expand Down Expand Up @@ -2288,6 +2302,7 @@
/es/docs/Web/JavaScript/Language_Resources /es/docs/conflicting/Web/JavaScript/JavaScript_technologies_overview
/es/docs/Web/JavaScript/Primeros_Pasos /es/docs/Learn/Getting_started_with_the_web/JavaScript_basics
/es/docs/Web/JavaScript/Reference/About /es/docs/conflicting/Web/JavaScript/Reference
/es/docs/Web/JavaScript/Reference/Classes/Private_class_fields /es/docs/Web/JavaScript/Reference/Classes/Private_properties
/es/docs/Web/JavaScript/Reference/Errors/Bad_octal /es/docs/Web/JavaScript/Reference/Errors/Deprecated_octal
/es/docs/Web/JavaScript/Reference/Errors/Falta_puntoycoma_antes_de_declaracion /es/docs/Web/JavaScript/Reference/Errors/Missing_semicolon_before_statement
/es/docs/Web/JavaScript/Reference/Errors/Indicador_regexp_no-val /es/docs/Web/JavaScript/Reference/Errors/Bad_regexp_flag
Expand All @@ -2314,7 +2329,7 @@
/es/docs/Web/JavaScript/Referencia/Características_Despreciadas /es/docs/web/javascript/reference/deprecated_and_obsolete_features
/es/docs/Web/JavaScript/Referencia/Classes /es/docs/Web/JavaScript/Reference/Classes
/es/docs/Web/JavaScript/Referencia/Classes/Class_fields /es/docs/Web/JavaScript/Reference/Classes/Public_class_fields
/es/docs/Web/JavaScript/Referencia/Classes/Private_class_fields /es/docs/Web/JavaScript/Reference/Classes/Private_class_fields
/es/docs/Web/JavaScript/Referencia/Classes/Private_class_fields /es/docs/Web/JavaScript/Reference/Classes/Private_properties
/es/docs/Web/JavaScript/Referencia/Classes/constructor /es/docs/Web/JavaScript/Reference/Classes/constructor
/es/docs/Web/JavaScript/Referencia/Classes/extends /es/docs/Web/JavaScript/Reference/Classes/extends
/es/docs/Web/JavaScript/Referencia/Classes/static /es/docs/Web/JavaScript/Reference/Classes/static
Expand Down Expand Up @@ -2850,7 +2865,7 @@
/es/docs/XHTML /es/docs/Glossary/XHTML
/es/docs/XMLHttpRequest /es/docs/Web/API/XMLHttpRequest
/es/docs/XMLHttpRequest/FormData /es/docs/Web/API/FormData
/es/docs/XMLHttpRequest/Using_XMLHttpRequest /es/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest
/es/docs/XMLHttpRequest/Using_XMLHttpRequest /es/docs/Web/API/XMLHttpRequest_API/Using_XMLHttpRequest
/es/docs/XMLHttpRequest/abort /es/docs/Web/API/XMLHttpRequest/abort
/es/docs/XMLHttpRequest/onreadystatechange /es/docs/Web/API/XMLHttpRequest/readystatechange_event
/es/docs/XPath /es/docs/Web/XPath
Expand Down
66 changes: 33 additions & 33 deletions files/es/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -4251,10 +4251,6 @@
"marco_mucino"
]
},
"Web/API/FormData/Using_FormData_Objects": {
"modified": "2019-03-23T23:19:26.530Z",
"contributors": ["ramingar", "Siro_Diaz", "wilo"]
},
"Web/API/Fullscreen_API": {
"modified": "2019-03-23T22:19:43.566Z",
"contributors": ["wbamberg", "israel-munoz"]
Expand Down Expand Up @@ -5646,22 +5642,6 @@
"Jorolo"
]
},
"Web/API/XMLHttpRequest/Using_XMLHttpRequest": {
"modified": "2020-03-17T04:09:47.273Z",
"contributors": [
"jccuevas",
"camsa",
"david_ru",
"cesaruve",
"Sheppy",
"Sebastianz",
"iiegor",
"javierdp",
"bardackx",
"teoli",
"inma_610"
]
},
"Web/API/XMLHttpRequest/abort": {
"modified": "2019-03-23T22:12:16.683Z",
"contributors": ["Sheppy", "todomagichere"]
Expand All @@ -5678,6 +5658,26 @@
"modified": "2020-10-15T22:26:49.508Z",
"contributors": ["mmednik"]
},
"Web/API/XMLHttpRequest_API/Using_FormData_Objects": {
"modified": "2019-03-23T23:19:26.530Z",
"contributors": ["ramingar", "Siro_Diaz", "wilo"]
},
"Web/API/XMLHttpRequest_API/Using_XMLHttpRequest": {
"modified": "2020-03-17T04:09:47.273Z",
"contributors": [
"jccuevas",
"camsa",
"david_ru",
"cesaruve",
"Sheppy",
"Sebastianz",
"iiegor",
"javierdp",
"bardackx",
"teoli",
"inma_610"
]
},
"Web/API/atob": {
"modified": "2019-03-23T23:03:12.715Z",
"contributors": ["fscholz", "sathyasanles"]
Expand All @@ -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 Expand Up @@ -10575,7 +10575,7 @@
"GoToLoop"
]
},
"Web/JavaScript/Reference/Classes/Private_class_fields": {
"Web/JavaScript/Reference/Classes/Private_properties": {
"modified": "2020-10-15T22:33:54.045Z",
"contributors": ["aronvx"]
},
Expand Down
2 changes: 2 additions & 0 deletions files/es/glossary/abstraction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Abstracción
slug: Glossary/Abstraction
---

{{GlossarySidebar}}

En {{Glossary("computer programming", "programación")}}, una abstracción es una manera de reducir la complejidad y permitir un diseño e implementación más eficientes en sistemas de software complejos. Oculta la dificultad técnica de los sistemas detrás de {{Glossary("API", "APIs")}} más simples.

## Ventajas de la Abstracción
Expand Down
2 changes: 2 additions & 0 deletions files/es/glossary/accessibility/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Accesibilidad
slug: Glossary/Accessibility
---

{{GlossarySidebar}}

_La accesibilidad web_ (**A11Y**) hace referencia a las buenas prácticas para mantener la usabilidad de un sitio web a pesar de las restricciones físicas y técnicas. La accesibilidad web se define formalmente y es discutida en el {{Glossary("W3C")}} a través del {{Glossary("WAI","Web Accessibility Initiative")}} (WAI).

## Saber más
Expand Down
17 changes: 7 additions & 10 deletions files/es/glossary/accessibility_tree/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Árbol de accesibilidad (AOM)
slug: Glossary/Accessibility_tree
---

{{GlossarySidebar}}

El **árbol de accesibilidad** o **modelo de objeto de accesibillidad (AOM)**, contiene información relacionada con {{Glossary("accessibility")}} para la mayoría de los elementos HTML.

Los navegadores convierten el lenguaje markup en una representación interna denominada _[DOM tree](/es/docs/Web/API/Document_object_model/How_to_create_a_DOM_tree)_ (árbol DOM). El árbol DOM contiene objetos para todos los elementos de markup, atributos y nodos de texto. Luego, los navegadores crean un árbol de accesibilidad basado en el árbol de DOM, el cual es usado por Accessibility APIs de plataformas específicas para las tecnologías asistenciales como los lectores de pantalla.
Expand All @@ -20,13 +22,8 @@ Hay cuatro elementos en un árbol de objeto de accesibilidad:

Además, el árbol de accesibilidad usualmente contiene información sobre lo que se puede hacer con un elemento: _seguir_ un enlace, _completar_ un cuadro de texto, etc.

<section id="Quick_links">
<ol>
<li><a href="/es/docs/Glossary">Glossary</a>
<ol>
<li>{{Glossary("Accessibility")}}</li>
<li>{{Glossary("ARIA")}}</li>
</ol>
</li>
</ol>
</section>
## Véase también

- [Glosario de MDN Web Docs](/es/docs/Glossary)
- {{Glossary("Accessibility")}}
- {{Glossary("ARIA")}}
2 changes: 2 additions & 0 deletions files/es/glossary/adobe_flash/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Adobe Flash
slug: Glossary/Adobe_Flash
---

{{GlossarySidebar}}

Flash es una tecnología obsolescente desarrollada por Adobe que hace posible crear aplicaciones Web ricas, gráficos vectoriales y multimedia. Para utilizar Flash dentro de un {{Glossary("Browser","web browser")}} es necesario instalar el complemento adecuado.

## Aprende más
Expand Down
2 changes: 2 additions & 0 deletions files/es/glossary/ajax/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: AJAX
slug: Glossary/AJAX
---

{{GlossarySidebar}}

AJAX (de las siglas en Inglés **A**synchronous {{glossary("JavaScript")}} **A**nd {{glossary("XML")}} ) es una práctica de programación utilizada para construir páginas web más complejas y dinámicas, utilizando una tecnología conocida como {{Glossary("XHR_(XMLHttpRequest)","XMLHttpRequest")}}.

Lo que AJAX nos permite hacer, es modificar partes específicas del {{Glossary("DOM")}} de una página {{Glossary("HTML")}} sin la necesidad de refrescar la página entera. AJAX tambien nos permite trabajar asincrónicamente; esto significa que tu código seguirá corriendo mientras esa parte de la página de tu sitio web intenta recargarse (en comparación, una carga síncrona bloquearía tu código hasta que esa parte de la página web terminara de recargarse)
Expand Down
Loading

0 comments on commit a84db2d

Please sign in to comment.