diff options
Diffstat (limited to 'core/io/translation_loader_po.cpp')
-rw-r--r-- | core/io/translation_loader_po.cpp | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp index 6f79e2554b..b47e634a5a 100644 --- a/core/io/translation_loader_po.cpp +++ b/core/io/translation_loader_po.cpp @@ -34,7 +34,6 @@ #include "core/translation.h" RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) { - enum Status { STATUS_NONE, @@ -58,13 +57,11 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) { bool is_eof = false; while (!is_eof) { - String l = f->get_line().strip_edges(); is_eof = f->eof_reached(); // If we reached last line and it's not a content line, break, otherwise let processing that last loop if (is_eof && l.empty()) { - if (status == STATUS_READING_ID) { memdelete(f); ERR_FAIL_V_MSG(RES(), f->get_path() + ":" + itos(line) + " Unexpected EOF while reading 'msgid' at file: "); @@ -74,9 +71,7 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) { } if (l.begins_with("msgid")) { - if (status == STATUS_READING_ID) { - memdelete(f); ERR_FAIL_V_MSG(RES(), f->get_path() + ":" + itos(line) + " Unexpected 'msgid', was expecting 'msgstr' while parsing: "); } @@ -96,9 +91,7 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) { } if (l.begins_with("msgstr")) { - if (status != STATUS_READING_ID) { - memdelete(f); ERR_FAIL_V_MSG(RES(), f->get_path() + ":" + itos(line) + " Unexpected 'msgstr', was expecting 'msgid' while parsing: "); } @@ -154,7 +147,6 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) { memdelete(f); if (status == STATUS_READING_STRING) { - if (msg_id != "") { if (!skip_this) translation->add_message(msg_id, msg_str); @@ -166,7 +158,6 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) { Vector<String> configs = config.split("\n"); for (int i = 0; i < configs.size(); i++) { - String c = configs[i].strip_edges(); int p = c.find(":"); if (p == -1) @@ -186,7 +177,6 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) { } RES TranslationLoaderPO::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) { - if (r_error) *r_error = ERR_CANT_OPEN; @@ -197,17 +187,14 @@ RES TranslationLoaderPO::load(const String &p_path, const String &p_original_pat } void TranslationLoaderPO::get_recognized_extensions(List<String> *p_extensions) const { - p_extensions->push_back("po"); //p_extensions->push_back("mo"); //mo in the future... } bool TranslationLoaderPO::handles_type(const String &p_type) const { - return (p_type == "Translation"); } String TranslationLoaderPO::get_resource_type(const String &p_path) const { - if (p_path.get_extension().to_lower() == "po") return "Translation"; return ""; |