Load translations relative to .exe instead of working directory

Branch_2.1.x
Nathan Crawford 2015-12-28 20:17:09 -05:00
rodzic 5aa9cc9832
commit d9342e1180
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -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)));
}
}