kopia lustrzana https://github.com/njcrawford/EmbroideryReader
Load translations relative to .exe instead of working directory
rodzic
5aa9cc9832
commit
d9342e1180
|
@ -142,15 +142,15 @@ namespace embroideryReader
|
||||||
// Names are just the file name without the extension
|
// Names are just the file name without the extension
|
||||||
public void Load(String translationName)
|
public void Load(String translationName)
|
||||||
{
|
{
|
||||||
defaultFile = new IniFile(System.IO.Path.Combine(TRANSLATIONS_FOLDER, DEFAULT_TRANSLATION_NAME + TRANSLATION_FILE_EXT));
|
string exePath = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath);
|
||||||
String translationPath = System.IO.Path.Combine(TRANSLATIONS_FOLDER, translationName + TRANSLATION_FILE_EXT);
|
String translationPath = System.IO.Path.Combine(exePath, System.IO.Path.Combine(TRANSLATIONS_FOLDER, translationName + TRANSLATION_FILE_EXT));
|
||||||
if (System.IO.File.Exists(translationPath))
|
if (System.IO.File.Exists(translationPath))
|
||||||
{
|
{
|
||||||
translationFile = new IniFile(translationPath);
|
translationFile = new IniFile(translationPath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
translationFile = defaultFile;
|
translationFile = new IniFile(System.IO.Path.Combine(exePath, System.IO.Path.Combine(TRANSLATIONS_FOLDER, DEFAULT_TRANSLATION_NAME + TRANSLATION_FILE_EXT)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue