mirror of
https://github.com/gosticks/web.git
synced 2026-10-06 22:57:01 +00:00
Merge pull request #140 from pi-hole/tweak/language-list-gen
Move language list generation out of update-translations.js
This commit is contained in:
+5
-3
@@ -50,13 +50,15 @@
|
||||
"scripts": {
|
||||
"start": "npm run build-css && npm-run-all -p watch-css start-js",
|
||||
"start-js": "react-scripts start",
|
||||
"start-fake": "node make-fake-data.js && REACT_APP_FAKE_API=1 npm run start",
|
||||
"start-fake": "npm run make-fake-data && REACT_APP_FAKE_API=1 npm run start",
|
||||
"build": "npm-run-all build-css build-js",
|
||||
"build-fake": "node make-fake-data.js && REACT_APP_FAKE_API=1 npm run build",
|
||||
"build-fake": "npm run make-fake-data && REACT_APP_FAKE_API=1 npm run build",
|
||||
"build-js": "react-scripts build",
|
||||
"build-css": "node-sass-chokidar --include-path ./node_modules ./src/scss -o ./src/scss",
|
||||
"watch-css": "node-sass-chokidar --include-path ./node_modules ./src/scss -o ./src/scss --watch --recursive",
|
||||
"update-translations": "node update-translations.js",
|
||||
"update-translations": "node scripts/update-translations.js && npm run generate-language-list",
|
||||
"generate-language-list": "node scripts/generate-language-list.js",
|
||||
"make-fake-data": "node scripts/make-fake-data.js",
|
||||
"test": "react-scripts test --env=jsdom",
|
||||
"eject": "react-scripts eject",
|
||||
"format": "prettier --write \"src/**/*.js\"",
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/* Pi-hole: A black hole for Internet advertisements
|
||||
* (c) 2019 Pi-hole, LLC (https://pi-hole.net)
|
||||
* Network-wide ad blocking via your own hardware.
|
||||
*
|
||||
* Web Interface
|
||||
* Update languages.json with the current languages
|
||||
*
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
const fs = require("fs-extra");
|
||||
|
||||
// Get the available languages
|
||||
const languages = fs.readdirSync("public/i18n");
|
||||
|
||||
// Save the language list so the web interface knows what's available
|
||||
fs.outputFileSync("src/languages.json", JSON.stringify(languages));
|
||||
@@ -166,7 +166,4 @@ getTranslatedLanguages().then(languages => {
|
||||
console.log(`Languages over 70% translated: ${languages.join(", ")}`);
|
||||
|
||||
for (const lang of languages) fetchAllTags(lang);
|
||||
|
||||
// Save the language list so the web interface knows what's available
|
||||
fs.outputFileSync("src/languages.json", JSON.stringify(languages));
|
||||
});
|
||||
+1
-1
@@ -1 +1 @@
|
||||
["bg","ca","en","fr","de","it","pt","es","tr"]
|
||||
["bg","ca","de","en","es","fr","it","pt","tr"]
|
||||
Reference in New Issue
Block a user