diff --git a/CONTRIBUTING_DOCS.md b/CONTRIBUTING_DOCS.md new file mode 100644 index 00000000..3c6907a6 --- /dev/null +++ b/CONTRIBUTING_DOCS.md @@ -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 + +![spanish expample](/docs/contributeDocsImages/image-1.png "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}` + +![alt text](/docs/contributeDocsImages/image-2.png) ![alt text](/docs/contributeDocsImages/image-3.png) + +Go to /docs/_data/ and make a copy of navigation.yml , adding at the end of them `xxx_{your language}` + +![alt text](/docs/contributeDocsImages/image.png) + +## 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 + +![alt text](/docs/contributeDocsImages/image-5.png) + +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. + +![alt text](/docs/contributeDocsImages/image-6.png) + +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. + +![alt text](/docs/contributeDocsImages/image-9.png) + +You can replace all at once, or go one by one + +![alt text](/docs/contributeDocsImages/image-11.png) + +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. + +![alt text](/docs/contributeDocsImages/image-12.png) + +![alt text](/docs/contributeDocsImages/image-13.png) + +*** + +## 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 + +![alt text](/docs/contributeDocsImages/image-15.png) + +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. + +![alt text](/docs/contributeDocsImages/image-14.png) diff --git a/docs/_data/converToJson.js b/docs/_data/converToJson.js new file mode 100644 index 00000000..7bce1262 --- /dev/null +++ b/docs/_data/converToJson.js @@ -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!'); diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index 1f6a8267..9c07567c 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -122,4 +122,5 @@ contribute: - title: '  Outreach' url: /contribute/outreach/ - title: '  Donate' - url: /contribute/donate/ \ No newline at end of file + url: /contribute/donate/ + diff --git a/docs/_data/navigation_es.yml b/docs/_data/navigation_es.yml new file mode 100644 index 00000000..d5d836ea --- /dev/null +++ b/docs/_data/navigation_es.yml @@ -0,0 +1,121 @@ +main: + - title: ' Acceso Rápido' + url: /docs/es/quick-start/ + - title: ' Tutorials' + url: /watch/en/ + - title: ' Estadísticas' + url: /stats/es/ + - title: ' Contribuir' + url: /contribute/es/ + - title: ' Blog' + url: /blog/es/ + +docs: + - title: 'Inicio Rápido' + url: /docs/es/quick-start/ + children: + - title: '  Lightning Network' + url: /docs/es/lightning/ + - title: '  La red TOR' + url: /docs/es/tor/ + - title: '  Acceso' + url: /docs/es/access/ + + - title: 'Features' + url: /docs/es/features/ + children: + - title: '  Privado' + url: /docs/es/private/ + - title: '  Rápido' + url: /docs/es/fast/ + - title: '  Seguro' + url: /docs/es/safe/ + + - title: 'Entender' + url: /docs/es/understand/ + children: + - title: '  Flujo de comercio' + url: /docs/es/trade-pipeline/ + - title: '  Robots' + url: /docs/es/robots/ + - title: '  Premium' + url: /docs/es/premium/ + - title: '  Fianzas' + url: /docs/es/bonds/ + - title: '  Depósito de garantía' + url: /docs/es/escrow/ + - title: '  Pagos On-Chain' + url: /docs/es/on-chain-payouts/ + - title: '  Precios' + url: /docs/es/prices/ + - title: '  Comisiones' + url: /docs/es/fees/ + - title: '  Disputas' + url: /docs/es/disputes/ + - title: '  Wallets' + url: /docs/es/wallets/ + - title: '  Limites' + url: /docs/es/limits/ + - title: '  Swaps' + url: /docs/es/swaps/ + - title: '  Telegram' + url: /docs/es/telegram/ + - title: '  API' + url: /docs/es/api/ + + - title: 'Mejores practicas' + url: /docs/es/best-practices/ + children: + - title: '  Cifrado PGP' + url: /docs/es/pgp-encryption/ + - title: '  Métodos de pago' + url: /docs/es/payment-methods/ + - title: '  Wallets Proxy' + url: /docs/es/proxy-wallets/ + - title: '  Canales Lightning' + url: /docs/es/channels/ + +tutorial: + - title: 'Ver' + url: "/watch/en/" + children: + - title: '   English' + url: "/watch/en/" + - title: '   Español' + url: "/watch/es/" + - title: '   Deutsch' + url: "/watch/de/" + - title: '   Português' + url: "/watch/pt/" + - title: '   Français' + url: "/watch/fr/" + - title: '   Polski' + url: "/watch/pl/" + - title: 'Leer' + url: "/watch/en/" + children: + - title: '   English' + url: "/read/en/" + - title: '   Español' + url: "/read/es/" + - title: '   Deutsch' + url: "/read/de/" + +contribute: + - title: 'Contribuir' + url: /contribute/es/ + children: + - title: '  Código' + url: /contribute/es/code/ + - title: '  Traducciones' + url: /contribute/es/languages/ + - title: '  Liquidez' + url: /contribute/es/liquidity/ + - title: '  Guías' + url: /contribute/es/guides/ + - title: '  Arte' + url: /contribute/es/art/ + - title: '  Comparte' + url: /contribute/es/outreach/ + - title: '  Dona' + url: /contribute/es/donate/ diff --git a/docs/_data/navigation_fr.yml b/docs/_data/navigation_fr.yml new file mode 100644 index 00000000..0b354b59 --- /dev/null +++ b/docs/_data/navigation_fr.yml @@ -0,0 +1,126 @@ +main: + - title: ' Quick-Start' + url: /docs/fr/quick-start/ + - title: ' Tutorials' + url: /watch/fr/ + - title: ' Stats' + url: /stats/fr/ + - title: ' Contribute' + url: /contribute/fr/ + - title: ' Blog' + url: /blog/fr/ + +docs: + - title: 'Quick Start' + url: /docs/fr/quick-start/ + children: + - title: '  Lightning Network' + url: /docs/fr/lightning/ + - title: '  TOR Network' + url: /docs/fr/tor/ + - title: '  Access' + url: /docs/fr/access/ + + - title: 'Features' + url: /docs/fr/features/ + children: + - title: '  Private' + url: /docs/fr/private/ + - title: '  Fast' + url: /docs/fr/fast/ + - title: '  Safe' + url: /docs/fr/safe/ + + - title: 'Understand' + url: /docs/fr/understand/ + children: + - title: '  Trade Pipeline' + url: /docs/fr/trade-pipeline/ + - title: '  Robots' + url: /docs/fr/robots/ + - title: '  Premium' + url: /docs/fr/premium/ + - title: '  Bonds' + url: /docs/fr/bonds/ + - title: '  Trade Escrow' + url: /docs/fr/escrow/ + - title: '  On-Chain Payouts' + url: /docs/fr/on-chain-payouts/ + - title: '  Prices' + url: /docs/fr/prices/ + - title: '  Fees' + url: /docs/fr/fees/ + - title: '  Disputes' + url: /docs/fr/disputes/ + - title: '  Wallets' + url: /docs/fr/wallets/ + - title: '  Limits' + url: /docs/fr/limits/ + - title: '  Swaps' + url: /docs/fr/swaps/ + - title: '  Telegram' + url: /docs/fr/telegram/ + - title: '  API' + url: /docs/fr/api/ + + - title: 'Best Practices' + url: /docs/fr/best-practices/ + children: + - title: '  PGP Encryption' + url: /docs/fr/pgp-encryption/ + - title: '  Payment Methods' + url: /docs/fr/payment-methods/ + - title: '  Proxy Wallets' + url: /docs/fr/proxy-wallets/ + - title: '  Lightning Channels' + url: /docs/fr/channels/ + +tutorial: + - title: 'Watch' + url: "/watch/fr/" + children: + - title: '   English' + url: "/watch/en/" + - title: '   Español' + url: "/watch/es/" + - title: '   Deutsch' + url: "/watch/de/" + - title: '   Português' + url: "/watch/pt/" + - title: '   Français' + url: "/watch/fr/" + - title: '   Polski' + url: "/watch/pl/" + - title: '   Русский' + url: "/watch/ru/" + - title: 'Read' + url: "/watch/en/" + children: + - title: '   English' + url: "/read/en/" + - title: '   Español' + url: "/read/es/" + - title: '   Deutsch' + url: "/read/de/" + - title: '   Русский' + url: "/read/ru/" + +contribute: + - title: 'Contribute' + url: /contribute/fr/ + children: + - title: '  Code' + url: /contribute/fr/code/ + - title: '  Translations' + url: /contribute/fr/languages/ + - title: '  Liquidity' + url: /contribute/fr/liquidity/ + - title: '  Guides' + url: /contribute/fr/guides/ + - title: '  Art' + url: /contribute/fr/art/ + - title: '  Outreach' + url: /contribute/fr/outreach/ + - title: '  Donate' + url: /contribute/fr/donate/ + diff --git a/docs/_includes/improve_fr b/docs/_includes/improve_fr new file mode 100644 index 00000000..7be844a1 --- /dev/null +++ b/docs/_includes/improve_fr @@ -0,0 +1,6 @@ +## You can help improve this page! + +Learn RoboSats is a joint effort of the RoboSats community. If you have used RoboSats before, you are already an expert! Help improve this documentation. + +**ProTip:** You can directly [edit this page ](https://github.com/RoboSats/robosats/blob/main/docs/{{page.src}}) and open a [Pull Request ](https://github.com/RoboSats/robosats/pulls). Your changes will show right here. +{: .notice--primary} diff --git a/docs/_includes/masthead.html b/docs/_includes/masthead.html index d55112b0..220fabe1 100644 --- a/docs/_includes/masthead.html +++ b/docs/_includes/masthead.html @@ -7,17 +7,13 @@ {% unless logo_path == empty %} {% endunless %} - + {{ site.masthead_title | default: site.title }} {% if site.subtitle %}{{ site.subtitle }}{% endif %} -