summaryrefslogtreecommitdiff
path: root/electron/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'electron/src/lib')
-rw-r--r--electron/src/lib/api.js8
-rw-r--r--electron/src/lib/i18n.js9
2 files changed, 17 insertions, 0 deletions
diff --git a/electron/src/lib/api.js b/electron/src/lib/api.js
new file mode 100644
index 00000000..45b67d56
--- /dev/null
+++ b/electron/src/lib/api.js
@@ -0,0 +1,8 @@
+const axios = require('axios')
+const queryString = require('query-string')
+
+var port = queryString.parse(global.location.search).port
+
+module.exports = axios.create({
+ baseURL: `http://127.0.0.1:${port}/`
+})
diff --git a/electron/src/lib/i18n.js b/electron/src/lib/i18n.js
new file mode 100644
index 00000000..886fd654
--- /dev/null
+++ b/electron/src/lib/i18n.js
@@ -0,0 +1,9 @@
+module.exports.selectLanguage = function () {
+ ['LANGUAGE', 'LC_ALL', 'LC_MESSAGES', 'LANG'].forEach(language => {
+ if (process.env[language]) {
+ return process.env[language].split(":")[0]
+ }
+ })
+
+ return "en_US"
+}