godot/core/string/translation_server.cpp

/**************************************************************************/
/*  translation_server.cpp                                                */
/**************************************************************************/
/*                         This file is part of:                          */
/*                             GODOT ENGINE                               */
/*                        https://godotengine.org                         */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */
/*                                                                        */
/* Permission is hereby granted, free of charge, to any person obtaining  */
/* a copy of this software and associated documentation files (the        */
/* "Software"), to deal in the Software without restriction, including    */
/* without limitation the rights to use, copy, modify, merge, publish,    */
/* distribute, sublicense, and/or sell copies of the Software, and to     */
/* permit persons to whom the Software is furnished to do so, subject to  */
/* the following conditions:                                              */
/*                                                                        */
/* The above copyright notice and this permission notice shall be         */
/* included in all copies or substantial portions of the Software.        */
/*                                                                        */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */
/**************************************************************************/

#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 // TOOLS_ENABLED

void TranslationServer::_bind_methods() {}

void TranslationServer::load_translations() {}

TranslationServer::TranslationServer() {}