#include "translation_server.h"
#include "translation_server.compat.inc"
#include "core/config/project_settings.h"
#include "core/io/resource_loader.h"
#include "core/os/os.h"
#include "core/string/locales.h"
#ifdef TOOLS_ENABLED
#include "main/main.h"
#endif
struct _character_accent_pair { … };
static _character_accent_pair _character_to_accented[] = …;
Vector<TranslationServer::LocaleScriptInfo> TranslationServer::locale_script_info;
HashMap<String, String> TranslationServer::language_map;
HashMap<String, String> TranslationServer::script_map;
HashMap<String, String> TranslationServer::locale_rename_map;
HashMap<String, String> TranslationServer::country_name_map;
HashMap<String, String> TranslationServer::variant_map;
HashMap<String, String> TranslationServer::country_rename_map;
void TranslationServer::init_locale_info() { … }
String TranslationServer::standardize_locale(const String &p_locale) const { … }
String TranslationServer::_standardize_locale(const String &p_locale, bool p_add_defaults) const { … }
int TranslationServer::compare_locales(const String &p_locale_a, const String &p_locale_b) const { … }
String TranslationServer::get_locale_name(const String &p_locale) const { … }
Vector<String> TranslationServer::get_all_languages() const { … }
String TranslationServer::get_language_name(const String &p_language) const { … }
Vector<String> TranslationServer::get_all_scripts() const { … }
String TranslationServer::get_script_name(const String &p_script) const { … }
Vector<String> TranslationServer::get_all_countries() const { … }
String TranslationServer::get_country_name(const String &p_country) const { … }
void TranslationServer::set_locale(const String &p_locale) { … }
String TranslationServer::get_locale() const { … }
PackedStringArray TranslationServer::get_loaded_locales() const { … }
void TranslationServer::add_translation(const Ref<Translation> &p_translation) { … }
void TranslationServer::remove_translation(const Ref<Translation> &p_translation) { … }
Ref<Translation> TranslationServer::get_translation_object(const String &p_locale) { … }
void TranslationServer::clear() { … }
StringName TranslationServer::translate(const StringName &p_message, const StringName &p_context) const { … }
StringName TranslationServer::translate_plural(const StringName &p_message, const StringName &p_message_plural, int p_n, const StringName &p_context) const { … }
StringName TranslationServer::_get_message_from_translations(const StringName &p_message, const StringName &p_context, const String &p_locale, bool plural, const String &p_message_plural, int p_n) const { … }
TranslationServer *TranslationServer::singleton = …;
bool TranslationServer::_load_translations(const String &p_from) { … }
void TranslationServer::setup() { … }
void TranslationServer::set_tool_translation(const Ref<Translation> &p_translation) { … }
Ref<Translation> TranslationServer::get_tool_translation() const { … }
String TranslationServer::get_tool_locale() { … }
StringName TranslationServer::tool_translate(const StringName &p_message, const StringName &p_context) const { … }
StringName TranslationServer::tool_translate_plural(const StringName &p_message, const StringName &p_message_plural, int p_n, const StringName &p_context) const { … }
void TranslationServer::set_property_translation(const Ref<Translation> &p_translation) { … }
StringName TranslationServer::property_translate(const StringName &p_message, const StringName &p_context) const { … }
void TranslationServer::set_doc_translation(const Ref<Translation> &p_translation) { … }
StringName TranslationServer::doc_translate(const StringName &p_message, const StringName &p_context) const { … }
StringName TranslationServer::doc_translate_plural(const StringName &p_message, const StringName &p_message_plural, int p_n, const StringName &p_context) const { … }
void TranslationServer::set_extractable_translation(const Ref<Translation> &p_translation) { … }
StringName TranslationServer::extractable_translate(const StringName &p_message, const StringName &p_context) const { … }
StringName TranslationServer::extractable_translate_plural(const StringName &p_message, const StringName &p_message_plural, int p_n, const StringName &p_context) const { … }
bool TranslationServer::is_pseudolocalization_enabled() const { … }
void TranslationServer::set_pseudolocalization_enabled(bool p_enabled) { … }
void TranslationServer::reload_pseudolocalization() { … }
StringName TranslationServer::pseudolocalize(const StringName &p_message) const { … }
StringName TranslationServer::tool_pseudolocalize(const StringName &p_message) const { … }
String TranslationServer::get_override_string(String &p_message) const { … }
String TranslationServer::double_vowels(String &p_message) const {
String res;
for (int i = 0; i < p_message.length(); i++) {
if (pseudolocalization_skip_placeholders_enabled && is_placeholder(p_message, i)) {
res += p_message[i];
res += p_message[i + 1];
i++;
continue;
}
res += p_message[i];
if (p_message[i] == 'a' || p_message[i] == 'e' || p_message[i] == 'i' || p_message[i] == 'o' || p_message[i] == 'u' ||
p_message[i] == 'A' || p_message[i] == 'E' || p_message[i] == 'I' || p_message[i] == 'O' || p_message[i] == 'U') {
res += p_message[i];
}
}
return res;
};
String TranslationServer::replace_with_accented_string(String &p_message) const { … }
String TranslationServer::wrap_with_fakebidi_characters(String &p_message) const { … }
String TranslationServer::add_padding(const String &p_message, int p_length) const { … }
const char32_t *TranslationServer::get_accented_version(char32_t p_character) const { … }
bool TranslationServer::is_placeholder(String &p_message, int p_index) const { … }
#ifdef TOOLS_ENABLED
void TranslationServer::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const { … }
#endif
void TranslationServer::_bind_methods() { … }
void TranslationServer::load_translations() { … }
TranslationServer::TranslationServer() { … }