chore(i18n,docs): update translations (#43659)
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
# How to Test Translations Locally
|
||||
# Cómo probar las traducciones localmente
|
||||
|
||||
> [!NOTE] This process is not required, but documented in case you would like to preview what your translations will look like.
|
||||
> [!NOTE] Este proceso no es requerido, pero esta documentado en caso de que quieras previsualizar como lucirán tus traducciones.
|
||||
|
||||
If you would like to test your translations on a local instance of the freeCodeCamp `/learn` site, first ensure you have [set up the codebase](how-to-setup-freecodecamp-locally.md).
|
||||
En caso de que quieras probar tus traducciones en una instancia local del sitio `/learn` de freeCodeCamp, primero asegúrate de haber [configurado la base de código](how-to-setup-freecodecamp-locally.md).
|
||||
|
||||
## Enabling a Language
|
||||
## Habilitando un lenguage
|
||||
|
||||
There are a few steps to take in order to allow the codebase to build in your desired language.
|
||||
Hay algunos pasos a seguir para permitirle a la base de código compilar en tu lenguaje deseado.
|
||||
|
||||
First, visit the `config/i18n/all-langs.js` file to add the language to the available languages list and configure the values. There are four objects here.
|
||||
Primero, visita el archivo `config/i18n/all-langs.js` para añadir el lenguaje a la lista de lenguajes disponibles y configura los valores. Hay cuatro objetos aquí.
|
||||
|
||||
- `availableLangs`: For both the `client` and `curriculum` arrays, add the text name of the language. This is the value that will be used in the `.env` file later.
|
||||
- `i18nextCodes`: These are the ISO language codes for each language. You will need to add the appropriate ISO code for the language you are enabling. These do need to be unique for each language.
|
||||
- `langDisplayNames`: These are the display names for the language selector in the navigation menu.
|
||||
- `langCodes`: These are the language codes used for formatting dates and numbers. These should be Unicode CLDR codes instead of ISO codes.
|
||||
- `avaliableLangs`: Tanto para el arreglo `client` como para el arreglo `curriculum`, añade el nombre en texto del lenguaje. Este es el valor que se utilizará en el archivo `.env` más tarde.
|
||||
- `i18nextCodes`: Estos son los codigos de idioma ISO para cada lenguaje. Necesitarás añadir el codigo ISO apropiado para el lenguaje que estas habilitando. Estos deben ser únicos para cada lenguaje.
|
||||
- `langDisplayNames`: Estos son los nombres exhibidos para el selector de lenguajes en el menú de navegación.
|
||||
- `langCodes`: Estos son los códigos de idioma utilizados para el formateo de fechas y números. Estos deberían ser códigos Unicode CLDR en lugar de códigos ISO.
|
||||
|
||||
As an example, if you wanted to enable Dothraki as a language, your `all-langs.js` objects should look like this:
|
||||
Por ejemplo, si quisieras habilitar Dothraki como un lenguaje, tus objetos `all-langs.js` deberían verse así:
|
||||
|
||||
```js
|
||||
const availableLangs = {
|
||||
@@ -54,7 +54,7 @@ const langCodes = {
|
||||
};
|
||||
```
|
||||
|
||||
Next, open the `client/src/utils/algolia-locale-setup.js` file. This data is used for the search bar that loads `/news` articles. While it is unlikely that you are going to test this functionality, missing the data for your language can lead to errors when attempting to build the codebase locally.
|
||||
Ahora, abre el archivo `client/src/utils/algolia-locale-setup.js`. Estos datos son utilizados por la barra de búsqueda que carga artículos de `/news` (noticias). While it is unlikely that you are going to test this functionality, missing the data for your language can lead to errors when attempting to build the codebase locally.
|
||||
|
||||
Add an object for your language to the `algoliaIndices` object. You should use the values for the `english` object for local testing, replacing the `english` key with your language's `availableLangs` value.
|
||||
|
||||
|
Reference in New Issue
Block a user