Skip to content

Commit

Permalink
Merge pull request #89799 from timothyqiu/line-numbers
Browse files Browse the repository at this point in the history
Translate "Line N" as a whole
  • Loading branch information
akien-mga committed Mar 24, 2024
2 parents f79896f + 9dadeac commit 1999b66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions editor/plugins/script_text_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,7 @@ void ScriptTextEditor::_update_warnings() {
warnings_panel->push_cell();
warnings_panel->push_meta(w.start_line - 1);
warnings_panel->push_color(warnings_panel->get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
warnings_panel->add_text(TTR("Line") + " " + itos(w.start_line));
warnings_panel->add_text(" (" + w.string_code + "):");
warnings_panel->add_text(vformat(TTR("Line %d (%s):"), w.start_line, w.string_code));
warnings_panel->pop(); // Color.
warnings_panel->pop(); // Meta goto.
warnings_panel->pop(); // Cell.
Expand All @@ -625,7 +624,7 @@ void ScriptTextEditor::_update_errors() {
errors_panel->push_cell();
errors_panel->push_meta(err.line - 1);
errors_panel->push_color(warnings_panel->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
errors_panel->add_text(TTR("Line") + " " + itos(err.line) + ":");
errors_panel->add_text(vformat(TTR("Line %d:"), err.line));
errors_panel->pop(); // Color.
errors_panel->pop(); // Meta goto.
errors_panel->pop(); // Cell.
Expand Down Expand Up @@ -659,7 +658,7 @@ void ScriptTextEditor::_update_errors() {
errors_panel->push_cell();
errors_panel->push_meta(click_meta);
errors_panel->push_color(errors_panel->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
errors_panel->add_text(TTR("Line") + " " + itos(err.line) + ":");
errors_panel->add_text(vformat(TTR("Line %d:"), err.line));
errors_panel->pop(); // Color.
errors_panel->pop(); // Meta goto.
errors_panel->pop(); // Cell.
Expand Down
3 changes: 1 addition & 2 deletions editor/plugins/text_shader_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,7 @@ void ShaderTextEditor::_update_warning_panel() {
warnings_panel->push_color(warnings_panel->get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
if (line != -1) {
warnings_panel->push_meta(line - 1);
warnings_panel->add_text(TTR("Line") + " " + itos(line));
warnings_panel->add_text(" (" + w.get_name() + "):");
warnings_panel->add_text(vformat(TTR("Line %d (%s):"), line, w.get_name()));
warnings_panel->pop(); // Meta goto.
} else {
warnings_panel->add_text(w.get_name() + ":");
Expand Down

0 comments on commit 1999b66

Please sign in to comment.