Gtk: Fix xgettext missing a few strings.

This commit is contained in:
BearOso 2023-03-21 17:32:08 -05:00
parent e34097ecdf
commit 8593d9014b
3 changed files with 38 additions and 10 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-03-21 15:34-0500\n" "POT-Creation-Date: 2023-03-21 17:30-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,6 +17,34 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: src/gtk_binding.cpp:248
msgid "Unknown"
msgstr ""
#: src/gtk_binding.cpp:257
msgid "Keyboard {}{}{}{}"
msgstr ""
#: src/gtk_binding.cpp:267
msgid "Axis {} {} {}%"
msgstr ""
#: src/gtk_binding.cpp:272
msgid "Button {}"
msgstr ""
#: src/gtk_binding.cpp:274
msgid "Joystick {} {}"
msgstr ""
#: src/gtk_binding.cpp:278
msgid "Unset"
msgstr ""
#: src/gtk_preferences.cpp:21
msgid "Same location as current game"
msgstr ""
#: src/snes9x.ui:9 #: src/snes9x.ui:9
msgid "About Snes9x" msgid "About Snes9x"
msgstr "" msgstr ""

View File

@ -236,8 +236,8 @@ std::string Binding::to_string(bool translate)
{ {
std::string str; std::string str;
#undef _ #undef maybegettext
#define _(String) translate ? gettext(String) : (String) #define maybegettext(String) translate ? gettext(String) : (String)
if (is_key()) if (is_key())
{ {
@ -245,7 +245,7 @@ std::string Binding::to_string(bool translate)
char *keyval_name = gdk_keyval_name(keyval); char *keyval_name = gdk_keyval_name(keyval);
if (keyval_name == nullptr) if (keyval_name == nullptr)
str = _("Unknown"); str = maybegettext("Unknown");
else else
str = keyval_name; str = keyval_name;
@ -254,7 +254,7 @@ std::string Binding::to_string(bool translate)
if (c == '_') if (c == '_')
c = ' '; c = ' ';
str = fmt::format(_("Keyboard {}{}{}{}"), str = fmt::format(maybegettext("Keyboard {}{}{}{}"),
(value & BINDING_SHIFT) ? "Shift+" : "", (value & BINDING_SHIFT) ? "Shift+" : "",
(value & BINDING_CTRL) ? "Ctrl+" : "", (value & BINDING_CTRL) ? "Ctrl+" : "",
(value & BINDING_ALT) ? "Alt+" : "", (value & BINDING_ALT) ? "Alt+" : "",
@ -264,18 +264,18 @@ std::string Binding::to_string(bool translate)
else if (is_joy()) else if (is_joy())
{ {
if ((get_key()) >= 512) if ((get_key()) >= 512)
str = fmt::format(_("Axis {} {} {}%"), str = fmt::format(maybegettext("Axis {} {} {}%"),
get_axis(), get_axis(),
is_positive() ? "+" : "-", is_positive() ? "+" : "-",
get_threshold()); get_threshold());
else else
str = fmt::format(_("Button {}"), get_key()); str = fmt::format(maybegettext("Button {}"), get_key());
str = fmt::format(_("Joystick {} {}"), get_device(), str); str = fmt::format(maybegettext("Joystick {} {}"), get_device(), str);
} }
else else
str = _("Unset"); str = maybegettext("Unset");
return str; return str;
} }

View File

@ -18,7 +18,7 @@
#include "gfx.h" #include "gfx.h"
#include "display.h" #include "display.h"
#define SAME_AS_GAME _("Same location as current game") #define SAME_AS_GAME gettext("Same location as current game")
static Snes9xPreferences *preferences = nullptr; static Snes9xPreferences *preferences = nullptr;