]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Perform some quality assurance for translation strings (#11375)
authorWuzzy <wuzzy2@mail.ru>
Wed, 23 Jun 2021 16:35:50 +0000 (16:35 +0000)
committerGitHub <noreply@github.com>
Wed, 23 Jun 2021 16:35:50 +0000 (17:35 +0100)
src/client/clientlauncher.cpp
src/gui/guiVolumeChange.cpp

index 13e7aefcf5d2b14caffce03256d9bbac55d66fe7..6ab6106702fcb116fb6a464c96be20c8527e1d50 100644 (file)
@@ -512,8 +512,8 @@ bool ClientLauncher::launch_game(std::string &error_message,
                // Load gamespec for required game
                start_data.game_spec = findWorldSubgame(worldspec.path);
                if (!start_data.game_spec.isValid()) {
-                       error_message = gettext("Could not find or load game \"")
-                                       + worldspec.gameid + "\"";
+                       error_message = gettext("Could not find or load game")
+                                       + worldspec.gameid;
                        errorstream << error_message << std::endl;
                        return false;
                }
index f17cfa9867e0952c7d4918a8d2a99f536956862b..61ab758a11425c5d0e35b6afcf0bc87e7056d32b 100644 (file)
@@ -93,11 +93,12 @@ void GUIVolumeChange::regenerateGui(v2u32 screensize)
                core::rect<s32> rect(0, 0, 160 * s, 20 * s);
                rect = rect + v2s32(size.X / 2 - 80 * s, size.Y / 2 - 70 * s);
 
-               const wchar_t *text = wgettext("Sound Volume: ");
+               wchar_t text[100];
+               const wchar_t *str = wgettext("Sound Volume: %d%%");
+               swprintf(text, sizeof(text) / sizeof(wchar_t), str, volume);
+               delete[] str;
                core::stringw volume_text = text;
-               delete [] text;
 
-               volume_text += core::stringw(volume) + core::stringw("%");
                Environment->addStaticText(volume_text.c_str(), rect, false,
                                true, this, ID_soundText);
        }
@@ -183,11 +184,13 @@ bool GUIVolumeChange::OnEvent(const SEvent& event)
                                g_settings->setFloat("sound_volume", (float) pos / 100);
 
                                gui::IGUIElement *e = getElementFromId(ID_soundText);
-                               const wchar_t *text = wgettext("Sound Volume: ");
+                               wchar_t text[100];
+                               const wchar_t *str = wgettext("Sound Volume: %d%%");
+                               swprintf(text, sizeof(text) / sizeof(wchar_t), str, pos);
+                               delete[] str;
+
                                core::stringw volume_text = text;
-                               delete [] text;
 
-                               volume_text += core::stringw(pos) + core::stringw("%");
                                e->setText(volume_text.c_str());
                                return true;
                        }