feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -135,10 +135,10 @@ TranslationServer::Locale::operator String() const {
TranslationServer::Locale::Locale(const TranslationServer &p_server, const String &p_locale, bool p_add_defaults) {
// Replaces '-' with '_' for macOS style locales.
String univ_locale = p_locale.replace("-", "_");
String univ_locale = p_locale.replace_char('-', '_');
// Extract locale elements.
Vector<String> locale_elements = univ_locale.get_slice("@", 0).split("_");
Vector<String> locale_elements = univ_locale.get_slicec('@', 0).split("_");
language = locale_elements[0];
if (locale_elements.size() >= 2) {
if (locale_elements[1].length() == 4 && is_ascii_upper_case(locale_elements[1][0]) && is_ascii_lower_case(locale_elements[1][1]) && is_ascii_lower_case(locale_elements[1][2]) && is_ascii_lower_case(locale_elements[1][3])) {
@ -162,7 +162,7 @@ TranslationServer::Locale::Locale(const TranslationServer &p_server, const Strin
}
// Try extract script and variant from the extra part.
Vector<String> script_extra = univ_locale.get_slice("@", 1).split(";");
Vector<String> script_extra = univ_locale.get_slicec('@', 1).split(";");
for (int i = 0; i < script_extra.size(); i++) {
if (script_extra[i].to_lower() == "cyrillic") {
script = "Cyrl";
@ -504,10 +504,10 @@ String TranslationServer::get_tool_locale() {
#ifdef TOOLS_ENABLED
if (Engine::get_singleton()->is_editor_hint() || Engine::get_singleton()->is_project_manager_hint()) {
const PackedStringArray &locales = editor_domain->get_loaded_locales();
if (locales.is_empty()) {
return "en";
if (locales.has(locale)) {
return locale;
}
return locales[0];
return "en";
} else {
#else
{