summaryrefslogtreecommitdiff
path: root/library/misc.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 16:51:28 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 16:51:28 +0200
commit8f27768c1c35f09152b35caeab20e705086fd03f (patch)
tree1b1c8fa36bb2b7fc60e2be551a454de239bb5c7f /library/misc.cpp
parent1.7 (diff)
downloadFreeFileSync-8f27768c1c35f09152b35caeab20e705086fd03f.tar.gz
FreeFileSync-8f27768c1c35f09152b35caeab20e705086fd03f.tar.bz2
FreeFileSync-8f27768c1c35f09152b35caeab20e705086fd03f.zip
1.8
Diffstat (limited to 'library/misc.cpp')
-rw-r--r--library/misc.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/library/misc.cpp b/library/misc.cpp
index 44dcaf0e..7d798ec0 100644
--- a/library/misc.cpp
+++ b/library/misc.cpp
@@ -2,6 +2,7 @@
#include <fstream>
#include <wx/msgdlg.h>
#include "resources.h"
+#include "globalFunctions.h"
void exchangeEscapeChars(wxString& data)
{
@@ -25,7 +26,7 @@ CustomLocale::~CustomLocale()
ofstream output("lang.dat");
if (output)
{
- output<<currentLanguage<<char(0);
+ globalFunctions::writeInt(output, currentLanguage);
output.close();
}
else
@@ -41,9 +42,7 @@ void CustomLocale::loadLanguageFromCfg() //retrieve language from config file:
ifstream input("lang.dat");
if (input)
{
- char buffer[20];
- input.getline(buffer, 20, char(0));
- language = atoi(buffer);
+ language = globalFunctions::readInt(input);
input.close();
}
else
@@ -65,7 +64,9 @@ void CustomLocale::loadLanguageFile(int language)
case wxLANGUAGE_GERMAN:
languageFile = "german.lng";
break;
-
+ case wxLANGUAGE_FRENCH:
+ languageFile = "french.lng";
+ break;
default:
languageFile = string();
currentLanguage = wxLANGUAGE_ENGLISH;
@@ -87,13 +88,13 @@ void CustomLocale::loadLanguageFile(int language)
//----------
//Linux: 0xa
//Mac: 0xd
- //Win: 0xd 0xa
+ //Win: 0xd 0xa <- language files are in Windows format
while (langFile.getline(temp, bufferSize, 0xd)) //specify delimiter explicitely
{
langFile.get(); //discard the 0xa character
- //wxString formattedString(temp, *wxConvUTF8, bufferSize); //convert UTF8 input to Unicode
- wxString formattedString(temp);
+ //wxString formattedString = wxString::FromUTF8(temp);
+ wxString formattedString = wxString::From8BitData(temp);
exchangeEscapeChars(formattedString);
bgstack15