diff --git a/docs/_translations.md b/docs/_translations.md index 7c9da1bcf6..f604528fd7 100644 --- a/docs/_translations.md +++ b/docs/_translations.md @@ -33,4 +33,12 @@ +
+
+
+ +
+ Interested in updating the translations? Visit: + +
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 8df62bb9b3..67658d0a15 100644 --- a/docs/index.html +++ b/docs/index.html @@ -106,21 +106,36 @@ plugins: [ function (hook, vm) { - hook.beforeEach(function (html) { - if (vm.route.file === '_translations.md') return html; + hook.beforeEach(function (markdown) { - var url = - 'https://github.com/freeCodeCamp/freeCodeCamp/blob/master/docs/' + - vm.route.file; + // -- ignore the translations list page + if (vm.route.file === '_translations.md') return markdown; - var editLink = '[ Edit this guide on GitHub](' + url + ')'; + // -- add "Update this translation" link for all i18n language pages + if (vm.route.path.search('i18n') === 1) { + var dynamicText = '[ Update the translation](' + + 'https://translate.freecodecamp.org/contributing-docs' + + ') or [visit the English version](' + + '/' + vm.route.path.split('/').pop() + + ') of this guide to update instructions.'; + } + + // -- add "Edit this guide on GitHub" link for all English language pages + if (vm.route.path.search('i18n') === -1) { + var dynamicText = '[ Edit this guide on GitHub](' + + 'https://github.com/freeCodeCamp/freeCodeCamp/blob/master/docs/' + + vm.route.file + + ')'; + } return ( - html + + markdown + '\n----\n' + - editLink + dynamicText ); + // -- do not add logic below this line -- + }); } ]