Urgent.News

What's breaking now, across thousands of outlets.

Tech

How to translate MDN web docs to spanish.

Good day, for the past 3 weeks I have been busy translating the popular documentation platform known as MDN web docs into the Spanish version, to help Spanish-speaking readers as it had been outdated for years with respect to the English version. This has been part of my open-source journey. In this article, I want to talk about the process, to enable future contributors to seamlessly contribute…

Good day, for the past 3 weeks I have been dedicating my time to translating the widely used documentation site known as MDN web docs into Spanish, with the aim of assisting Spanish-speaking readers who had been using outdated versions of the English documentation. This effort is part of my open-source commitment. In this article, I would like to discuss the process involved, so that future contributors can smoothly join in the future.

Here are the guidelines to follow when undertaking the Spanish translation work. The following are the essential points to keep in mind:

1. File Paths: Never translate file paths, whether bolded or inline. They remain unchanged. For example, "docs/Web/JavaScript/Reference/Global_Objects/Object/assign" remains the same in both English and Spanish.

2. Front-matter: The final front-matter should only include: title, slug, l10n.sourceCommit, and short-title (if present in the English file). Remove page-type, sidebar, and original_slug.

3. Translations:

- Title and short-title: Translate to Spanish.

- Slug: Do not translate; keep it exactly as it is in English.

- l10n.sourceCommit: Set it to the exact SHA given for that English source commit.

4. Links:

- External links: Leave them as they are, pointing to external web pages. For example, https://validator.w3.org/

- Internal links: Change all internal links pointing to MDN web docs pages from /en-US/ to /es/. For example, "/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign" becomes "/es/docs/Web/JavaScript/Reference/Global_Objects/Object/assign".

- Link Text: Only translate the visible label when it's an internal MDN link. For example, "[Object basics](/en-US/docs/Learn_web_development/Core/Scripting/Object_basics)" becomes "[Fundamentos de objetos](/es/docs/Learn_web_development/Core/Scripting/Object_basics)".

5. Anchors: When using anchors like "#heading_about_a_paragraph", ensure you check if the section it refers to exists. If it does, translate the text content, but keep the anchor itself unchanged. For example, "#encabezado_sobre_un_párrafo".

6. Typography: Keep bold and italic markers in the same place, only translating the text content. If text was bold in English, it should remain bold in Spanish.

7. Images: Do not copy images into the files/es/ folder, as the build process pulls them from the English folder automatically. Only translate the alt text (the [...] part), and keep the filename or filepath as-is.

8. Callouts: In GitHub markdown, callouts such as [!NOTE] and [!WARNING] should not be translated, as translating them would break the styled box. Only translate the user-facing text content within the box.

9. Code: Plain code blocks containing literal data, such as URLs, should remain the same in the Spanish file. No changes should be made to URLs, formatting, or any accompanying comments.

10. HTML: Table tags (table, tr, th, etc.) remain unchanged; only the visible text inside the table needs to be translated.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Thursday 3 September →