diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-08-18 22:29:15 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2017-08-18 22:38:38 +0200 |
commit | 18a73153812d4f9be82ec30eafdb8961c625c97b (patch) | |
tree | 62a0624429a5000fee51f9ff8279651a4e85a214 /core | |
parent | b20952ebfff216acc07f6bbcad35b5a1e97a310c (diff) |
Rename localization method to `tr` again
Partial revert of #10380 based on contributor ~~bullying~~ feedback.
Diffstat (limited to 'core')
-rw-r--r-- | core/object.cpp | 8 | ||||
-rw-r--r-- | core/object.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/core/object.cpp b/core/object.cpp index 3cfd74a448..06c2603b74 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1560,7 +1560,7 @@ void Object::initialize_class() { initialized = true; } -StringName Object::localize(const StringName &p_message) const { +StringName Object::tr(const StringName &p_message) const { if (!_can_translate || !TranslationServer::get_singleton()) return p_message; @@ -1707,11 +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_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("localize", "message"), &Object::localize); + ClassDB::bind_method(D_METHOD("set_message_translation", "enable"), &Object::set_message_translation); + ClassDB::bind_method(D_METHOD("can_translate_messages"), &Object::can_translate_messages); + ClassDB::bind_method(D_METHOD("tr", "message"), &Object::tr); 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 b694876505..8a858b5b00 100644 --- a/core/object.h +++ b/core/object.h @@ -679,12 +679,12 @@ public: virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const; - StringName localize(const StringName &p_message) const; //translate message (internationalization) + StringName tr(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_localization(bool p_enable) { _can_translate = p_enable; } + _FORCE_INLINE_ void set_message_translation(bool p_enable) { _can_translate = p_enable; } _FORCE_INLINE_ bool can_translate_messages() const { return _can_translate; } #ifdef TOOLS_ENABLED |