From d9342e1180b391bdbebbe9a196fb91599d75384c Mon Sep 17 00:00:00 2001 From: Nathan Crawford Date: Mon, 28 Dec 2015 20:17:09 -0500 Subject: [PATCH] Load translations relative to .exe instead of working directory --- embroideryReader/Translation.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/embroideryReader/Translation.cs b/embroideryReader/Translation.cs index e6177b0..577c486 100644 --- a/embroideryReader/Translation.cs +++ b/embroideryReader/Translation.cs @@ -142,15 +142,15 @@ namespace embroideryReader // Names are just the file name without the extension public void Load(String translationName) { - defaultFile = new IniFile(System.IO.Path.Combine(TRANSLATIONS_FOLDER, DEFAULT_TRANSLATION_NAME + TRANSLATION_FILE_EXT)); - String translationPath = System.IO.Path.Combine(TRANSLATIONS_FOLDER, translationName + TRANSLATION_FILE_EXT); + string exePath = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath); + String translationPath = System.IO.Path.Combine(exePath, System.IO.Path.Combine(TRANSLATIONS_FOLDER, translationName + TRANSLATION_FILE_EXT)); if (System.IO.File.Exists(translationPath)) { translationFile = new IniFile(translationPath); } else { - translationFile = defaultFile; + translationFile = new IniFile(System.IO.Path.Combine(exePath, System.IO.Path.Combine(TRANSLATIONS_FOLDER, DEFAULT_TRANSLATION_NAME + TRANSLATION_FILE_EXT))); } }