1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

i18n: Add support for translating the class reference

- Parse `.po` files from `doc/translations/*.po` like already done
  with `editor/translations/*.po`.
- Add logic to register a doc translation mapping in `TranslationServer`
  and `EditorSettings`.
- Add `DTR()` to lookup the doc translation mapping (similar to `TTR()`).
  Strings are automatically dedented and stripped of whitespace to ensure
  that they would match the translation catalog.
- Use `DTR()` to translate relevant strings in `EditorHelp`,
  `EditorInspector`, `CreateDialog`, `ConnectionsDialog`.
- Small simplification to `TranslationLoaderPO`, the path argument was
  not really meaningful.
This commit is contained in:
Rémi Verschelde
2020-03-18 18:34:36 +01:00
parent b0aecb466d
commit 4857648a16
13 changed files with 108 additions and 54 deletions

View File

@@ -248,7 +248,7 @@ void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p
item->set_collapsed(collapse);
}
const String &description = EditorHelp::get_doc_data()->class_list[p_type].brief_description;
const String &description = DTR(EditorHelp::get_doc_data()->class_list[p_type].brief_description);
item->set_tooltip(0, description);
item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, base_type));
@@ -556,7 +556,7 @@ void CreateDialog::_item_selected() {
if (!EditorHelp::get_doc_data()->class_list.has(name))
return;
help_bit->set_text(EditorHelp::get_doc_data()->class_list[name].brief_description);
help_bit->set_text(DTR(EditorHelp::get_doc_data()->class_list[name].brief_description));
get_ok()->set_disabled(false);
}