From ba6654e99934ba9a4f4ed86510df17a9588468c0 Mon Sep 17 00:00:00 2001 From: MathieuG-P Date: Fri, 15 Jul 2022 15:17:03 +0200 Subject: [PATCH] only need first two letters of a lang now --- assets/jsons/translations/en-US.json | 204 ------------------ .../translations/{en-EN.json => en.json} | 0 .../translations/{es-ES.json => es.json} | 0 .../translations/{fr-FR.json => fr.json} | 0 src/renderer/services/i18n.service.ts | 2 +- 5 files changed, 1 insertion(+), 205 deletions(-) delete mode 100644 assets/jsons/translations/en-US.json rename assets/jsons/translations/{en-EN.json => en.json} (100%) rename assets/jsons/translations/{es-ES.json => es.json} (100%) rename assets/jsons/translations/{fr-FR.json => fr.json} (100%) diff --git a/assets/jsons/translations/en-US.json b/assets/jsons/translations/en-US.json deleted file mode 100644 index 0dfbadc6..00000000 --- a/assets/jsons/translations/en-US.json +++ /dev/null @@ -1,204 +0,0 @@ -{ - "misc":{ - "download": "Download", - "verify": "Verify", - "launch": "Launch", - "mods": "Mods", - "maps": "Maps", - "cancel": "Cancel" - }, - "pages":{ - "version-viewer":{ - "launch-mods":{ - "oculus": "Oculus Mod", - "desktop": "Desktop Mod", - "debug": "Debug Mod" - }, - "dropdown":{ - "open-folder": "Open folder", - "verify-files": "Verify files", - "uninstall": "Uninstall" - } - }, - "available-versions":{ - "title": "Select a version", - "steam-release":"Release page" - }, - "settings":{ - "steam":{ - "title":"Steam", - "description":"If you log out of Steam, you will have to log back in to download a new version of Beat Saber.", - "logout":"Log out" - }, - "appearance":{ - "title":"Appearance", - "description":"Choose the two main colours of BSManager.", - "reset":"Reset", - "sub-title":"Theme", - "themes":{ - "dark":"Dark", - "light": "Light", - "os": "Sync with computer" - } - }, - "installation-folder":{ - "title":"Installation folder", - "description":"Change the default folder for Beat Saber versions and other upcoming features.", - "choose-folder":"Choose folder" - }, - "language":{ - "title":"Language", - "description":"Select a language.", - "languages":{ - "en-EN": "English, UK", - "en-US": "English, US", - "fr-FR": "FranΓ§ais", - "es-ES": "EspaΓ±ol", - "translated":{ - "en-EN": "English, United Kingdom", - "en-US": "English, USA", - "fr-FR": "French", - "es-ES": "Spanish" - } - } - } - } - }, - "notifications":{ - "types":{ - "error": "🚨 Error", - "warning": "⚠️ Warning", - "success": "πŸŽ‰ Success" - }, - "bs-download":{ - "success":{ - "titles":{ - "download-success": "Download complete", - "verification-finished":"Verification complete" - } - }, - "warnings":{ - "msg":{ - "ManifestChecksum": "The previously downloaded manifest does not match the new πŸ€”", - "ConnectionTimeout": "Your internet connection seems unstable πŸ₯Ά", - "Unknown": "Something strange has happened πŸ€” Your connection is probably unstable." - } - }, - "errors":{ - "titles":{ - "verification-failed":"The verification failed." - }, - "msg":{ - "Password": "Password is invalid.", - "InvalidCredentials": "Your e-mail or password is invalid 😴", - "NoManifest": "No manifest was found", - "DirectoryCreate": "Unable to install the necessary folders.", - "NotAvailableApp": "Are you trying to download BeatSaber when you don't have it ? 🀣", - "DepotNotFound": "Unable to download BeatSaber πŸ˜₯ try again later πŸ˜•", - "NotCompleted": "The download could not complete Β―\\_(ツ)_/Β―", - "InvalidManifest": "Unable to download BeatSaber πŸ˜₯ try again later πŸ˜•", - "NoValidKey": "Unable to download BeatSaber πŸ˜₯ try again later πŸ˜•", - "NoManifestCode": "Unable to download BeatSaber πŸ˜₯ try again later πŸ˜•", - "401": "Steam doesn't seem to want to let us download BeatSaber 😒", - "404": "Unable to contact Steam servers.", - "Unknown": "An unknown error occurred Β―\\_(ツ)_/Β―", - "NoServer": "Unable to contact Steam servers.", - "NotAllowed": "Apparently you are not allowed to download BeatSaber πŸ₯±", - "ConnectionTimeout": "Cannot connect to Steam πŸ˜•", - "SteamLib": "If you have this error, report the bug on GitHub with the logs pls.", - "ConnectionError": "Unable to connect to Steam after 10 tries 🀯", - "LicenceError": "Unable to get the list of licenses.", - "verification-failed": "Verification failed, try again later." - } - } - }, - "settings":{ - "move-folder":{ - "success":{ - "titles":{ - "transfer-finished":"Transfer complete" - } - }, - "errors":{ - "titles":{ - "transfer-failed":"Transfer failed πŸ˜•" - } - } - }, - "steam":{ - "success":{ - "titles":{ - "logout": "Disconnected from Steam." - } - } - } - }, - "bs-launch":{ - "success":{ - "titles":{ - "launching": "Launching...πŸš€" - } - }, - "errors":{ - "titles":{ - "UNABLE_TO_LAUNCH": "Unable to launch", - "STEAM_NOT_RUNNING": "Steam is not running", - "BS_ALREADY_RUNNING": "BeatSaber already running", - "EXE_NOT_FINDED": "Missing files" - }, - "msg":{ - "STEAM_NOT_RUNNING": "Steam must be running to launch BeatSaber.", - "BS_ALREADY_RUNNING": "Close BeatSaber before launching it again.", - "EXE_NOT_FINDED": "Some files seem to be missing, try to verify the files." - } - } - } - }, - "modals":{ - "guard":{ - "title": "Steam Guard", - "inputs":{ - "guard-code":{ - "label": "Guard Code", - "placeholder": "Enter your Guard code" - } - }, - "buttons":{ - "submit": "Login" - } - }, - "steam-login":{ - "title": "Steam Login", - "inputs":{ - "username":{ - "label": "Username", - "placeholder": "Enter your username" - }, - "password":{ - "label": "Password", - "placeholder": "Enter your password" - }, - "stay":{ - "label": "Stay connected" - } - }, - "buttons":{ - "submit": "Login" - } - }, - "bs-uninstall":{ - "title": "Uninstall", - "description": "Are you sure you want to uninstall BeatSaber {version} ? You will have to download it again to play it.", - "buttons":{ - "submit": "Uninstall" - } - }, - "install-folder":{ - "title": "Installation folder", - "description": "Changing the default installation folder will result in moving all installed data to the new folder.", - "buttons":{ - "submit": "Choose folder" - } - } - } -} \ No newline at end of file diff --git a/assets/jsons/translations/en-EN.json b/assets/jsons/translations/en.json similarity index 100% rename from assets/jsons/translations/en-EN.json rename to assets/jsons/translations/en.json diff --git a/assets/jsons/translations/es-ES.json b/assets/jsons/translations/es.json similarity index 100% rename from assets/jsons/translations/es-ES.json rename to assets/jsons/translations/es.json diff --git a/assets/jsons/translations/fr-FR.json b/assets/jsons/translations/fr.json similarity index 100% rename from assets/jsons/translations/fr-FR.json rename to assets/jsons/translations/fr.json diff --git a/src/renderer/services/i18n.service.ts b/src/renderer/services/i18n.service.ts index 90a0965e..2bc0e947 100644 --- a/src/renderer/services/i18n.service.ts +++ b/src/renderer/services/i18n.service.ts @@ -26,7 +26,7 @@ export class I18nService { this.currentLanguage$.pipe(filter(l => !!l), distinctUntilChanged()).subscribe(lang => { this.cache.clear(); - this.dictionary = require(`../../../assets/jsons/translations/${lang}.json`); + this.dictionary = require(`../../../assets/jsons/translations/${lang.split("-")[0]}.json`); }); }