From cc211a028cf63564240b37edab71a5d6e4b4abd5 Mon Sep 17 00:00:00 2001 From: ojack Date: Sat, 11 Jun 2022 13:31:15 +0200 Subject: [PATCH] added brazilian portuguese and indonesian translations --- README.md | 23 +++++++------------ frontend/hydra-docs | 2 +- frontend/hydra-functions | 2 +- frontend/web-editor/public/bundle.js | 18 +++++++++++---- frontend/web-editor/public/css/modal.css | 2 +- frontend/web-editor/public/index.html | 4 ++-- .../web-editor/src/stores/language-store.js | 16 ++++++++++--- frontend/web-editor/src/views/info.js | 2 +- 8 files changed, 41 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index fab5eaa..0cb4cfd 100755 --- a/README.md +++ b/README.md @@ -228,24 +228,12 @@ synth = new Tone.Synth().toDestination(); synth.triggerAttackRelease("C4", "8n"); ``` ## Running locally -To run locally, you must have nodejs, yarn and npm installed. Install node and npm from: https://nodejs.org/en/ - -To clone the repo, you must also clone the repos added as submodules, i.e.: -``` -git clone --recurse-submodules https://github.com/hydra-synth/hydra.git -``` - -To install dependencies, make sure to enter the hydra source code directory from the command line: -``` -cd hydra -``` - - -Install yarn from the command line +To run locally, you must have nodejs, yarn and npm installed. Install node and npm from: https://nodejs.org/en/. Once you have node and npm installed, you can install yarn globally by running the following from the command line: ``` npm install --global yarn ``` -open terminal and enter directory + +To run, open terminal and enter the directory of the hydra source code: ``` cd hydra ``` @@ -261,6 +249,11 @@ go to https://localhost:8000 in the browser ### Using submodules +If you would like to run all projects on the hydra website (such as the documentation, garden, and api documentation), you must also clone the repos added as submodules, i.e.: +``` +git clone --recurse-submodules https://github.com/hydra-synth/hydra.git +``` + To add current submodules to an existing checked-out version of the repo: ``` git submodule update --init diff --git a/frontend/hydra-docs b/frontend/hydra-docs index 4cd2a6d..ef029ce 160000 --- a/frontend/hydra-docs +++ b/frontend/hydra-docs @@ -1 +1 @@ -Subproject commit 4cd2a6d4658547af14526c455598ae75e9b891e8 +Subproject commit ef029ce20d45d77ed5af22d143bab0e0d1b68b26 diff --git a/frontend/hydra-functions b/frontend/hydra-functions index 32cb7f0..b12d492 160000 --- a/frontend/hydra-functions +++ b/frontend/hydra-functions @@ -1 +1 @@ -Subproject commit 32cb7f0522021d34b56ccaec89552e6edfe6bb46 +Subproject commit b12d49227ab892bef1e7e05c46904671bee06fff diff --git a/frontend/web-editor/public/bundle.js b/frontend/web-editor/public/bundle.js index 9b5e8e5..6cb4259 100644 --- a/frontend/web-editor/public/bundle.js +++ b/frontend/web-editor/public/bundle.js @@ -50500,7 +50500,7 @@ const i18nextBrowserLanguageDetector = require('i18next-browser-languagedetector const languageResources = require('./text-elements.js') -const availableLanguages = ['ja', 'es', 'ar'] // localizations available in repository at /hydra-synth/l10n +const availableLanguages = ['ja', 'es', 'ar', 'id', 'pt-br'] // localizations available in repository at /hydra-synth/l10n const languagePath = (lang) => `https://raw.githubusercontent.com/hydra-synth/l10n/main/${lang}/editor.json` i18next @@ -50549,7 +50549,11 @@ module.exports = function store(state, emitter) { }) function updateAvailableLanguages() { - Object.keys(languageResources).forEach((key) => languages[key] = i18next.getFixedT(key)('language-name')) + Object.keys(languageResources).forEach((key) => { + // for some reason, 'pt-br' was not working, use just pt instead + const k = key.split('-')[0] + languages[k] = i18next.getFixedT(k)('language-name') + }) state.translation = { t: i18next.t, @@ -50574,7 +50578,13 @@ module.exports = function store(state, emitter) { } }).then(json => { // console.log(json) - i18next.addResourceBundle(lang, 'translation', json) + window.i18n = i18next + console.log('adding language', lang, json) + + // for some reason, 'pt-br' was not working, use just pt instead + const k = lang.split('-')[0] + i18next.addResourceBundle(k, 'translation', json) + const languages = {} updateAvailableLanguages() emitter.emit('render') @@ -51444,7 +51454,7 @@ module.exports = function mainView(state, emit) {