124 if (!
mFile.getline(line, 1000))
129 if (!
mFile.getline(line, 1000))
142 const std::string msgId1(
"msgid \"");
171 const size_t msgId1Size = msgId1.size();
174 mLine.size() - 1 - msgId1Size));
183 else if (
mLine ==
"#, fuzzy")
196 const std::string msgStr1(
"msgstr \"");
198 const std::string msgStr2(
"msgstr[0] \"");
225 const size_t msgStr1Size = msgStr1.size();
228 mLine.size() - 1 - msgStr1Size));
236 const size_t msgStr2Size = msgStr2.size();
239 mLine.size() - 1 - msgStr2Size));
251 const size_t sz =
mLine.size();
253 return sz > 2 &&
mLine[0] ==
'\"' &&
mLine[sz - 1] ==
'\"';
271 return strprintf(
"translations/%s.po", lang.c_str());
void log(const char *const log_text,...)
void set(const std::string &key, const std::string &value)
PoDict * load(const std::string &lang, const std::string &fileName, PoDict *const dict)
void openFile(const std::string &name)
static std::string getFileName(const std::string &lang)
static PoDict * getEmptyDict()
static bool checkLang(const std::string &lang)
void setLang(const std::string &lang)
static void convertStr(std::string &str)
const char * loadFile(std::string filename, int &fileSize)
bool exists(std::string name)
std::string & replaceAll(std::string &context, const std::string &from, const std::string &to)
std::string strprintf(const char *const format,...)
bool strStartWith(const std::string &str1, const std::string &str2)