Skip to content

Commit 710aa9a

Browse files
committed
Merge branch 'internationalonoff' into 'master'
Fix localized checkbox toggling behavior See merge request OpenMW/openmw!4501
2 parents 52d1493 + 4eb5b24 commit 710aa9a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

apps/openmw/mwgui/settingswindow.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <SDL_video.h>
1919

2020
#include <components/debug/debuglog.hpp>
21+
#include <components/l10n/manager.hpp>
2122
#include <components/lua_ui/scriptsettings.hpp>
2223
#include <components/misc/constants.hpp>
2324
#include <components/misc/display.hpp>
@@ -669,12 +670,12 @@ namespace MWGui
669670

670671
void SettingsWindow::onButtonToggled(MyGUI::Widget* _sender)
671672
{
672-
std::string_view on = MWBase::Environment::get().getWindowManager()->getGameSettingString("sOn", "On");
673+
const std::string on = MWBase::Environment::get().getL10nManager()->getMessage("Interface", "On");
674+
const std::string off = MWBase::Environment::get().getL10nManager()->getMessage("Interface", "Off");
673675
bool newState;
674676
if (_sender->castType<MyGUI::Button>()->getCaption() == on)
675677
{
676-
_sender->castType<MyGUI::Button>()->setCaption(
677-
MyGUI::UString(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOff", "Off")));
678+
_sender->castType<MyGUI::Button>()->setCaption(MyGUI::UString(off));
678679
newState = false;
679680
}
680681
else

0 commit comments

Comments
 (0)