diff --git a/docs/DE/index.md b/docs/de/index.md similarity index 100% rename from docs/DE/index.md rename to docs/de/index.md diff --git a/docs/EN/build.md b/docs/en/build.md similarity index 100% rename from docs/EN/build.md rename to docs/en/build.md diff --git a/docs/EN/faq.md b/docs/en/faq.md similarity index 100% rename from docs/EN/faq.md rename to docs/en/faq.md diff --git a/docs/EN/flash.md b/docs/en/flash.md similarity index 100% rename from docs/EN/flash.md rename to docs/en/flash.md diff --git a/docs/EN/index.md b/docs/en/index.md similarity index 100% rename from docs/EN/index.md rename to docs/en/index.md diff --git a/docs/EN/modules/node.md b/docs/en/modules/node.md similarity index 100% rename from docs/EN/modules/node.md rename to docs/en/modules/node.md diff --git a/docs/EN/start.md b/docs/en/start.md similarity index 100% rename from docs/EN/start.md rename to docs/en/start.md diff --git a/docs/EN/support.md b/docs/en/support.md similarity index 100% rename from docs/EN/support.md rename to docs/en/support.md diff --git a/docs/index.md b/docs/index.md index a300ef43..1ee20244 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,7 +4,7 @@ NodeMCU is an [eLua](http://www.eluaproject.net/) based firmware for the [ESP826 The firmware is based on the Espressif SDK v1.4 and uses a file system based on [spiffs](https://github.com/pellepl/spiffs). -[English](EN/index.md) +[English](en/index.md) -[Deutsch](DE/index.md) +[Deutsch](de/index.md) diff --git a/docs/js/extra.js b/docs/js/extra.js index 83e680eb..45ffeb50 100644 --- a/docs/js/extra.js +++ b/docs/js/extra.js @@ -1,20 +1,17 @@ var nodemcu = nodemcu || {}; (function () { 'use strict'; - var languageCodeToNameMap = {EN: 'English', DE: 'Deutsch'}; + var languageCodeToNameMap = {en: 'English', de: 'Deutsch'}; var languageNames = values(languageCodeToNameMap); - var defaultLanguageCode = 'EN'; + var defaultLanguageCode = 'en'; $(document).ready(function () { hideNavigationForAllButSelectedLanguage(); + addLanguageSelectorToRtdFlyOutMenu(); }); function hideNavigationForAllButSelectedLanguage() { - // URL is like http://host/EN/build/ -> extract 'EN' - var selectedLanguageCode = window.location.pathname.substr(1, 2); - if (!selectedLanguageCode) { - selectedLanguageCode = defaultLanguageCode; - } + var selectedLanguageCode = determineSelectedLanguageCode(); var selectedLanguageName = languageCodeToNameMap[selectedLanguageCode]; // Finds all subnav elements and hides them if they're /language/ subnavs. Hence, all 'Modules' subnav elements // won't be hidden. @@ -31,6 +28,63 @@ var nodemcu = nodemcu || {}; }); } + /** + * Adds a language selector to the RTD fly out menu found bottom left. Example + *