diff --git a/scripts/README.md b/scripts/README.md index ac99892f..19cdd496 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -6,6 +6,8 @@ Run `make init` from the project root. + + ## `querylog/`: Query Log Helpers ### Usage @@ -14,12 +16,16 @@ Run `make init` from the project root. * `npm run anonymize `: read the query log from the `` and write anonymized version to ``. + + ## `make/`: Makefile Scripts The release channels are: `development` (the default), `edge`, `beta`, and `release`. If verbosity levels aren't documented here, there are only two: `0`, don't print anything, and `1`, be verbose. + + ### `build-docker.sh`: Build A Multi-Architecture Docker Image Required environment: @@ -38,6 +44,8 @@ Optional environment: * `SUDO`: allow users to use `sudo` or `doas` with `docker`. By default none is used. + + ### `build-release.sh`: Build A Release For All Platforms Required environment: @@ -67,6 +75,8 @@ Optional environment: * `VERSION`: release version. Will be set by `version.sh` if it is unset or if it has the default `Makefile` value of `v0.0.0`. + + ### `clean.sh`: Cleanup Optional environment: @@ -75,6 +85,8 @@ Optional environment: Required environment: * `DIST_DIR`: the directory where a release has previously been built. + + ### `go-build.sh`: Build The Backend Optional environment: @@ -95,6 +107,8 @@ Optional environment: Required environment: * `CHANNEL`: release channel, see above. + + ### `go-deps.sh`: Install Backend Dependencies Optional environment: @@ -103,6 +117,8 @@ Optional environment: Go package that is processed. `2` also shows subcommands and environment. The default value is `0`, don't be verbose. + + ### `go-lint.sh`: Run Backend Static Analyzers Don't forget to run `make go-tools` once first! @@ -114,6 +130,8 @@ Optional environment: * `VERBOSE`: verbosity level. `1` shows every command that is run. `2` also shows subcommands. The default value is `0`, don't be verbose. + + ### `go-test.sh`: Run Backend Tests Optional environment: @@ -126,6 +144,8 @@ Optional environment: Go package that is processed. `2` also shows subcommands. The default value is `0`, don't be verbose. + + ### `go-tools.sh`: Install Backend Tooling Installs the Go static analysis and other tools into `${PWD}/bin`. Either add @@ -135,16 +155,22 @@ directly, or use the commands through `make` (for example, `make go-lint`). Optional environment: * `GO`: set an alternative name for the Go compiler. + + ### `version.sh`: Generate And Print The Current Version Required environment: * `CHANNEL`: release channel, see above. + + ## `snap/`: Snap GUI Files App icons (see https://github.com/AdguardTeam/AdGuardHome/pull/1836), Snap manifest file templates, and helper scripts. + + ## `translations/`: Twosky Integration Script ### Usage @@ -158,6 +184,12 @@ manifest file templates, and helper scripts. After the download you'll find the output locales in the `client/src/__locales/` directory. +Optional environment: + * `UPLOAD_LANGUAGE`: set an alternative language for `locales:upload` to + upload. + + + ## `whotracksme/`: Whotracks.me Database Converter A simple script that converts the Ghostery/Cliqz trackers database to a json format. diff --git a/scripts/translations/upload.js b/scripts/translations/upload.js index 38d23794..702b251b 100644 --- a/scripts/translations/upload.js +++ b/scripts/translations/upload.js @@ -3,7 +3,7 @@ const fs = require('fs'); const request = require('request-promise'); const twoskyConfig = require('../../.twosky.json')[0]; -const { project_id: TWOSKY_PROJECT_ID, base_locale: LANGUAGE } = twoskyConfig; +const { project_id: TWOSKY_PROJECT_ID, base_locale: DEFAULT_LANGUAGE } = twoskyConfig; const LOCALES_DIR = '../../client/src/__locales'; const BASE_FILE = 'en.json'; const TWOSKY_URI = process.env.TWOSKY_URI; @@ -12,14 +12,17 @@ const TWOSKY_URI = process.env.TWOSKY_URI; * Prepare post params */ const getRequestData = (url, projectId) => { + const language = process.env.UPLOAD_LANGUAGE || DEFAULT_LANGUAGE; const formData = { format: 'json', - language: LANGUAGE, + language: language, filename: BASE_FILE, project: projectId, - file: fs.createReadStream(path.resolve(LOCALES_DIR, `${LANGUAGE}.json`)), + file: fs.createReadStream(path.resolve(LOCALES_DIR, `${language}.json`)), }; + console.log(`uploading ${language}`); + return { url: `${url}/upload`, formData