Improve some editor strings for localization

This commit is contained in:
Haoyu Qiu 2023-02-09 17:01:32 +08:00
parent d69809cab6
commit a40ccc2d7e
8 changed files with 21 additions and 20 deletions

View File

@ -446,7 +446,8 @@ EditorLocaleDialog::EditorLocaleDialog() {
vb_script_list->set_h_size_flags(Control::SIZE_EXPAND_FILL); vb_script_list->set_h_size_flags(Control::SIZE_EXPAND_FILL);
{ {
Label *script_lbl = memnew(Label); 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); vb_script_list->add_child(script_lbl);
} }
{ {
@ -504,7 +505,8 @@ EditorLocaleDialog::EditorLocaleDialog() {
vb_script->set_h_size_flags(Control::SIZE_EXPAND_FILL); vb_script->set_h_size_flags(Control::SIZE_EXPAND_FILL);
{ {
Label *script_lbl = memnew(Label); 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); vb_script->add_child(script_lbl);
} }
{ {

View File

@ -528,7 +528,7 @@ void DynamicFontImportSettings::_variation_selected() {
inspector_vars->edit(import_variation_data.ptr()); inspector_vars->edit(import_variation_data.ptr());
import_variation_data->notify_property_list_changed(); 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(); _range_selected();
_change_text_opts(); _change_text_opts();
@ -659,7 +659,7 @@ void DynamicFontImportSettings::_glyph_update_lbl() {
} }
} }
int unlinked_glyphs = import_variation_data->selected_glyphs.size() - linked_glyphs; 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() { void DynamicFontImportSettings::_glyph_clear() {
@ -1403,7 +1403,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() {
label_glyphs = memnew(Label); label_glyphs = memnew(Label);
gl_hb->add_child(label_glyphs); 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)); label_glyphs->set_custom_minimum_size(Size2(50 * EDSCALE, 0));
Button *btn_clear = memnew(Button); Button *btn_clear = memnew(Button);

View File

@ -97,14 +97,10 @@ DebuggerEditorPlugin::DebuggerEditorPlugin(PopupMenu *p_debug_menu) {
debug_menu->add_separator(); debug_menu->add_separator();
debug_menu->add_submenu_item(TTR("Run Multiple Instances"), "run_instances"); debug_menu->add_submenu_item(TTR("Run Multiple Instances"), "run_instances");
instances_menu->add_radio_check_item(TTR("Run 1 Instance")); for (int i = 1; i <= 4; i++) {
instances_menu->set_item_metadata(0, 1); instances_menu->add_radio_check_item(vformat(TTRN("Run %d Instance", "Run %d Instances", i), i));
instances_menu->add_radio_check_item(TTR("Run 2 Instances")); instances_menu->set_item_metadata(i - 1, i);
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);
instances_menu->set_item_checked(0, true); instances_menu->set_item_checked(0, true);
instances_menu->connect("index_pressed", callable_mp(this, &DebuggerEditorPlugin::_select_run_count)); instances_menu->connect("index_pressed", callable_mp(this, &DebuggerEditorPlugin::_select_run_count));
debug_menu->connect("id_pressed", callable_mp(this, &DebuggerEditorPlugin::_menu_option)); debug_menu->connect("id_pressed", callable_mp(this, &DebuggerEditorPlugin::_menu_option));

View File

@ -310,7 +310,8 @@ void EditorPropertyFontMetaOverride::update_property() {
} }
if (script_editor) { 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 { } else {
button_add = EditorInspector::create_inspector_action_button(TTR("Add Locale")); button_add = EditorInspector::create_inspector_action_button(TTR("Add Locale"));
} }

View File

@ -253,7 +253,8 @@ EditorNetworkProfiler::EditorNetworkProfiler() {
hb->add_spacer(); hb->add_spacer();
Label *lb = memnew(Label); 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); hb->add_child(lb);
incoming_bandwidth_text = memnew(LineEdit); incoming_bandwidth_text = memnew(LineEdit);
@ -267,7 +268,8 @@ EditorNetworkProfiler::EditorNetworkProfiler() {
hb->add_child(down_up_spacer); hb->add_child(down_up_spacer);
lb = memnew(Label); 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); hb->add_child(lb);
outgoing_bandwidth_text = memnew(LineEdit); outgoing_bandwidth_text = memnew(LineEdit);

View File

@ -124,7 +124,7 @@ PackedStringArray CollisionShape3D::get_configuration_warnings() const {
PackedStringArray warnings = Node::get_configuration_warnings(); PackedStringArray warnings = Node::get_configuration_warnings();
if (!Object::cast_to<CollisionObject3D>(get_parent())) { 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()) { if (!shape.is_valid()) {

View File

@ -6553,7 +6553,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
OperatorNode *op = alloc_node<OperatorNode>(); OperatorNode *op = alloc_node<OperatorNode>();
op->op = expression[i].op; op->op = expression[i].op;
if ((op->op == OP_INCREMENT || op->op == OP_DECREMENT) && !_validate_assign(expression[i + 1].node, p_function_info)) { 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; return nullptr;
} }
op->arguments.push_back(expression[i + 1].node); 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")); _set_error(vformat(RTR("The '%s' data type is not supported for uniforms."), "struct"));
return ERR_PARSE_ERROR; return ERR_PARSE_ERROR;
} else { } 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; return ERR_PARSE_ERROR;
} }
} }

View File

@ -182,7 +182,7 @@ private:
} }
void _set_unexpected_token_error(const String &p_what, int p_line) { 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); void process_directive(Tokenizer *p_tokenizer);