Merge branch 'feat/multi-lang' of github.com:BitPatty/gctGenerator into feat/multi-lang

This commit is contained in:
Matteias Collet 2020-07-10 05:58:59 +02:00
commit 47fcc58774
2 changed files with 4 additions and 4 deletions

View file

@ -27,8 +27,6 @@ You can find the guides in the [site](https://github.com/BitPatty/gctGenerator/t
Note that in the code reference files everything following the `<!-- injectionpoint -->` tag will be removed during the next build.
Before opening a PR make sure you run `yarn codes:clean` to remove the injected codes.
### Site Development
If you intend to change site code you need [NodeJS](https://nodejs.org/en/) version 12.18.1 or greater installed on your local.
@ -55,6 +53,8 @@ The XML codes will be written automatically to the json file and code reference
If you want to inject the codes at any given point you can use `yarn codes:inject`.
Before opening a PR make sure you run `yarn codes:clean` to remove the injected codes.
### Build and preview the site (Docker)
The project root provides a [docker-compose](https://docs.docker.com/compose/) file, which creates a clean build (with the same configuration as the production build) and spins up a minimal Apache server on your local, serving the resulting build on port 8080.

View file

@ -2,7 +2,7 @@ const path = require('path');
const locales = require(path.join(__dirname, '../site/.vuepress/i18n/locales.json'));
/**
* Gets all leave nodes from the specified object
* Gets all leaf nodes from the specified object
* @param {*} node The root node
* @param {*} path The already visited path
*/
@ -39,7 +39,7 @@ const translations = Object.keys(locales).map((locale) => ({
const defaultTranslation = translations.find((t) => t.lang === locales['/'].lang);
console.log(`Default translation set to ${defaultTranslation.lang}`);
// Holds the paths to all leave nodes of the default translation
// Holds the paths to all leaf nodes of the default translation
const leavePaths = [];
getLeaves(defaultTranslation.values);
console.log('Detected translations: ', leavePaths);