Skip to content

Commit 83b4700

Browse files
committed
feat: [es] New translation - docs/contributing/localization
Signed-off-by: carolina valencia <krol3@users.noreply.github.com>
1 parent f2a520b commit 83b4700

File tree

1 file changed

+355
-0
lines changed

1 file changed

+355
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,355 @@
1+
---
2+
---
3+
4+
title: Localización del sitio description: Creación y mantenimiento de páginas
5+
del sitio en localizaciones que no están en inglés. linkTitle: Localización
6+
weight: 25 cSpell:ignore: shortcodes default_lang_commit:
7+
f2a520b85d72db706bff91d879f5bb10fd2e7367
8+
9+
---
10+
11+
El sitio web de OTel utiliza el
12+
[framework multilingüe](https://gohugo.io/content-management/multilingual/) de
13+
Hugo para soportar la localización de páginas. El inglés es el idioma
14+
predeterminado, con inglés estadounidense como la localización predeterminada
15+
(implícita). Se admite un número creciente de otras localizaciones, como se
16+
puede ver en el menú desplegable de idiomas en la barra de navegación superior.
17+
18+
### Resumen
19+
20+
#### ✅ Hacer {#do}
21+
22+
<div class="border-start border-success bg-success-subtle">
23+
24+
- **Traducir**:
25+
- El contenido de la página, incluyendo:
26+
- Campos de texto en diagramas [Mermaid](#images)
27+
- Comentarios de código extraídos de extractos de código
28+
- Los valores de los campos de [Front matter][] para `title`, `linkTitle` y
29+
`description`
30+
- **Todo** el contenido de la página y el front matter, a menos que se indique
31+
lo contrario
32+
- **Preservar** el _contenido_, _significado_ y _estilo_ del texto original
33+
- **Consultar** a los [maintainers] si tienes dudas o preguntas a través de:
34+
- Canales de [Slack] `#otel-docs-localization` o `#otel-comms`
35+
- [Discussion], issue o comentario en un PR
36+
37+
[Discusión]:
38+
https://github.com/open-telemetry/opentelemetry.io/discussions?discussions_q=is%3Aopen+label%3Ai18n
39+
40+
</div>
41+
42+
#### ❌ No traducir {#do-not}
43+
44+
<div class="border-start border-warning bg-warning-subtle">
45+
46+
- **No traducir**:
47+
- **Nombres de archivos o directorios** de recursos en este repositorio
48+
- [Enlaces](#links), esto incluye los [IDs de encabezados](#headings).[^*]
49+
- Campos de [Front matter][] distintos a los mencionados en [Hacer](#do). En
50+
particular, no traduzcas `aliases`. Si tienes dudas, consulta a los
51+
maintainers.
52+
- Código
53+
- Crear **copias de imágenes**, a menos que
54+
[localices el texto dentro de las imágenes](#images)
55+
- Añadir o modificar:
56+
- **Contenido** que altere el significado original
57+
- Estilo de **presentación**, incluyendo: _formato_, _diseño_ y estilo de
58+
_diseño_ (por ejemplo, tipografía, uso de mayúsculas y espaciado).
59+
60+
[^*]: Para una posible excepción, consulta [Enlaces](#links).
61+
62+
</div>
63+
64+
### IDs de encabezados {#headings}
65+
66+
Para garantizar que los anclajes de los encabezados sean uniformes en todas las
67+
localizaciones, al traducir encabezados:
68+
69+
- Conserva el ID explícito del encabezado si lo tiene. La [sintaxis del ID de
70+
encabezado][] se escribe después del texto del encabezado usando la sintaxis
71+
`{ #un-id }`.
72+
- De lo contrario, declara explícitamente un ID de encabezado que corresponda al
73+
ID autogenerado del encabezado original en inglés.
74+
75+
[Sintaxis del ID de encabezado]:
76+
https://github.com/yuin/goldmark/blob/master/README.md#headings
77+
78+
### Links {#links}
79+
80+
Do **not** translate link references. This holds true for external links, and
81+
paths to website pages and section-local resources such as [images](#images).
82+
83+
The only exception is for links to external pages (such as
84+
<https://en.wikipedia.org>) that have a version specific to your local. Often
85+
this means replacing the `en` in the URL by your locale's language code.
86+
87+
{{% alert title="Note" %}}
88+
89+
The OTel website repository has a custom render-link hook that Hugo uses to
90+
convert absolute link paths referring to documentation pages. **Links of the
91+
form `/docs/some-page` are made locale specific** by prefixing the path with the
92+
page language code when rendering the link. For example, the previous sample
93+
path would become `/ja/docs/some-page` when rendered from a Japanese page.
94+
95+
{{% /alert %}}
96+
97+
### Images and diagrams {#images}
98+
99+
Do **not** make copies of image files unless you localize text in the image
100+
itself[^shared-images].
101+
102+
**Do** translate text in [Mermaid][] diagrams.
103+
104+
[^shared-images]:
105+
Hugo is smart about the way that it renders image files that are shared
106+
across site localizations. That is, Hugo will output a _single_ image file
107+
and share it across locales.
108+
109+
[Mermaid]: https://mermaid.js.org
110+
111+
### Include files {#includes}
112+
113+
**Do** translate page fragments found under `_includes` directories just as you
114+
would translate any other page content.
115+
116+
### Shortcodes
117+
118+
{{% alert title="Note" %}}
119+
120+
As of February 2025, we are in the process of migrating from shortcodes to
121+
[include files](#includes) as a means of supporting shared-page content.
122+
123+
{{% /alert %}}
124+
125+
Some of the base shortcodes contain English text that you might need to localize
126+
-- this is particularly true of those contained in [layouts/shortcodes/docs].
127+
128+
If you need to create a localized version of a shortcode, place it under
129+
`layouts/shortcodes/xx`, where `xx` is your localization's language code. From
130+
there, use the same relative path as the original base shortcode.
131+
132+
[layouts/shortcodes/docs]:
133+
https://github.com/open-telemetry/opentelemetry.io/tree/main/layouts/shortcodes/docs
134+
135+
## Keeping track of localized-page drift {#track-changes}
136+
137+
One of the main challenges of maintaining localized pages, is identifying when
138+
the corresponding English language pages have been updated. This section
139+
explains how we handle this.
140+
141+
### The `default_lang_commit` front-matter field
142+
143+
When a localized page is written, such as `content/zh/<some-path>/page.md`, this
144+
translation is based on a specific [`main` branch commit][main] of the
145+
corresponding English language version of the page at
146+
`content/en/<some-path>/page.md`. In this repository, every localized page
147+
identifies the English page commit in the localized page's front matter as
148+
follows:
149+
150+
```markdown
151+
---
152+
title: Your localized page title
153+
# ...
154+
default_lang_commit: <most-recent-commit-hash-of-default-language-page>
155+
---
156+
```
157+
158+
The front matter above would be in `content/zh/<some-path>/page.md`. The commit
159+
hash would correspond to the latest commit of `content/en/<some-path>/page.md`
160+
from the `main` branch.
161+
162+
### Tracking changes to English pages
163+
164+
As updates are made to English language pages, you can keep track of the
165+
corresponding localized pages that need updating by running the following
166+
command:
167+
168+
```console
169+
$ npm run check:i18n
170+
1 1 content/en/docs/platforms/kubernetes/_index.md - content/zh/docs/platforms/kubernetes/_index.md
171+
...
172+
```
173+
174+
You can restrict the target pages to one or more localizations by providing
175+
path(s) like this:
176+
177+
```sh
178+
npm run check:i18n -- content/zh
179+
```
180+
181+
### Viewing change details
182+
183+
For any given localized pages that need updating, you can see the diff details
184+
of the corresponding English language pages by using the `-d` flag and providing
185+
the paths to your localized pages, or omit the paths to see all. For example:
186+
187+
```console
188+
$ npm run check:i18n -- -d content/zh/docs/platforms/kubernetes
189+
diff --git a/content/en/docs/platforms/kubernetes/_index.md b/content/en/docs/platforms/kubernetes/_index.md
190+
index 3592df5d..c7980653 100644
191+
--- a/content/en/docs/platforms/kubernetes/_index.md
192+
+++ b/content/en/docs/platforms/kubernetes/_index.md
193+
@@ -1,7 +1,7 @@
194+
---
195+
title: OpenTelemetry with Kubernetes
196+
linkTitle: Kubernetes
197+
-weight: 11
198+
+weight: 350
199+
description: Using OpenTelemetry with Kubernetes
200+
---
201+
```
202+
203+
### Adding `default_lang_commit` to new pages
204+
205+
As you create pages for your localization, remember to add `default_lang_commit`
206+
to the page front matter along with an appropriate commit hash from `main`.
207+
208+
If your page translation is based on an English page in `main` at `<hash>`, then
209+
run the following command to automatically add `default_lang_commit` to your
210+
page file's front matter using the commit `<hash>`. You can specify `HEAD` as an
211+
argument if your pages are now synced with `main` at `HEAD`. For example:
212+
213+
```sh
214+
npm run check:i18n -- -n -c 1ca30b4d content/ja
215+
npm run check:i18n -- -n -c HEAD content/zh/docs/concepts
216+
```
217+
218+
To list localization page files with missing hash keys, run:
219+
220+
```sh
221+
npm run check:i18n -- -n
222+
```
223+
224+
### Updating `default_lang_commit` for existing pages
225+
226+
As you update your localized pages to match changes made to the corresponding
227+
English language page, ensure that you also update the `default_lang_commit`
228+
commit hash.
229+
230+
{{% alert title="Tip" %}}
231+
232+
If your localized page now corresponds to the English language version in `main`
233+
at `HEAD`, then erase the commit hash value in the front matter, and run the
234+
**add** command given in the previous section to automatically refresh the
235+
`default_lang_commit` field value.
236+
237+
{{% /alert %}}
238+
239+
If you have batch updated all of your localization pages that had drifted, you
240+
can update the commit hash of these files using the `-c` flag followed by a
241+
commit hash or 'HEAD' to use `main@HEAD`.
242+
243+
```sh
244+
npm run check:i18n -- -c <hash> <PATH-TO-YOUR-NEW-FILES>
245+
npm run check:i18n -- -c HEAD <PATH-TO-YOUR-NEW-FILES>
246+
```
247+
248+
{{% alert title="Important" %}}
249+
250+
When you use `HEAD` as a hash specifier, the script will use the hash of `main`
251+
at HEAD in your **local environment**. Make sure that you fetch and pull `main`,
252+
if you want HEAD to correspond to `main` in GitHub.
253+
254+
{{% /alert %}}
255+
256+
### Drift status
257+
258+
Run `npm run fix:i18n:status` to add a front-matter field `drifted_from_default`
259+
to those target localization pages that have drifted. This field will soon be
260+
used to display a banner at the top of pages that have drifted relative to their
261+
English counterparts.
262+
263+
### Script help
264+
265+
For more details about the script, run `npm run check:i18n -- -h`.
266+
267+
## New localizations
268+
269+
To start a new localization for the OpenTelemetry website,
270+
[raise an issue](https://github.com/open-telemetry/opentelemetry.io/issues/) to
271+
share your interest to contribute. Tag all other individuals that are willing to
272+
write and review translations in the language you want to add. **You need at
273+
least two potential contributors**, ideally three. Include the following task
274+
list in your issue as well:
275+
276+
```markdown
277+
- [ ] Contributors for the new language: @GITHUB_HANDLE1, @GITHUB_HANDLE2, ...
278+
- [ ] Localize site homepage to YOUR_LANGUAGE_NAME
279+
- [ ] Create an issue label for `lang:LANG_ID`
280+
- [ ] Create org-level group for `LANG_ID` approvers
281+
- [ ] Update components owners for `content/LANG_ID`
282+
- [ ] Set up spell checking, if a cSpell dictionary is available
283+
```
284+
285+
Notes:
286+
287+
- For `LANG_ID`, use an official
288+
[ISO 639-1 code](https://en.wikipedia.org/wiki/ISO_639-1) for the language you
289+
want to add.
290+
- Look for
291+
[cSpell dictionaries](https://github.com/streetsidesoftware/cspell-dicts)
292+
available as NPM packages
293+
[@cspell/dict-LANG_ID](https://www.npmjs.com/search?q=%40cspell%2Fdict). If a
294+
dictionary isn't available for your dialect or region, choose the closest
295+
region. For an example of how to set this up, see [PR #5386].
296+
297+
After you created that issue and have the required amount of contributors,
298+
maintainers will ask you to provide a pull request with a translation of the
299+
[index page](https://github.com/open-telemetry/opentelemetry.io/blob/main/content/en/_index.md).
300+
Make sure that maintainers are allowed to edit your PR, since they will add
301+
additional changes to your PR that are required to get your localization project
302+
started.
303+
304+
With your first PR merged maintainers will take care of setting up the issue
305+
label, the org-level group and the component owners.
306+
307+
{{% alert title="Important" color="warning" %}}
308+
309+
You don't have to be an existing contributor to the OpenTelemetry project, to
310+
start a new localization. However you will not be added as a member of the
311+
[OpenTelemetry GitHub organization](https://github.com/open-telemetry/) or as a
312+
member of the approvers group for your localization. You will need to satisfy
313+
the requirements for becoming an established member and approver as outlined in
314+
the
315+
[membership guidelines](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md).
316+
317+
When starting the localization project, maintainers will treat your reviews as
318+
if you are an approver already.
319+
320+
{{% /alert %}}
321+
322+
## English-language maintainer guidance
323+
324+
### When link checking fails for non-English pages
325+
326+
English is the default language of the OpenTelemetry website. After you add,
327+
edit, or reorganized English language documentation, link checking may fail for
328+
non-English pages. When this happens:
329+
330+
<!-- markdownlint-disable blanks-around-fences -->
331+
332+
- Do **not** fix the broken links. Each non-English page is associated with a
333+
specific commit of the corresponding English page, as identified by the git
334+
commit hash value of the `default_lang_commit` front matter key.
335+
- Configure the link checker to ignore the non-English pages by adding the
336+
following to the page's front matter, or to the closest common ancestor file,
337+
when more than one page has link errors:
338+
```yaml
339+
htmltest:
340+
# TODO: remove the IgnoreDirs once broken links are fixed
341+
IgnoreDirs:
342+
- path-regex/to/non-en/directory/contain/files/to/ignore
343+
- path-2-etc
344+
```
345+
- Run `npm run check:links` and include any updates to the `.htmltest.yml`
346+
config file with your PR.
347+
348+
<!-- markdownlint-enable blanks-around-fences -->
349+
350+
[front matter]: https://gohugo.io/content-management/front-matter/
351+
[main]: https://github.com/open-telemetry/opentelemetry.io/commits/main/
352+
[maintainers]: https://github.com/orgs/open-telemetry/teams/docs-maintainers
353+
[multilingual framework]: https://gohugo.io/content-management/multilingual/
354+
[PR #5386]: https://github.com/open-telemetry/opentelemetry.io/pull/5386/files
355+
[slack]: https://slack.cncf.io/

0 commit comments

Comments
 (0)