Skip to content

Commit

Permalink
Merge pull request #93554 from akien-mga/remove-editor-pseudolocaliza…
Browse files Browse the repository at this point in the history
…tion

Remove editor pseudolocalization debug feature
  • Loading branch information
akien-mga committed Jun 24, 2024
2 parents 2ac72b7 + f11e8d0 commit 25ff130
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
8 changes: 2 additions & 6 deletions core/string/translation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,10 +752,10 @@ StringName TranslationServer::tool_translate(const StringName &p_message, const
if (tool_translation.is_valid()) {
StringName r = tool_translation->get_message(p_message, p_context);
if (r) {
return editor_pseudolocalization ? tool_pseudolocalize(r) : r;
return r;
}
}
return editor_pseudolocalization ? tool_pseudolocalize(p_message) : p_message;
return p_message;
}

StringName TranslationServer::tool_translate_plural(const StringName &p_message, const StringName &p_message_plural, int p_n, const StringName &p_context) const {
Expand Down Expand Up @@ -856,10 +856,6 @@ void TranslationServer::set_pseudolocalization_enabled(bool p_enabled) {
}
}

void TranslationServer::set_editor_pseudolocalization(bool p_enabled) {
editor_pseudolocalization = p_enabled;
}

void TranslationServer::reload_pseudolocalization() {
pseudolocalization_accents_enabled = GLOBAL_GET("internationalization/pseudolocalization/replace_with_accents");
pseudolocalization_double_vowels_enabled = GLOBAL_GET("internationalization/pseudolocalization/double_vowels");
Expand Down
2 changes: 0 additions & 2 deletions core/string/translation.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class TranslationServer : public Object {
bool pseudolocalization_fake_bidi_enabled = false;
bool pseudolocalization_override_enabled = false;
bool pseudolocalization_skip_placeholders_enabled = false;
bool editor_pseudolocalization = false;
float expansion_ratio = 0.0;
String pseudolocalization_prefix;
String pseudolocalization_suffix;
Expand Down Expand Up @@ -170,7 +169,6 @@ class TranslationServer : public Object {

bool is_pseudolocalization_enabled() const;
void set_pseudolocalization_enabled(bool p_enabled);
void set_editor_pseudolocalization(bool p_enabled);
void reload_pseudolocalization();

String standardize_locale(const String &p_locale) const;
Expand Down
4 changes: 0 additions & 4 deletions doc/classes/EditorSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -623,10 +623,6 @@
The custom editor scale factor to use. This can be used for displays with very high DPI where a scale factor of 200% is not sufficient.
[b]Note:[/b] Only effective if [member interface/editor/display_scale] is set to [b]Custom[/b].
</member>
<member name="interface/editor/debug/enable_pseudolocalization" type="bool" setter="" getter="">
If [code]true[/code], lengthens the editor's localizable strings and replaces their characters with accented variants. This allows spotting non-localizable strings easily, while also ensuring the UI layout doesn't break when strings are made longer (as many languages require strings to be longer).
This is a debugging feature and should only be enabled when working on the editor itself.
</member>
<member name="interface/editor/display_scale" type="int" setter="" getter="">
The display scale factor to use for the editor interface. Higher values are more suited to hiDPI/Retina displays.
If set to [b]Auto[/b], the editor scale is automatically determined based on the screen resolution and reported display DPI. This heuristic is not always ideal, which means you can get better results by setting the editor scale manually.
Expand Down
4 changes: 0 additions & 4 deletions editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,6 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "network/connection/engine_version_update_mode", int(default_update_mode), "Disable Update Checks,Check Newest Preview,Check Newest Stable,Check Newest Patch"); // Uses EngineUpdateLabel::UpdateMode.
}

_initial_set("interface/editor/debug/enable_pseudolocalization", false);
set_restart_if_changed("interface/editor/debug/enable_pseudolocalization", true);
// Use pseudolocalization in editor.
EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/use_embedded_menu", false, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/use_native_file_dialogs", false, "", PROPERTY_USAGE_DEFAULT)
EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/expand_to_title", true, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
Expand Down Expand Up @@ -1098,7 +1095,6 @@ void EditorSettings::create() {
}

void EditorSettings::setup_language() {
TranslationServer::get_singleton()->set_editor_pseudolocalization(get("interface/editor/debug/enable_pseudolocalization"));
String lang = get("interface/editor/editor_language");
if (lang == "en") {
return; // Default, nothing to do.
Expand Down

0 comments on commit 25ff130

Please sign in to comment.