diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/io/http_client.cpp | 12 | ||||
-rw-r--r-- | core/io/http_client.h | 2 | ||||
-rw-r--r-- | core/script_language.cpp | 1 | ||||
-rw-r--r-- | core/script_language.h | 2 | ||||
-rw-r--r-- | core/translation.cpp | 13 | ||||
-rw-r--r-- | core/translation.h | 4 |
6 files changed, 17 insertions, 17 deletions
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index b8c0a2b616..46d52384e5 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -189,16 +189,6 @@ Error HTTPClient::request(Method p_method, const String &p_url, const Vector<Str return OK; } -Error HTTPClient::send_body_text(const String &p_body) { - - return OK; -} - -Error HTTPClient::send_body_data(const PoolByteArray &p_body) { - - return OK; -} - bool HTTPClient::has_response() const { return response_headers.size() != 0; @@ -629,8 +619,6 @@ void HTTPClient::_bind_methods() { ClassDB::bind_method(D_METHOD("get_connection"), &HTTPClient::get_connection); ClassDB::bind_method(D_METHOD("request_raw", "method", "url", "headers", "body"), &HTTPClient::request_raw); ClassDB::bind_method(D_METHOD("request", "method", "url", "headers", "body"), &HTTPClient::request, DEFVAL(String())); - ClassDB::bind_method(D_METHOD("send_body_text", "body"), &HTTPClient::send_body_text); - ClassDB::bind_method(D_METHOD("send_body_data", "body"), &HTTPClient::send_body_data); ClassDB::bind_method(D_METHOD("close"), &HTTPClient::close); ClassDB::bind_method(D_METHOD("has_response"), &HTTPClient::has_response); diff --git a/core/io/http_client.h b/core/io/http_client.h index 023370ae81..f8a3349e6e 100644 --- a/core/io/http_client.h +++ b/core/io/http_client.h @@ -169,8 +169,6 @@ public: Error request_raw(Method p_method, const String &p_url, const Vector<String> &p_headers, const PoolVector<uint8_t> &p_body); Error request(Method p_method, const String &p_url, const Vector<String> &p_headers, const String &p_body = String()); - Error send_body_text(const String &p_body); - Error send_body_data(const PoolByteArray &p_body); void close(); diff --git a/core/script_language.cpp b/core/script_language.cpp index 5ead91f26e..384e41e4bd 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -58,7 +58,6 @@ void Script::_bind_methods() { ClassDB::bind_method(D_METHOD("has_script_signal", "signal_name"), &Script::has_script_signal); ClassDB::bind_method(D_METHOD("is_tool"), &Script::is_tool); - ClassDB::bind_method(D_METHOD("get_node_type"), &Script::get_node_type); } void ScriptServer::set_scripting_enabled(bool p_enabled) { diff --git a/core/script_language.h b/core/script_language.h index c243ef781b..5da72d0492 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -107,8 +107,6 @@ public: virtual bool is_tool() const = 0; - virtual String get_node_type() const = 0; - virtual ScriptLanguage *get_language() const = 0; virtual bool has_script_signal(const StringName &p_signal) const = 0; diff --git a/core/translation.cpp b/core/translation.cpp index 27e3b202d0..54dbaf6ed5 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -957,6 +957,12 @@ String TranslationServer::get_locale() const { return locale; } +String TranslationServer::get_locale_name(const String &p_locale) const { + + if (!locale_name_map.has(p_locale)) return String(); + return locale_name_map[p_locale]; +} + void TranslationServer::add_translation(const Ref<Translation> &p_translation) { translations.insert(p_translation); @@ -1122,6 +1128,8 @@ void TranslationServer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_locale", "locale"), &TranslationServer::set_locale); ClassDB::bind_method(D_METHOD("get_locale"), &TranslationServer::get_locale); + ClassDB::bind_method(D_METHOD("get_locale_name", "locale"), &TranslationServer::get_locale_name); + ClassDB::bind_method(D_METHOD("translate", "message"), &TranslationServer::translate); ClassDB::bind_method(D_METHOD("add_translation", "translation"), &TranslationServer::add_translation); @@ -1147,4 +1155,9 @@ TranslationServer::TranslationServer() : locale("en"), enabled(true) { singleton = this; + + for (int i = 0; locale_list[i]; ++i) { + + locale_name_map.insert(locale_list[i], locale_names[i]); + } } diff --git a/core/translation.h b/core/translation.h index cf59583ad6..5fec1d9f45 100644 --- a/core/translation.h +++ b/core/translation.h @@ -73,6 +73,8 @@ class TranslationServer : public Object { Set<Ref<Translation> > translations; Ref<Translation> tool_translation; + Map<String, String> locale_name_map; + bool enabled; static TranslationServer *singleton; @@ -91,6 +93,8 @@ public: void set_locale(const String &p_locale); String get_locale() const; + String get_locale_name(const String &p_locale) const; + void add_translation(const Ref<Translation> &p_translation); void remove_translation(const Ref<Translation> &p_translation); |