- added the ability for advanced translation features (transifex users can download and remove custom files from the transfex website and test their work)

This commit is contained in:
Mark Vejvoda
2012-10-22 05:08:52 +00:00
parent 676b2bef3a
commit 4598299caf
8 changed files with 459 additions and 46 deletions

View File

@@ -2093,6 +2093,32 @@ bool searchAndReplaceTextInFile(string fileName, string findText, string replace
return replacedText;
}
void saveDataToFile(string filename, string data) {
//Open an input and output stream in binary mode
#if defined(WIN32) && !defined(__MINGW32__)
FILE *fp2 = _wfopen(utf8_decode(filename).c_str(), L"wb");
ofstream out(fp2);
#else
ofstream out(filename.c_str(),ios::binary);
#endif
if(out.is_open()) {
out<< data;
}
else if(out.is_open() == false) {
throw megaglest_runtime_error("cannot open input file [" + filename + "]");
}
//Close file
out.close();
#if defined(WIN32) && !defined(__MINGW32__)
if(fp2) {
fclose(fp2);
}
#endif
}
void copyFileTo(string fromFileName, string toFileName) {
//Open an input and output stream in binary mode
#if defined(WIN32) && !defined(__MINGW32__)