summaryrefslogtreecommitdiff
path: root/electron/src/lib/i18n.js
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2024-05-01 19:34:25 +0200
committerGitHub <noreply@github.com>2024-05-01 19:34:25 +0200
commit2ee4175437bbfcddf98e5eacba9b019113716ac8 (patch)
treeaff6c7c9adfc27f0f33ab4e14edcf17829dbb282 /electron/src/lib/i18n.js
parenteb64c88a8bf9c8fe66c33a5309d28e526b994d25 (diff)
Remove electron entirely (#2859)
Co-authored-by: rejbasket
Diffstat (limited to 'electron/src/lib/i18n.js')
-rw-r--r--electron/src/lib/i18n.js47
1 files changed, 0 insertions, 47 deletions
diff --git a/electron/src/lib/i18n.js b/electron/src/lib/i18n.js
deleted file mode 100644
index 2a7c4f66..00000000
--- a/electron/src/lib/i18n.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Authors: see git history
- *
- * Copyright (c) 2010 Authors
- * Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
- *
- */
-
-export function selectLanguage(translations, flaskport) {
- var port = flaskport
- // get language from flask server, process in modern electron isn't exposed to renderer
- const request = new XMLHttpRequest();
- request.open('GET', `http://127.0.0.1:${port}/languages`, false)
- request.send(null)
- var process = undefined
-
- if (request.status === 200) {
- process = JSON.parse(request.responseText)
- }
- // get a list of available translations
- var availableTranslations = ['en_US'];
- for (var k in translations) availableTranslations.push(k);
-
- var lang = undefined;
-
- // get system language / Inkscape language
- ['LANG', 'LC_MESSAGES', 'LC_ALL', 'LANGUAGE'].forEach(language => {
- if (process[language]) {
- // split encoding information, we don't need it
- var current_lang = process[language].split('.')[0];
-
- if (current_lang.length == 2) {
- // current language has only two letters (e.g. en),
- // compare with available languages and if present, set to a long locale name (e.g. en_US)
- lang = availableTranslations.find((elem) => elem.startsWith(current_lang));
- } else {
- lang = current_lang;
- }
- }
- })
- // set default language
- if (lang === undefined) {
- lang = "en_US"
- }
- return lang
-}
-