-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs translation for menus and includes (#1143)
- Loading branch information
Showing
64 changed files
with
1,672 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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,73 @@ | ||
# Contributing to docs | ||
|
||
In order to translate the docs to your language, there are several steps to be done. | ||
|
||
## Preparing the files | ||
|
||
In the root folder, go to docs/_pages/docs | ||
|
||
Create a folder with your language and copy inside the following folders/files | ||
|
||
- /docs/_pages/`contribute` | ||
- /docs/_pages/docs/`00-quick-start` | ||
- /docs/_pages/docs/`01-best-practices` | ||
- /docs/_pages/docs/`02-features` | ||
- /docs/_pages/docs/`03-understand` | ||
- /docs/_pages/`home.md` | ||
- /docs/_pages/`stats.md` | ||
|
||
this is how it looks the spanish folder | ||
|
||
 | ||
|
||
Then go to `/docs/_includes/` and make a copy of the improve and wip files, adding at the end of them `xxx_{your language}` | ||
|
||
  | ||
|
||
Go to /docs/_data/ and make a copy of navigation.yml , adding at the end of them `xxx_{your language}` | ||
|
||
 | ||
|
||
## Start translation | ||
|
||
Now go file by file in the folder you created and translate everything | ||
In the beginning of most folders you will find this structure | ||
|
||
 | ||
|
||
Remember to change the title, the permalink and the sidebar title. | ||
This is how it looks once changed, in the permalink, add /{your language}/, and do the same in all links with this structure. | ||
|
||
 | ||
|
||
In order to do this quicker and easier, its better to use a find and replace tool. Here is what it looks in VSCode. | ||
Go to the magnifying glass icon in the left and use this as a sample. | ||
|
||
 | ||
|
||
You can replace all at once, or go one by one | ||
|
||
 | ||
|
||
There will be some files that include at the bottom a include for the improve file or the **wip** file | ||
Use the same tool to change it quick in all files. | ||
|
||
 | ||
|
||
 | ||
|
||
*** | ||
|
||
## Menus | ||
|
||
### Header Menu | ||
In order to trasnlate the menus, change all the titles and urls in the `/docs/_data/navigation_{your language}.yml` file you copied earlier. Then go to `/docs/_data/convertToJson.js` and change the filename const to your filename | ||
|
||
 | ||
|
||
After that,from the root, run node `node .\docs\_data\converToJson.js`, and a json copy will be generated. | ||
|
||
### Sidebar | ||
In the `/docs/_includes/nav_list` file, add 2 lines changing the language, just like in the picture below. (change all ocurrences of **'es'**). Add a {% endif %} at the end. | ||
|
||
 |
This file contains 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 @@ | ||
const fs = require('fs'); | ||
const yaml = require('js-yaml'); | ||
|
||
const fileName = 'navigation_{your languageD}'; | ||
|
||
// Read YAML file | ||
const yamlData = fs.readFileSync(`./docs/_data/${fileName}.yml`, 'utf8'); | ||
|
||
// Parse YAML to JavaScript object | ||
const jsonData = yaml.load(yamlData); | ||
|
||
// Convert JavaScript object to JSON | ||
const jsonContent = JSON.stringify(jsonData, null, 2); | ||
|
||
// Write JSON to file | ||
fs.writeFileSync(`./docs/header-menu-jsons/${fileName}.json`, jsonContent, 'utf8'); | ||
|
||
console.log('Conversion completed successfully!'); |
This file contains 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 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,121 @@ | ||
main: | ||
- title: '<svg xmlns="http://www.w3.org/2000/svg" style="width:26px;height:26px;vertical-align:middle;fill:currentColor;position:relative;top:-2" viewBox="0 0 512 512"><path d="M156.6 384.9L125.7 353.1C117.2 345.5 114.2 333.1 117.1 321.8C120.1 312.9 124.1 301.3 129.8 288H24C15.38 288 7.414 283.4 3.146 275.9C-1.123 268.4-1.042 259.2 3.357 251.8L55.83 163.3C68.79 141.4 92.33 127.1 117.8 127.1H200C202.4 124 204.8 120.3 207.2 116.7C289.1-4.07 411.1-8.142 483.9 5.275C495.6 7.414 504.6 16.43 506.7 28.06C520.1 100.9 516.1 222.9 395.3 304.8C391.8 307.2 387.1 309.6 384 311.1V394.2C384 419.7 370.6 443.2 348.7 456.2L260.2 508.6C252.8 513 243.6 513.1 236.1 508.9C228.6 504.6 224 496.6 224 488V380.8C209.9 385.6 197.6 389.7 188.3 392.7C177.1 396.3 164.9 393.2 156.6 384.9V384.9zM384 167.1C406.1 167.1 424 150.1 424 127.1C424 105.9 406.1 87.1 384 87.1C361.9 87.1 344 105.9 344 127.1C344 150.1 361.9 167.1 384 167.1z"/></svg> Acceso Rápido' | ||
url: /docs/es/quick-start/ | ||
- title: '<svg xmlns="http://www.w3.org/2000/svg" style="width:26px;height:26px;vertical-align:middle;fill:currentColor;position:relative;top:-2" viewBox="0 0 512 512"><!--! Font Awesome Free 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM176 168V344C176 352.7 180.7 360.7 188.3 364.9C195.8 369.2 205.1 369 212.5 364.5L356.5 276.5C363.6 272.1 368 264.4 368 256C368 247.6 363.6 239.9 356.5 235.5L212.5 147.5C205.1 142.1 195.8 142.8 188.3 147.1C180.7 151.3 176 159.3 176 168V168z"/></svg> Tutorials' | ||
url: /watch/en/ | ||
- title: '<svg xmlns="http://www.w3.org/2000/svg" style="width:30px;height:28px;vertical-align:middle;fill:currentColor;position:relative;top:-2" viewBox="0 0 512 512"><!--! Font Awesome Free 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M32 32C49.67 32 64 46.33 64 64V400C64 408.8 71.16 416 80 416H480C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H80C35.82 480 0 444.2 0 400V64C0 46.33 14.33 32 32 32zM160 224C177.7 224 192 238.3 192 256V320C192 337.7 177.7 352 160 352C142.3 352 128 337.7 128 320V256C128 238.3 142.3 224 160 224zM288 320C288 337.7 273.7 352 256 352C238.3 352 224 337.7 224 320V160C224 142.3 238.3 128 256 128C273.7 128 288 142.3 288 160V320zM352 192C369.7 192 384 206.3 384 224V320C384 337.7 369.7 352 352 352C334.3 352 320 337.7 320 320V224C320 206.3 334.3 192 352 192zM480 320C480 337.7 465.7 352 448 352C430.3 352 416 337.7 416 320V96C416 78.33 430.3 64 448 64C465.7 64 480 78.33 480 96V320z"/></svg> Estadísticas' | ||
url: /stats/es/ | ||
- title: '<svg xmlns="http://www.w3.org/2000/svg" style="width:32px;height:28px;vertical-align:middle;fill:currentColor;position:relative;top:-2" viewBox="0 0 640 512"><path d="M488 191.1h-152l.0001 51.86c.0001 37.66-27.08 72-64.55 75.77c-43.09 4.333-79.45-29.42-79.45-71.63V126.4l-24.51 14.73C123.2 167.8 96.04 215.7 96.04 267.5L16.04 313.8c-15.25 8.751-20.63 28.38-11.75 43.63l80 138.6c8.875 15.25 28.5 20.5 43.75 11.75l103.4-59.75h136.6c35.25 0 64-28.75 64-64c26.51 0 48-21.49 48-48V288h8c13.25 0 24-10.75 24-24l.0001-48C512 202.7 501.3 191.1 488 191.1zM635.7 154.5l-79.95-138.6c-8.875-15.25-28.5-20.5-43.75-11.75l-103.4 59.75h-62.57c-37.85 0-74.93 10.61-107.1 30.63C229.7 100.4 224 110.6 224 121.6l-.0004 126.4c0 22.13 17.88 40 40 40c22.13 0 40-17.88 40-40V159.1h184c30.93 0 56 25.07 56 56v28.5l80-46.25C639.3 189.4 644.5 169.8 635.7 154.5z"/></svg> Contribuir' | ||
url: /contribute/es/ | ||
- title: '<svg xmlns="http://www.w3.org/2000/svg" style="width:26px;height:26px;vertical-align:middle;fill:currentColor;position:relative;top:-2" viewBox="0 0 512 512"><path d="M217.6 96.1c-12.95-.625-24.66 9.156-25.52 22.37C191.2 131.7 201.2 143.1 214.4 143.1c79.53 5.188 148.4 74.09 153.6 153.6c.8281 12.69 11.39 22.43 23.94 22.43c.5156 0 1.047-.0313 1.578-.0625c13.22-.8438 23.25-12.28 22.39-25.5C409.3 191.8 320.3 102.8 217.6 96.1zM224 0C206.3 0 192 14.31 192 32s14.33 32 32 32c123.5 0 224 100.5 224 224c0 17.69 14.33 32 32 32s32-14.31 32-32C512 129.2 382.8 0 224 0zM172.3 226.8C157.7 223.9 144 235.8 144 250.6v50.37c0 10.25 7.127 18.37 16.75 21.1c18.13 6.75 31.26 24.38 31.26 44.1c0 26.5-21.5 47.1-48.01 47.1c-26.5 0-48.01-21.5-48.01-47.1V120c0-13.25-10.75-23.1-24.01-23.1l-48.01 .0076C10.75 96.02 0 106.8 0 120v247.1c0 89.5 82.14 160.2 175 140.7c54.38-11.5 98.27-55.5 109.8-109.7C302.2 316.1 247.8 241.8 172.3 226.8z"/></svg> Blog' | ||
url: /blog/es/ | ||
|
||
docs: | ||
- title: '<span class="side-bar-item"><img id="side-icon-big" src="/assets/vector/rocket.svg"/>Inicio Rápido</span>' | ||
url: /docs/es/quick-start/ | ||
children: | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/bolt.svg"/>Lightning Network</span>' | ||
url: /docs/es/lightning/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/tor.svg"/>La red TOR</span>' | ||
url: /docs/es/tor/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/arrow-up-right-from-square.svg"/>Acceso</span>' | ||
url: /docs/es/access/ | ||
|
||
- title: '<span class="side-bar-item"><img id="side-icon-big" src="/assets/vector/bars-staggered.svg"/>Features</span>' | ||
url: /docs/es/features/ | ||
children: | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/user-ninja.svg"/>Privado</span>' | ||
url: /docs/es/private/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/jet-fighter.svg"/>Rápido</span>' | ||
url: /docs/es/fast/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/shield.svg"/>Seguro</span>' | ||
url: /docs/es/safe/ | ||
|
||
- title: '<span class="side-bar-item"><img id="side-icon-big" src="/assets/vector/lightbulb.svg"/>Entender</span>' | ||
url: /docs/es/understand/ | ||
children: | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/timeline.svg"/>Flujo de comercio</span>' | ||
url: /docs/es/trade-pipeline/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/robot.svg"/>Robots</span>' | ||
url: /docs/es/robots/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/percent.svg"/>Premium</span>' | ||
url: /docs/es/premium/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/ticket-simple.svg"/>Fianzas</span>' | ||
url: /docs/es/bonds/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/money-bill-transfer.svg"/>Depósito de garantía</span>' | ||
url: /docs/es/escrow/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/link-solid.svg"/>Pagos On-Chain</span>' | ||
url: /docs/es/on-chain-payouts/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/bitcoin.svg"/>Precios</span>' | ||
url: /docs/es/prices/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/hand-holding-hand.svg"/>Comisiones</span>' | ||
url: /docs/es/fees/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/life-ring.svg"/>Disputas</span>' | ||
url: /docs/es/disputes/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/wallet.svg"/>Wallets</span>' | ||
url: /docs/es/wallets/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/gauge-high.svg"/>Limites</span>' | ||
url: /docs/es/limits/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/arrow-right-arrow-left.svg"/>Swaps</span>' | ||
url: /docs/es/swaps/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/telegram.svg"/>Telegram</span>' | ||
url: /docs/es/telegram/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/cloud.svg"/>API</span>' | ||
url: /docs/es/api/ | ||
|
||
- title: '<span class="side-bar-item"><img id="side-icon-big" src="/assets/vector/hand-peace.svg"/>Mejores practicas</span>' | ||
url: /docs/es/best-practices/ | ||
children: | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/fingerprint.svg"/>Cifrado PGP</span>' | ||
url: /docs/es/pgp-encryption/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/money-bill-1-wave.svg"/>Métodos de pago</span>' | ||
url: /docs/es/payment-methods/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/route.svg"/>Wallets Proxy</span>' | ||
url: /docs/es/proxy-wallets/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/circle-nodes.svg"/>Canales Lightning</span>' | ||
url: /docs/es/channels/ | ||
|
||
tutorial: | ||
- title: '<span class="side-bar-item"><img id="side-icon-big" src="/assets/vector/circle-play.svg"/>Ver</span>' | ||
url: "/watch/en/" | ||
children: | ||
- title: '<span class="side-bar-item"> <img style="width:22px;height:21px" src="/assets/vector/english.svg"/> English</span>' | ||
url: "/watch/en/" | ||
- title: '<span class="side-bar-item"> <img style="width:22px;height:13px" src="/assets/vector/spanish.svg"/> Español</span>' | ||
url: "/watch/es/" | ||
- title: '<span class="side-bar-item"> <img style="width:22px;height:13px" src="/assets/vector/german.svg"/> Deutsch</span>' | ||
url: "/watch/de/" | ||
- title: '<span class="side-bar-item"> <img style="width:22px;height:13px" src="/assets/vector/portuguese.svg"/> Português</span>' | ||
url: "/watch/pt/" | ||
- title: '<span class="side-bar-item"> <img style="width:22px;height:13px" src="/assets/vector/french.svg"/> Français</span>' | ||
url: "/watch/fr/" | ||
- title: '<span class="side-bar-item"> <img style="width:22px;height:13px" src="/assets/vector/polish.svg"/> Polski</span>' | ||
url: "/watch/pl/" | ||
- title: '<span class="side-bar-item"><img id="side-icon-big" src="/assets/vector/readme.svg"/>Leer</span>' | ||
url: "/watch/en/" | ||
children: | ||
- title: '<span class="side-bar-item"> <img style="width:22px;height:21px" src="/assets/vector/english.svg"/> English</span>' | ||
url: "/read/en/" | ||
- title: '<span class="side-bar-item"> <img style="width:22px;height:13px" src="/assets/vector/spanish.svg"/> Español</span>' | ||
url: "/read/es/" | ||
- title: '<span class="side-bar-item"> <img style="width:22px;height:13px" src="/assets/vector/german.svg"/> Deutsch</span>' | ||
url: "/read/de/" | ||
|
||
contribute: | ||
- title: '<span class="side-bar-item"><img id="side-icon-big" src="/assets/vector/handshake-angle.svg"/>Contribuir</span>' | ||
url: /contribute/es/ | ||
children: | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/code.svg"/>Código</span>' | ||
url: /contribute/es/code/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/language.svg"/>Traducciones</span>' | ||
url: /contribute/es/languages/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/circle-nodes.svg"/>Liquidez</span>' | ||
url: /contribute/es/liquidity/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/graduation-cap.svg"/>Guías</span>' | ||
url: /contribute/es/guides/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/palette.svg"/>Arte</span>' | ||
url: /contribute/es/art/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/bullhorn.svg"/>Comparte</span>' | ||
url: /contribute/es/outreach/ | ||
- title: '<span class="side-bar-item"> <img id="side-icon-small" src="/assets/vector/bitcoin.svg"/>Dona</span>' | ||
url: /contribute/es/donate/ |
Oops, something went wrong.