summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-08-17 22:41:55 +0200
committerGitHub <noreply@github.com>2017-08-17 22:41:55 +0200
commitee59e627ded8c9d0a3d2d33b2d6cc6734a62b04d (patch)
tree7c70f0dad8e79e273d9bcaadd0ff07a0c189b299 /core
parent33c1d25517050470689924c60414feaf295ce05f (diff)
parentc72529baf09927b381e7850a0f132c1473b16ee2 (diff)
Merge pull request #10380 from akien-mga/XL_MESSAGE
Rename `XL_MESSAGE`/`tr` to `localize`
Diffstat (limited to 'core')
-rw-r--r--core/object.cpp12
-rw-r--r--core/object.h5
2 files changed, 5 insertions, 12 deletions
diff --git a/core/object.cpp b/core/object.cpp
index 62b2b5d545..3cfd74a448 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -1560,7 +1560,7 @@ void Object::initialize_class() {
initialized = true;
}
-StringName Object::XL_MESSAGE(const StringName &p_message) const {
+StringName Object::localize(const StringName &p_message) const {
if (!_can_translate || !TranslationServer::get_singleton())
return p_message;
@@ -1568,11 +1568,6 @@ StringName Object::XL_MESSAGE(const StringName &p_message) const {
return TranslationServer::get_singleton()->translate(p_message);
}
-StringName Object::tr(const StringName &p_message) const {
-
- return XL_MESSAGE(p_message);
-}
-
void Object::_clear_internal_resource_paths(const Variant &p_var) {
switch (p_var.get_type()) {
@@ -1712,12 +1707,11 @@ void Object::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_block_signals", "enable"), &Object::set_block_signals);
ClassDB::bind_method(D_METHOD("is_blocking_signals"), &Object::is_blocking_signals);
- ClassDB::bind_method(D_METHOD("set_message_translation", "enable"), &Object::set_message_translation);
+ ClassDB::bind_method(D_METHOD("set_message_localization", "enable"), &Object::set_message_localization);
ClassDB::bind_method(D_METHOD("can_translate_messages"), &Object::can_translate_messages);
ClassDB::bind_method(D_METHOD("property_list_changed_notify"), &Object::property_list_changed_notify);
- ClassDB::bind_method(D_METHOD("XL_MESSAGE", "message"), &Object::XL_MESSAGE);
- ClassDB::bind_method(D_METHOD("tr", "message"), &Object::tr);
+ ClassDB::bind_method(D_METHOD("localize", "message"), &Object::localize);
ClassDB::bind_method(D_METHOD("is_queued_for_deletion"), &Object::is_queued_for_deletion);
diff --git a/core/object.h b/core/object.h
index 4648d9d90e..ebcd4afeb9 100644
--- a/core/object.h
+++ b/core/object.h
@@ -678,13 +678,12 @@ public:
virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const;
- StringName XL_MESSAGE(const StringName &p_message) const; //translate message (internationalization)
- StringName tr(const StringName &p_message) const; //translate message (alternative)
+ StringName localize(const StringName &p_message) const; //translate message (internationalization)
bool _is_queued_for_deletion; // set to true by SceneTree::queue_delete()
bool is_queued_for_deletion() const;
- _FORCE_INLINE_ void set_message_translation(bool p_enable) { _can_translate = p_enable; }
+ _FORCE_INLINE_ void set_message_localization(bool p_enable) { _can_translate = p_enable; }
_FORCE_INLINE_ bool can_translate_messages() const { return _can_translate; }
#ifdef TOOLS_ENABLED