From 716fc604f43ddaa34bf68afd08b7814c585fb175 Mon Sep 17 00:00:00 2001 From: gyroninja Date: Sat, 9 Sep 2017 21:47:46 -0700 Subject: [PATCH 1/2] Get the app directory via an absolute path instead of a relative one. Fixes #516 --- ui/js/actions/settings.js | 3 ++- ui/js/app.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/js/actions/settings.js b/ui/js/actions/settings.js index 7038fd284..195a42ece 100644 --- a/ui/js/actions/settings.js +++ b/ui/js/actions/settings.js @@ -4,6 +4,7 @@ import batchActions from "util/batchActions"; import lbry from "lbry"; import fs from "fs"; import http from "http"; +import { remote } from "electron"; export function doFetchDaemonSettings() { return function(dispatch, getState) { @@ -48,7 +49,7 @@ export function doSetClientSetting(key, value) { export function doDownloadLanguage(langFile) { return function(dispatch, getState) { - const destinationPath = `app/locales/${langFile}`; + const destinationPath = app.i18n.directory + "/" + langFile; const language = langFile.replace(".json", ""); const req = http.get( { diff --git a/ui/js/app.js b/ui/js/app.js index ecbb5f83c..0aa908904 100644 --- a/ui/js/app.js +++ b/ui/js/app.js @@ -1,5 +1,6 @@ import store from "store.js"; import lbry from "./lbry.js"; +import { remote } from "electron"; import * as settings from "constants/settings"; const env = ENV; @@ -10,7 +11,7 @@ const language = lbry.getClientSetting(settings.LANGUAGE) ? lbry.getClientSetting(settings.LANGUAGE) : "en"; const i18n = require("y18n")({ - directory: "app/locales", + directory: remote.app.getAppPath() + "/locales", updateFiles: false, locale: language, }); -- 2.45.3 From 5c56de8034f8bb8595af8f566069007ac6764625 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Mon, 11 Sep 2017 18:23:17 -0400 Subject: [PATCH 2/2] remove unused import --- ui/js/actions/settings.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/js/actions/settings.js b/ui/js/actions/settings.js index 195a42ece..21e27f1fb 100644 --- a/ui/js/actions/settings.js +++ b/ui/js/actions/settings.js @@ -4,7 +4,6 @@ import batchActions from "util/batchActions"; import lbry from "lbry"; import fs from "fs"; import http from "http"; -import { remote } from "electron"; export function doFetchDaemonSettings() { return function(dispatch, getState) { -- 2.45.3