-
Notifications
You must be signed in to change notification settings - Fork 395
Multilingual Support #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Multilingual Support #151
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a3c0b6a
FAILED ATTEMPT 1
john-sp d930798
Multilingual works but Eng doesn't
john-sp 0efac81
Fix up translations
john-sp 2fe9f0c
Add basic ReadMe
john-sp 6f987cf
Update translate.md
john-sp 09d8190
Make dropdown work
john-sp 03c39d4
Fix grammar
john-sp d559204
Translate alert words
john-sp 21124a7
Fix some styling for translations
john-sp 65382b1
Update to newest FAQ page
john-sp bb09350
Make homepage multilingual
john-sp 556426b
Update to better icon for language select (matches Wikipedia)
john-sp 3b8d2c9
Adjust language dropdown positioning to float right
john-sp 1b40da6
Bug fixes on sidebar
john-sp 0274ddf
Update Translations
john-sp fbaef3c
Make top menu translate
john-sp f8f2bf9
Quick fix to downloads page
john-sp 962273c
Add language button to home page
john-sp 34c741b
Add a quick Hindi translation
john-sp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# lczero.org Website | ||
|
||
|
||
## Building for development | ||
|
||
To build and serve this Hugo website locally, follow these steps: | ||
|
||
### Prerequisites | ||
1. Install Hugo (extended version recommended) | ||
- [Official Hugo installation guide](https://gohugo.io/installation/) | ||
|
||
### Running Locally | ||
1. Clone this repository | ||
```sh | ||
git clone https://github.com/LeelaChessZero/lczero.org.git | ||
cd lczero.org | ||
``` | ||
2. Start the development server: | ||
```sh | ||
hugo serve | ||
``` | ||
3. Open your browser to: | ||
[http://localhost:1313](http://localhost:1313) | ||
|
||
### Additional Notes | ||
- Use `hugo serve -D` to include draft content | ||
|
||
|
||
## Adding a New Language Translation | ||
|
||
### 1. Configure the Language | ||
Add the new language to `config.toml` file under the `[languages]` section. | ||
|
||
### 2. Translate UI Strings | ||
1. Duplicate `i18n/en.toml` to `i18n/[new-language-code].toml` | ||
(Example: `i18n/es.toml` for Spanish) | ||
2. Translate all strings in the new file | ||
|
||
### 3. Translate Content Pages | ||
For each page you want to translate: | ||
1. Create a copy with the language code suffix: | ||
`original.md` to `original.[lang-code].md` | ||
(Example: `troubleshoot.md` to `troubleshoot.es.md`) | ||
2. Translate all content in the new file | ||
|
||
### 4. Mark Machine Translations (Optional) | ||
If using AI/automated translation, add this to the page's front matter: | ||
```yaml | ||
machineTranslated: true | ||
``` | ||
|
||
### Notes | ||
- Language codes should follow [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) standards | ||
- Untranslated pages will fall back to English | ||
- Some reference inside the page will break if that reference is also not translated. | ||
- The top level `_index.md` inside each first section (play, blog, dev, etc) must have a translated copy for all languages present in that category. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,56 @@ | ||
--- | ||
title: "Translate" | ||
title: "Translate the Website" | ||
weight: 100 | ||
draft: true | ||
draft: false | ||
summary: "Step-by-step instructions for translating lczero.org to new languages" | ||
--- | ||
|
||
It would be great to have popular pages (how to setup, bestnet etc) to be translated/written in other languages. | ||
TODO(Add instructions how to add translation). | ||
### 1. Configure the Language | ||
1. Open `config.toml` in the root directory | ||
2. Locate the `[languages]` section | ||
3. Add your language following the existing pattern: | ||
```toml | ||
[languages.xx] # Replace 'xx' with language code | ||
weight = 2 # Display order (1=English) | ||
languageName = "Language Name" | ||
``` | ||
|
||
> [!NOTE] Language Codes | ||
> Always use [ISO 639-1 standards](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) for | ||
language codes (e.g., `es` for Spanish, `fr` for French, `de` for German). | ||
|
||
### 2. Translate UI Strings | ||
1. Duplicate the English UI file: Copy `i18n/en.toml` and rename it using the language code for the new | ||
language. For example, for Spanish, you'd create `i18n/es.toml`. | ||
2. Translate all strings in the new file | ||
|
||
|
||
### 3. Translate Content Pages | ||
For each page you want to translate: | ||
1. Create a copy with the language code suffix: | ||
`original.md` to `original.[lang-code].md` | ||
(Example: `troubleshoot.md` to `troubleshoot.es.md`) | ||
2. Open the new, language-specific file and translate: | ||
- All front matter values (title, summary, etc.) | ||
- Page content (Markdown text) | ||
|
||
### 4. Mark Machine Translations (Optional) | ||
If using automated translation tools, add to the page's front matter: | ||
```yaml | ||
machineTranslated: true | ||
``` | ||
|
||
### Important Considerations | ||
|
||
> [!TIP] Fallback Behavior | ||
> If a specific page is not translated into a user's selected language, the left sidebar will | ||
redirect to the English version. | ||
|
||
> [!CAUTION] Broken References | ||
> Be mindful that internal links or cross-references within a translated page cannot refer to a | ||
default language page using a `<ref "relPageLink">`. It must refer to a translated version. | ||
|
||
> [!IMPORTANT] Translated Index Pages | ||
> The top-level `_index.md` file within each main content section (e.g., `content/play/_index.md`, | ||
`content/dev/_index.md`) **must** have a translated copy for every language enabled in that | ||
category. These index files define the section's behavior and content listings for each language. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: "Dónde jugar con Lc0" | ||
date: 2019-12-07T19:57:30+01:00 | ||
draft: false | ||
weight: 100 | ||
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
title: "FAQ" | ||
weight: 2100 | ||
summary: "Preguntas frecuentes sobre Leela Chess Zero" | ||
machineTranslated: true | ||
--- | ||
|
||
### ¿Qué es Lc0? | ||
|
||
Lc0 (Leela Chess Zero) es un potente motor de ajedrez de código abierto que utiliza redes neuronales profundas y búsqueda de árboles de Monte Carlo para evaluar posiciones de ajedrez. Se inspiró en AlphaZero de Google y aprende ajedrez jugando millones de partidas contra sí mismo. | ||
|
||
### ¿Puedo ejecutar Lc0 sin una GPU? | ||
|
||
Sí, Lc0 puede ejecutarse en CPUs, pero será significativamente más lento que en una GPU moderna. Hay compilaciones específicas solo para CPU (como BLAS o DNNL). Estas compilaciones están incluidas en las [versiones de github](https://github.com/LeelaChessZero/lc0/releases). | ||
|
||
### ¿Es más fuerte Stockfish o Lc0? | ||
|
||
Esto dependerá del hardware específico y de las condiciones de prueba, pero generalmente se considera que Stockfish es ligeramente más fuerte que Lc0. | ||
|
||
### ¿Dónde puedo encontrar la versión onnx-trt de Lc0? | ||
|
||
`onnx-trt` es un backend experimental para Lc0 y aún no está incluido en las versiones oficiales. Esta es la versión que jugó en el TCEC Cup 15. Ten en cuenta que solo es beneficioso para GPUs de muy alto rendimiento (como las series RTX 5000/6000) y solo para redes más grandes. También cabe mencionar que la versión que compilamos para el TCEC no tiene otros backends funcionales (como `cuda`). | ||
|
||
El binario se puede obtener de [este artefacto de compilación](https://ci.appveyor.com/api/buildjobs/r0c84cm598j6tyfl/artifacts/build%2Flc0.exe). | ||
|
||
También necesitarás descargar el `onnxruntime` desde aquí: | ||
[Windows](https://github.com/microsoft/onnxruntime/releases/download/v1.22.0/onnxruntime-win-x64-gpu-1.22.0.zip) | ||
o | ||
[Linux](https://github.com/microsoft/onnxruntime/releases/download/v1.22.0/onnxruntime-linux-x64-gpu-1.22.0.tgz). | ||
|
||
Luego, deberás descargar las DLLs de [TensorRT](https://developer.nvidia.com/tensorrt/download/10x) y [CuDNN](https://developer.nvidia.com/cudnn-downloads), y agregarlas a tu variable PATH o al directorio que contiene el binario de lc0. | ||
|
||
<!-- | ||
Eng: Refs do not support cross language. Ignoring for now | ||
|
||
### ¿Cuál es la mejor red de Lc0? | ||
|
||
No hay una única red de Lc0 que sea la mejor en todas las situaciones; depende del hardware que tengas. Puedes encontrar una lista de las mejores redes [aquí]({{<ref "bestnets">}}). --> | ||
|
||
### ¿Es BT5 mejor que BT4? | ||
|
||
A pesar de que BT5 tiene mejoras teóricas respecto a BT4, resultó ser más lento y peor con el mismo recuento de nodos. Las pruebas han mostrado que BT5 puede ser alrededor de 50 elo más débil que BT4 en controles de tiempo cortos y alrededor de 12 elo más débil a igual número de nodos, pese a ser un 20-50% más lento. | ||
|
||
### ¿Lc0 o AlphaZero: cuál es más fuerte? | ||
|
||
Lc0 ha superado con creces el éxito de AlphaZero en ajedrez y actualmente es mucho más fuerte. |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"features": { | ||
"title": "¿Por qué Leela Chess Zero?", | ||
"subtitle": "Lc0 es una implementación de código abierto inspirada directamente en el proyecto AlphaZero de DeepMind, y ha superado su éxito en ajedrez.", | ||
"items": [ | ||
{ | ||
"title": "Red Neuronal de Autoaprendizaje", | ||
"description": "Lc0 utiliza una red neuronal que aprendió ajedrez mediante autoaprendizaje, resultando en un estilo único, libre de todo sesgo humano.", | ||
"icon": "material-symbols--psychology" | ||
}, | ||
{ | ||
"title": "Profundo Entendimiento Posicional", | ||
"description": "Leela comprende la estrategia a largo plazo, las estructuras de peones y los movimientos sutiles.", | ||
"icon": "material-symbols--insights" | ||
}, | ||
{ | ||
"title": "Código Abierto", | ||
"description": "Completamente libre y de código abierto bajo la GPLv3.0, desarrollado por una comunidad de entusiastas e investigadores.", | ||
"icon": "material-symbols--code" | ||
} | ||
] | ||
}, | ||
"community": { | ||
"title": "Únete a Nuestra Comunidad", | ||
"description": "LCZero está impulsado por una comunidad de entusiastas del ajedrez, programadores e investigadores.", | ||
"links": [ | ||
{ | ||
"name": "Discord", | ||
"link": "https://discord.gg/pKujYxD", | ||
"icon": "qlementine-icons--discord-fill-24" | ||
}, | ||
{ | ||
"name": "GitHub", | ||
"link": "https://github.com/LeelaChessZero/lc0", | ||
"icon": "qlementine-icons--github-fill-24" | ||
}, | ||
{ | ||
"name": "X (Twitter)", | ||
"link": "https://x.com/LeelaChessZero", | ||
"icon": "qlementine-icons--x-24" | ||
} | ||
] | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"features": { | ||
"title": "Leela Chess Zero क्यों?", | ||
"subtitle": "Lc0 DeepMind के AlphaZero प्रोजेक्ट से प्रेरित एक ओपन-सोर्स कार्यान्वयन है, और यह शतरंज में अत्यधिक सफल रहा है।", | ||
"items": [ | ||
{ | ||
"title": "स्व-सीखने वाला न्यूरल नेटवर्क", | ||
"description": "Lc0 एक ऐसे न्यूरल नेटवर्क का उपयोग करता है जिसने स्व-खेल के माध्यम से शतरंज सीखी, जिससे इसका खेल एक अनूठी शैली बनती है जो मानवीय पूर्वाग्रहों से मुक्त है।", | ||
"icon": "material-symbols--psychology" | ||
}, | ||
{ | ||
"title": "गहन स्थिति संबंधी अंतर्दृष्टि", | ||
"description": "Leela दीर्घकालिक रणनीति, प्यादे की संरचनाएँ और सूक्ष्म चालों को समझती है।", | ||
"icon": "material-symbols--insights" | ||
}, | ||
{ | ||
"title": "ओपन-सोर्स", | ||
"description": "GPLv3.0 के अंतर्गत पूरी तरह से मुक्त और ओपन-सोर्स, जिसे उत्साही और शोधकर्ताओं की एक समुदाय द्वारा विकसित किया गया है।", | ||
"icon": "material-symbols--code" | ||
} | ||
] | ||
}, | ||
"community": { | ||
"title": "हमारे समुदाय में शामिल हों", | ||
"description": "LCZero शतरंज के उत्साही, प्रोग्रामर, और शोधकर्ताओं के समुदाय द्वारा संचालित है।", | ||
"links": [ | ||
{ | ||
"name": "Discord", | ||
"link": "https://discord.gg/pKujYxD", | ||
"icon": "qlementine-icons--discord-fill-24" | ||
}, | ||
{ | ||
"name": "GitHub", | ||
"link": "https://github.com/LeelaChessZero/lc0", | ||
"icon": "qlementine-icons--github-fill-24" | ||
}, | ||
{ | ||
"name": "X (Twitter)", | ||
"link": "https://x.com/LeelaChessZero", | ||
"icon": "qlementine-icons--x-24" | ||
} | ||
] | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
machineTranslationNotice = 'This page was translated by a machine. Some content may be inaccurate.' | ||
# Menu i18n strings | ||
[menu] | ||
play = "Play" | ||
watch = "Watch" | ||
contribute = "Contribute" | ||
development = "Development" | ||
blog = "Blog" | ||
|
||
# Alert blockquote i18n strings | ||
[alert] | ||
default = "Alert" | ||
caution = "Caution" | ||
important = "Important" | ||
info = "Info" | ||
note = "Note" | ||
tip = "Tip" | ||
warning = "Warning" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
machineTranslationNotice = 'Esta página fue traducida por máquina. Es posible que algunos contenidos no sean precisos.' | ||
# Menu i18n strings | ||
[menu] | ||
play = "Jugar" | ||
watch = "Ver" | ||
contribute = "Contribuir" | ||
development = "Desarrollo" | ||
blog = "Blog" | ||
|
||
# Alert blockquote i18n strings | ||
[alert] | ||
default = "Alerta" | ||
caution = "Precaución" | ||
important = "Importante" | ||
info = "Información" | ||
note = "Nota" | ||
tip = "Consejo" | ||
warning = "Advertencia" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
machineTranslationNotice = 'यह पृष्ठ मशीन द्वारा अनुवादित किया गया है। कुछ सामग्री असत्य हो सकती है।' | ||
# Menu i18n strings | ||
[menu] | ||
play = "खेलें" | ||
watch = "देखें" | ||
contribute = "योगदान करें" | ||
development = "विकास" | ||
blog = "ब्लॉग" | ||
|
||
# Alert blockquote i18n strings | ||
[alert] | ||
default = "सूचना" | ||
caution = "सावधानी" | ||
important = "महत्वपूर्ण" | ||
info = "जानकारी" | ||
note = "नोट" | ||
tip = "सुझाव" | ||
warning = "चेतावनी" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.