diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2023-02-09 17:01:32 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2023-02-09 19:32:02 +0800 |
commit | a40ccc2d7e48f5cf5bfe36504c2969cbdfa4aa6b (patch) | |
tree | 52ceba6d9c1e54c2229e5d52ecbc65a43196027d | |
parent | d69809cab603cae9f525768337affe5e12e454a8 (diff) |
Improve some editor strings for localization
-rw-r--r-- | editor/editor_locale_dialog.cpp | 6 | ||||
-rw-r--r-- | editor/import/dynamic_font_import_settings.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/debugger_editor_plugin.cpp | 12 | ||||
-rw-r--r-- | editor/plugins/font_config_plugin.cpp | 3 | ||||
-rw-r--r-- | modules/multiplayer/editor/editor_network_profiler.cpp | 6 | ||||
-rw-r--r-- | scene/3d/collision_shape_3d.cpp | 2 | ||||
-rw-r--r-- | servers/rendering/shader_language.cpp | 4 | ||||
-rw-r--r-- | servers/rendering/shader_preprocessor.h | 2 |
8 files changed, 21 insertions, 20 deletions
diff --git a/editor/editor_locale_dialog.cpp b/editor/editor_locale_dialog.cpp index 5a372412fa..fbf3c99690 100644 --- a/editor/editor_locale_dialog.cpp +++ b/editor/editor_locale_dialog.cpp @@ -446,7 +446,8 @@ EditorLocaleDialog::EditorLocaleDialog() { vb_script_list->set_h_size_flags(Control::SIZE_EXPAND_FILL); { Label *script_lbl = memnew(Label); - script_lbl->set_text(TTR("Script:")); + // TRANSLATORS: This is the label for a list of writing systems. + script_lbl->set_text(TTR("Script:", "Locale")); vb_script_list->add_child(script_lbl); } { @@ -504,7 +505,8 @@ EditorLocaleDialog::EditorLocaleDialog() { vb_script->set_h_size_flags(Control::SIZE_EXPAND_FILL); { Label *script_lbl = memnew(Label); - script_lbl->set_text(TTR("Script")); + // TRANSLATORS: This refers to a writing system. + script_lbl->set_text(TTR("Script", "Locale")); vb_script->add_child(script_lbl); } { diff --git a/editor/import/dynamic_font_import_settings.cpp b/editor/import/dynamic_font_import_settings.cpp index cfbe34b868..6e74c42b2c 100644 --- a/editor/import/dynamic_font_import_settings.cpp +++ b/editor/import/dynamic_font_import_settings.cpp @@ -528,7 +528,7 @@ void DynamicFontImportSettings::_variation_selected() { inspector_vars->edit(import_variation_data.ptr()); import_variation_data->notify_property_list_changed(); - label_glyphs->set_text(TTR("Preloaded glyphs: ") + itos(import_variation_data->selected_glyphs.size())); + label_glyphs->set_text(vformat(TTR("Preloaded glyphs: %d"), import_variation_data->selected_glyphs.size())); _range_selected(); _change_text_opts(); @@ -659,7 +659,7 @@ void DynamicFontImportSettings::_glyph_update_lbl() { } } int unlinked_glyphs = import_variation_data->selected_glyphs.size() - linked_glyphs; - label_glyphs->set_text(TTR("Preloaded glyphs:") + " " + itos(unlinked_glyphs + import_variation_data->selected_chars.size())); + label_glyphs->set_text(vformat(TTR("Preloaded glyphs: %d"), unlinked_glyphs + import_variation_data->selected_chars.size())); } void DynamicFontImportSettings::_glyph_clear() { @@ -1403,7 +1403,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { label_glyphs = memnew(Label); gl_hb->add_child(label_glyphs); - label_glyphs->set_text(TTR("Preloaded glyphs:") + " " + itos(0)); + label_glyphs->set_text(vformat(TTR("Preloaded glyphs: %d"), 0)); label_glyphs->set_custom_minimum_size(Size2(50 * EDSCALE, 0)); Button *btn_clear = memnew(Button); diff --git a/editor/plugins/debugger_editor_plugin.cpp b/editor/plugins/debugger_editor_plugin.cpp index 28151800b6..224d221d9a 100644 --- a/editor/plugins/debugger_editor_plugin.cpp +++ b/editor/plugins/debugger_editor_plugin.cpp @@ -97,14 +97,10 @@ DebuggerEditorPlugin::DebuggerEditorPlugin(PopupMenu *p_debug_menu) { debug_menu->add_separator(); debug_menu->add_submenu_item(TTR("Run Multiple Instances"), "run_instances"); - instances_menu->add_radio_check_item(TTR("Run 1 Instance")); - instances_menu->set_item_metadata(0, 1); - instances_menu->add_radio_check_item(TTR("Run 2 Instances")); - instances_menu->set_item_metadata(1, 2); - instances_menu->add_radio_check_item(TTR("Run 3 Instances")); - instances_menu->set_item_metadata(2, 3); - instances_menu->add_radio_check_item(TTR("Run 4 Instances")); - instances_menu->set_item_metadata(3, 4); + for (int i = 1; i <= 4; i++) { + instances_menu->add_radio_check_item(vformat(TTRN("Run %d Instance", "Run %d Instances", i), i)); + instances_menu->set_item_metadata(i - 1, i); + } instances_menu->set_item_checked(0, true); instances_menu->connect("index_pressed", callable_mp(this, &DebuggerEditorPlugin::_select_run_count)); debug_menu->connect("id_pressed", callable_mp(this, &DebuggerEditorPlugin::_menu_option)); diff --git a/editor/plugins/font_config_plugin.cpp b/editor/plugins/font_config_plugin.cpp index d5f3b897c9..7618ec3903 100644 --- a/editor/plugins/font_config_plugin.cpp +++ b/editor/plugins/font_config_plugin.cpp @@ -310,7 +310,8 @@ void EditorPropertyFontMetaOverride::update_property() { } if (script_editor) { - button_add = EditorInspector::create_inspector_action_button(TTR("Add Script")); + // TRANSLATORS: Script refers to a writing system. + button_add = EditorInspector::create_inspector_action_button(TTR("Add Script", "Locale")); } else { button_add = EditorInspector::create_inspector_action_button(TTR("Add Locale")); } diff --git a/modules/multiplayer/editor/editor_network_profiler.cpp b/modules/multiplayer/editor/editor_network_profiler.cpp index e320657ab5..f8e75d5ef5 100644 --- a/modules/multiplayer/editor/editor_network_profiler.cpp +++ b/modules/multiplayer/editor/editor_network_profiler.cpp @@ -253,7 +253,8 @@ EditorNetworkProfiler::EditorNetworkProfiler() { hb->add_spacer(); Label *lb = memnew(Label); - lb->set_text(TTR("Down")); + // TRANSLATORS: This is the label for the network profiler's incoming bandwidth. + lb->set_text(TTR("Down", "Network")); hb->add_child(lb); incoming_bandwidth_text = memnew(LineEdit); @@ -267,7 +268,8 @@ EditorNetworkProfiler::EditorNetworkProfiler() { hb->add_child(down_up_spacer); lb = memnew(Label); - lb->set_text(TTR("Up")); + // TRANSLATORS: This is the label for the network profiler's outgoing bandwidth. + lb->set_text(TTR("Up", "Network")); hb->add_child(lb); outgoing_bandwidth_text = memnew(LineEdit); diff --git a/scene/3d/collision_shape_3d.cpp b/scene/3d/collision_shape_3d.cpp index dbd50cfd19..f1d918ad9b 100644 --- a/scene/3d/collision_shape_3d.cpp +++ b/scene/3d/collision_shape_3d.cpp @@ -124,7 +124,7 @@ PackedStringArray CollisionShape3D::get_configuration_warnings() const { PackedStringArray warnings = Node::get_configuration_warnings(); if (!Object::cast_to<CollisionObject3D>(get_parent())) { - warnings.push_back(RTR("CollisionShape3D only serves to provide a collision shape to a CollisionObject3D derived node. Please only use it as a child of Area3D, StaticBody3D, RigidBody3D, CharacterBody3D, etc. to give them a shape.")); + warnings.push_back(RTR("CollisionShape3D only serves to provide a collision shape to a CollisionObject3D derived node.\nPlease only use it as a child of Area3D, StaticBody3D, RigidBody3D, CharacterBody3D, etc. to give them a shape.")); } if (!shape.is_valid()) { diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index e9c13f88ca..a727e83513 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -6553,7 +6553,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons OperatorNode *op = alloc_node<OperatorNode>(); op->op = expression[i].op; if ((op->op == OP_INCREMENT || op->op == OP_DECREMENT) && !_validate_assign(expression[i + 1].node, p_function_info)) { - _set_error(RTR("Can't use increment/decrement operator in a constant expression.")); + _set_error(RTR("Invalid use of increment/decrement operator in a constant expression.")); return nullptr; } op->arguments.push_back(expression[i + 1].node); @@ -8421,7 +8421,7 @@ Error ShaderLanguage::_parse_shader(const HashMap<StringName, FunctionInfo> &p_f _set_error(vformat(RTR("The '%s' data type is not supported for uniforms."), "struct")); return ERR_PARSE_ERROR; } else { - _set_error(vformat(RTR("The '%s' data type not allowed here."), "struct")); + _set_error(vformat(RTR("The '%s' data type is not allowed here."), "struct")); return ERR_PARSE_ERROR; } } diff --git a/servers/rendering/shader_preprocessor.h b/servers/rendering/shader_preprocessor.h index 2b7d2c274e..f198af66f0 100644 --- a/servers/rendering/shader_preprocessor.h +++ b/servers/rendering/shader_preprocessor.h @@ -182,7 +182,7 @@ private: } void _set_unexpected_token_error(const String &p_what, int p_line) { - set_error(vformat(RTR("Unexpected token '%s'."), p_what), p_line); + set_error(vformat(RTR("Unexpected token: '%s'."), p_what), p_line); } void process_directive(Tokenizer *p_tokenizer); |