summaryrefslogtreecommitdiffstats
path: root/core/string
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2023-10-05 21:12:10 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2024-03-31 18:40:14 +0800
commit479b7afa8e83607b05a39da71b370b3aee78688e (patch)
tree30d3528eb9138477e5cefe6e3b3431e0559ca509 /core/string
parent29b3d9e9e538f0aa8effc8ad8bf19a2915292a89 (diff)
downloadredot-engine-479b7afa8e83607b05a39da71b370b3aee78688e.tar.gz
Add context support for editor property name i18n
Diffstat (limited to 'core/string')
-rw-r--r--core/string/translation.cpp4
-rw-r--r--core/string/translation.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/core/string/translation.cpp b/core/string/translation.cpp
index 0a0052d6cb..613edd11cd 100644
--- a/core/string/translation.cpp
+++ b/core/string/translation.cpp
@@ -776,9 +776,9 @@ void TranslationServer::set_property_translation(const Ref<Translation> &p_trans
property_translation = p_translation;
}
-StringName TranslationServer::property_translate(const StringName &p_message) const {
+StringName TranslationServer::property_translate(const StringName &p_message, const StringName &p_context) const {
if (property_translation.is_valid()) {
- StringName r = property_translation->get_message(p_message);
+ StringName r = property_translation->get_message(p_message, p_context);
if (r) {
return r;
}
diff --git a/core/string/translation.h b/core/string/translation.h
index 470ba88232..78d6721347 100644
--- a/core/string/translation.h
+++ b/core/string/translation.h
@@ -183,7 +183,7 @@ public:
StringName tool_translate(const StringName &p_message, const StringName &p_context = "") const;
StringName tool_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;
+ StringName property_translate(const StringName &p_message, const StringName &p_context = "") const;
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;