mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Prepare for moving editor and classref translations to godot-editor-l10n repo
- Separate editor interface and property translations. - Add property translation in TranslationServer. - The split and merge of the POT/PO/Makefiles and extract scripts is done directly in godot-editor-l10n, the files will be removed in the next commit. - Remove the hardcoded "to_include" lists from the SCsub, we'll only commit the files which are ready to inclue.
This commit is contained in:
parent
bdad9770d6
commit
5d7e003b29
10 changed files with 82 additions and 11 deletions
|
@ -768,6 +768,20 @@ StringName TranslationServer::doc_translate_plural(const StringName &p_message,
|
|||
return p_message_plural;
|
||||
}
|
||||
|
||||
void TranslationServer::set_property_translation(const Ref<Translation> &p_translation) {
|
||||
property_translation = p_translation;
|
||||
}
|
||||
|
||||
StringName TranslationServer::property_translate(const StringName &p_message) const {
|
||||
if (property_translation.is_valid()) {
|
||||
StringName r = property_translation->get_message(p_message);
|
||||
if (r) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
return p_message;
|
||||
}
|
||||
|
||||
bool TranslationServer::is_pseudolocalization_enabled() const {
|
||||
return pseudolocalization_enabled;
|
||||
}
|
||||
|
|
|
@ -78,6 +78,7 @@ class TranslationServer : public Object {
|
|||
HashSet<Ref<Translation>> translations;
|
||||
Ref<Translation> tool_translation;
|
||||
Ref<Translation> doc_translation;
|
||||
Ref<Translation> property_translation;
|
||||
|
||||
bool enabled = true;
|
||||
|
||||
|
@ -174,6 +175,8 @@ public:
|
|||
void set_doc_translation(const Ref<Translation> &p_translation);
|
||||
StringName doc_translate(const StringName &p_message, const StringName &p_context = "") const;
|
||||
StringName doc_translate_plural(const StringName &p_message, const StringName &p_message_plural, int p_n, const StringName &p_context = "") const;
|
||||
void set_property_translation(const Ref<Translation> &p_translation);
|
||||
StringName property_translate(const StringName &p_message) const;
|
||||
|
||||
void setup();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue