Add optional context for client translations

This commit is contained in:
Patrick Nicolas
2025-03-19 18:39:01 +01:00
parent 7b513b7ce4
commit 0c0a202d26
6 changed files with 9 additions and 4 deletions
+2 -2
View File
@@ -585,9 +585,9 @@ void scenes::lobby::gui_settings()
if (not refresh_rates.empty())
{
float active_rate = config.preferred_refresh_rate.value_or(refresh_rates.back());
if (ImGui::BeginCombo(_S("Refresh rate"), active_rate ? fmt::format("{}", active_rate).c_str() : _S("Automatic")))
if (ImGui::BeginCombo(_S("Refresh rate"), active_rate ? fmt::format("{}", active_rate).c_str() : _cS("automatic refresh rate", "Automatic")))
{
if (ImGui::Selectable(_S("Automatic"), config.preferred_refresh_rate == 0, ImGuiSelectableFlags_SelectOnRelease))
if (ImGui::Selectable(_cS("automatic refresh rate", "Automatic"), config.preferred_refresh_rate == 0, ImGuiSelectableFlags_SelectOnRelease))
{
session.set_refresh_rate(0);
config.preferred_refresh_rate = 0;
+1
View File
@@ -22,3 +22,4 @@
#define _(x) boost::locale::gettext(x)
#define _F(x) fmt::runtime(boost::locale::gettext(x))
#define _S(x) boost::locale::gettext(x).c_str()
#define _cS(c, x) boost::locale::pgettext(c, x).c_str()
+2 -1
View File
@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WiVRn 0.15\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-19 16:08+0100\n"
"POT-Creation-Date: 2025-03-19 16:28+0100\n"
"PO-Revision-Date: 2024-05-20 13:00+0200\n"
"Last-Translator: Guillaume Meunier <guillaume.meunier@centraliens.net>\n"
"Language: French\n"
@@ -133,6 +133,7 @@ msgid "Refresh rate"
msgstr "Taux de rafraichissement"
#: client/scenes/lobby_gui.cpp:588 client/scenes/lobby_gui.cpp:590
msgctxt "automatic refresh rate"
msgid "Automatic"
msgstr "Automatique"
+2 -1
View File
@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WiVRn 0.15\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-19 16:08+0100\n"
"POT-Creation-Date: 2025-03-19 16:28+0100\n"
"PO-Revision-Date: 2024-10-15 20:16+0100\n"
"Last-Translator: Albano Battistella <albanobattistella@gmail.com>\n"
"Language: Italian\n"
@@ -132,6 +132,7 @@ msgid "Refresh rate"
msgstr "Frequenza di aggiornamento"
#: client/scenes/lobby_gui.cpp:588 client/scenes/lobby_gui.cpp:590
msgctxt "automatic refresh rate"
msgid "Automatic"
msgstr "Automatica"
+1
View File
@@ -9,6 +9,7 @@ xgettext \
--c++ --from-code=UTF-8 \
--keyword=_:1,1t \
--keyword=_S:1,1t \
--keyword=_cS:1c,2,2t \
--keyword=_F:1,1t \
--output=$WIVRN_CLIENT_POT \
--package-name=WiVRn \
+1
View File
@@ -9,6 +9,7 @@ xgettext \
--c++ --from-code=UTF-8 \
--keyword=_:1,1t \
--keyword=_S:1,1t \
--keyword=_cS:1c,2,2t \
--keyword=_F:1,1t \
--output=$WIVRN_CLIENT_POT \
--package-name=WiVRn \