Skip to content

Universal Style Guide

Resi Respati edited this page Apr 26, 2023 · 8 revisions

This repo describes rules that should be applied to all languages.

NOTE TO MAINTAINERS: You may want to translate this guide so that it can be more accessible to your translators.

Heading IDs

All headings have explicit IDs like this:

## Try React {#try-react}

Do not translate these IDs! They are used for navigation and will break if the document is referred to externally, i.e.:

See the [beginning section](/getting-started#try-react) for more information.

✅ DO:

## Prueba React {#try-react}

❌ DON'T:

## Prueba React {#prueba-react}

This will break the link above.

Text in Code Blocks

You may translate text in strings & comments, but be careful not to translate strings that refer to code!

Example:

// Example
const element = <h1>Hello, world</h1>;
ReactDOM.render(element, document.getElementById('root'));

✅ DO:

// Ejemplo
const element = <h1>Hola mundo</h1>;
ReactDOM.render(element, document.getElementById('root'));

❌ DON'T:

// Ejemplo
const element = <h1>Hola mundo</h1>;
// "root" refers to an element ID.
// DO NOT TRANSLATE
ReactDOM.render(element, document.getElementById('raíz'));

❌ DEFINITELY DON'T:

// Ejemplo
const elemento = <h1>Hola mundo</h1>;
ReactDOM.hacer(elemento, documento.obtenerElementoPorId('raíz'));

External Links

If an external link is to an article in a reference like MDN or Wikipedia, and a version of that article exists in your language that is of decent quality, consider linking to that version instead.

Example:

React elements are [immutable](https://en.wikipedia.org/wiki/Immutable_object).

✅ OK:

Los elementos de React son [inmutables](https://es.wikipedia.org/wiki/Objeto_inmutable).

For links that have no equivalent (Stack Overflow, YouTube videos, etc.), just use the English link.

Indonesian-Specific Style Guide

The following contains style guide specific for the Indonesian translation.

Loanwords in Heading

If a heading contains loanwords, don't italicise the loanword.

✅ DO:

## Linting {/*linting*/}

❌ DON'T:

## *Linting* {/*linting*/}