Get the app directory via an absolute path instead of a relative one. Fixes #516

This commit is contained in:
gyroninja 2017-09-09 21:47:46 -07:00
parent 9cb28e8f46
commit 716fc604f4
2 changed files with 4 additions and 2 deletions

View file

@ -4,6 +4,7 @@ import batchActions from "util/batchActions";
import lbry from "lbry"; import lbry from "lbry";
import fs from "fs"; import fs from "fs";
import http from "http"; import http from "http";
import { remote } from "electron";
export function doFetchDaemonSettings() { export function doFetchDaemonSettings() {
return function(dispatch, getState) { return function(dispatch, getState) {
@ -48,7 +49,7 @@ export function doSetClientSetting(key, value) {
export function doDownloadLanguage(langFile) { export function doDownloadLanguage(langFile) {
return function(dispatch, getState) { return function(dispatch, getState) {
const destinationPath = `app/locales/${langFile}`; const destinationPath = app.i18n.directory + "/" + langFile;
const language = langFile.replace(".json", ""); const language = langFile.replace(".json", "");
const req = http.get( const req = http.get(
{ {

View file

@ -1,5 +1,6 @@
import store from "store.js"; import store from "store.js";
import lbry from "./lbry.js"; import lbry from "./lbry.js";
import { remote } from "electron";
import * as settings from "constants/settings"; import * as settings from "constants/settings";
const env = ENV; const env = ENV;
@ -10,7 +11,7 @@ const language = lbry.getClientSetting(settings.LANGUAGE)
? lbry.getClientSetting(settings.LANGUAGE) ? lbry.getClientSetting(settings.LANGUAGE)
: "en"; : "en";
const i18n = require("y18n")({ const i18n = require("y18n")({
directory: "app/locales", directory: remote.app.getAppPath() + "/locales",
updateFiles: false, updateFiles: false,
locale: language, locale: language,
}); });