summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Lambers <marlam@marlam.de>2012-06-17 16:03:02 +0200
committerMartin Lambers <marlam@marlam.de>2012-06-17 16:03:02 +0200
commit9b1b5deeecd9c4573b53893051d3746803635ad2 (patch)
tree088050b6c5e1ad280cca415ec6efce6409a055a3
parent006e56f43dfbb72d80f8ad1457d2bba750228343 (diff)
downloadbino-9b1b5deeecd9c4573b53893051d3746803635ad2.tar.gz
Add keyboard key names to translatable strings.
Suggested by Alexey Osipov.
-rw-r--r--src/gui.cpp12
-rw-r--r--src/main.cpp23
2 files changed, 22 insertions, 13 deletions
diff --git a/src/gui.cpp b/src/gui.cpp
index 9e22e5d..bbad0e5 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -3660,8 +3660,8 @@ void main_window::help_keyboard()
// the --help output in main.cpp, to reduce the burden for translators.
QString("<p>") + _("Keyboard control:") + "<br>"
"<table>"
- "<tr><td>q, ESC</td><td>" + _("Stop") + "</td></tr>"
- "<tr><td>p / SPACE</td><td>" + _("Pause / unpause") + "</td></tr>"
+ "<tr><td>q, " + _("ESC") + "</td><td>" + _("Stop") + "</td></tr>"
+ "<tr><td>p / " + _("SPACE") + "</td><td>" + _("Pause / unpause") + "</td></tr>"
"<tr><td>f</td><td>" + _("Toggle fullscreen") + "</td></tr>"
"<tr><td>c</td><td>" + _("Center window") + "</td></tr>"
"<tr><td>e / F7</td><td>" + _("Swap left/right eye") + "</td></tr>"
@@ -3678,10 +3678,10 @@ void main_window::help_keyboard()
"<tr><td>/, *</td><td>" + _("Adjust audio volume") + "</td></tr>"
"<tr><td>m</td><td>" + _("Toggle audio mute") + "</td></tr>"
"<tr><td>.</td><td>" + _("Step a single video frame forward") + "</td></tr>"
- "<tr><td>left, right</td><td>" + _("Seek 10 seconds backward / forward") + "</td></tr>"
- "<tr><td>down, up</td><td>" + _("Seek 1 minute backward / forward") + "</td></tr>"
- "<tr><td>page down, page up</td><td>" + _("Seek 10 minutes backward / forward") + "</td></tr>"
- "<tr><td>Media keys</td><td>" + _("Media keys should work as expected") + "</td></tr>"
+ "<tr><td>" + _("left, right") + "</td><td>" + _("Seek 10 seconds backward / forward") + "</td></tr>"
+ "<tr><td>" + _("down, up") + "</td><td>" + _("Seek 1 minute backward / forward") + "</td></tr>"
+ "<tr><td>" + _("page down, page up") + "</td><td>" + _("Seek 10 minutes backward / forward") + "</td></tr>"
+ "<tr><td>" + _("Media keys") + "</td><td>" + _("Media keys should work as expected") + "</td></tr>"
"</table>"
"</p>", QMessageBox::Ok, this);
msgbox->setModal(false);
diff --git a/src/main.cpp b/src/main.cpp
index 1fc9b74..5399e96 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -166,6 +166,15 @@ static void close_log_file(void)
}
}
+static std::string lengthen(const std::string& s, int len)
+{
+ int spaces = len - static_cast<int>(s.length());
+ if (spaces > 0)
+ return s + std::string(spaces, ' ');
+ else
+ return s;
+}
+
int main(int argc, char *argv[])
{
@@ -492,9 +501,9 @@ int main(int argc, char *argv[])
+ " --sdi-output-format=F " + _("Set SDI output format") + '\n'
+ '\n'
+ _("Interactive control:") + '\n'
- + " ESC " + _("Leave fullscreen mode, or quit") + '\n'
+ + " " + lengthen(_("ESC"), 25) + _("Leave fullscreen mode, or quit") + '\n'
+ " q " + _("Quit") + '\n'
- + " p / SPACE " + _("Pause / unpause") + '\n'
+ + " p / " + lengthen(_("SPACE"), 21) + _("Pause / unpause") + '\n'
+ " f " + _("Toggle fullscreen") + '\n'
+ " c " + _("Center window") + '\n'
+ " e / F7 " + _("Swap left/right eye") + '\n'
@@ -511,11 +520,11 @@ int main(int argc, char *argv[])
+ " /, * " + _("Adjust audio volume") + '\n'
+ " m " + _("Toggle audio mute") + '\n'
+ " . " + _("Step a single video frame forward") + '\n'
- + " left, right " + _("Seek 10 seconds backward / forward") + '\n'
- + " down, up " + _("Seek 1 minute backward / forward") + '\n'
- + " page down, page up " + _("Seek 10 minutes backward / forward") + '\n'
- + " Mouse click " + _("Seek according to horizontal click position") + '\n'
- + " Media keys " + _("Media keys should work as expected"));
+ + " " + lengthen(_("left, right"), 25) + _("Seek 10 seconds backward / forward") + '\n'
+ + " " + lengthen(_("down, up"), 25) + _("Seek 1 minute backward / forward") + '\n'
+ + " " + lengthen(_("page down, page up"), 25) + _("Seek 10 minutes backward / forward") + '\n'
+ + " " + lengthen(_("Mouse click"), 25) + _("Seek according to horizontal click position") + '\n'
+ + " " + lengthen(_("Media keys"), 25) + _("Media keys should work as expected"));
}
if (list_audio_devices.value())
{