You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Ignore fuzzy translations
This commit is contained in:
@@ -51,6 +51,8 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
|
|||||||
|
|
||||||
Ref<Translation> translation = Ref<Translation>(memnew(Translation));
|
Ref<Translation> translation = Ref<Translation>(memnew(Translation));
|
||||||
int line = 1;
|
int line = 1;
|
||||||
|
bool skip_this;
|
||||||
|
bool skip_next;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
@@ -60,9 +62,10 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
|
|||||||
|
|
||||||
if (status == STATUS_READING_STRING) {
|
if (status == STATUS_READING_STRING) {
|
||||||
|
|
||||||
if (msg_id != "")
|
if (msg_id != "") {
|
||||||
|
if (!skip_this)
|
||||||
translation->add_message(msg_id, msg_str);
|
translation->add_message(msg_id, msg_str);
|
||||||
else if (config == "")
|
} else if (config == "")
|
||||||
config = msg_str;
|
config = msg_str;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -85,15 +88,18 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
|
|||||||
ERR_FAIL_V(RES());
|
ERR_FAIL_V(RES());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg_id != "")
|
if (msg_id != "") {
|
||||||
|
if (!skip_this)
|
||||||
translation->add_message(msg_id, msg_str);
|
translation->add_message(msg_id, msg_str);
|
||||||
else if (config == "")
|
} else if (config == "")
|
||||||
config = msg_str;
|
config = msg_str;
|
||||||
|
|
||||||
l = l.substr(5, l.length()).strip_edges();
|
l = l.substr(5, l.length()).strip_edges();
|
||||||
status = STATUS_READING_ID;
|
status = STATUS_READING_ID;
|
||||||
msg_id = "";
|
msg_id = "";
|
||||||
msg_str = "";
|
msg_str = "";
|
||||||
|
skip_this = skip_next;
|
||||||
|
skip_next = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (l.begins_with("msgstr")) {
|
if (l.begins_with("msgstr")) {
|
||||||
@@ -110,6 +116,9 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (l == "" || l.begins_with("#")) {
|
if (l == "" || l.begins_with("#")) {
|
||||||
|
if (l.find("fuzzy") != -1) {
|
||||||
|
skip_next = true;
|
||||||
|
}
|
||||||
line++;
|
line++;
|
||||||
continue; //nothing to read or comment
|
continue; //nothing to read or comment
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user