From ccbb5e03fbb4e75e24860c8064b60cbe02cb3a48 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Mon, 4 Jul 2022 21:45:44 +0400 Subject: [PATCH] Use YAML files to translate MyGUI's localization tags --- CHANGELOG.md | 1 + apps/openmw/engine.cpp | 1 + apps/openmw/mwbase/luamanager.hpp | 1 + apps/openmw/mwgui/debugwindow.cpp | 2 + apps/openmw/mwgui/postprocessorhud.cpp | 20 +-- apps/openmw/mwgui/savegamedialog.cpp | 4 +- apps/openmw/mwgui/settingswindow.cpp | 53 +++++-- apps/openmw/mwgui/windowmanagerimp.cpp | 18 ++- apps/openmw/mwinput/bindingsmanager.cpp | 10 +- apps/openmw/mwlua/luamanagerimp.cpp | 18 ++- apps/openmw/mwlua/luamanagerimp.hpp | 5 + .../detournavigator/asyncnavmeshupdater.cpp | 2 +- components/lua/l10n.cpp | 6 + components/lua/l10n.hpp | 1 + components/widgets/box.cpp | 19 +++ components/widgets/box.hpp | 9 ++ components/widgets/widgets.cpp | 1 + files/data/CMakeLists.txt | 10 ++ files/data/l10n/DebugMenu/en.yaml | 3 + files/data/l10n/DebugMenu/ru.yaml | 3 + files/data/l10n/Interface/en.yaml | 5 +- files/data/l10n/Interface/ru.yaml | 3 +- files/data/l10n/Navigation/en.yaml | 1 + files/data/l10n/Navigation/ru.yaml | 1 + files/data/l10n/PostProcessing/en.yaml | 20 +++ files/data/l10n/PostProcessing/ru.yaml | 20 +++ files/data/l10n/SavegameMenu/en.yaml | 2 + files/data/l10n/SavegameMenu/ru.yaml | 2 + files/data/l10n/SettingsMenu/en.yaml | 59 ++++++++ files/data/l10n/SettingsMenu/ru.yaml | 59 ++++++++ files/mygui/openmw_chargen_birth.layout | 2 +- files/mygui/openmw_debug_window.layout | 2 +- files/mygui/openmw_postprocessor_hud.layout | 12 +- files/mygui/openmw_postprocessor_hud.skin.xml | 6 +- files/mygui/openmw_savegame_dialog.layout | 2 +- files/mygui/openmw_settings_window.layout | 136 +++++++++--------- files/mygui/openmw_text_input.layout | 2 +- 37 files changed, 396 insertions(+), 125 deletions(-) create mode 100644 files/data/l10n/DebugMenu/en.yaml create mode 100644 files/data/l10n/DebugMenu/ru.yaml create mode 100644 files/data/l10n/Navigation/en.yaml create mode 100644 files/data/l10n/Navigation/ru.yaml create mode 100644 files/data/l10n/PostProcessing/en.yaml create mode 100644 files/data/l10n/PostProcessing/ru.yaml create mode 100644 files/data/l10n/SavegameMenu/en.yaml create mode 100644 files/data/l10n/SavegameMenu/ru.yaml create mode 100644 files/data/l10n/SettingsMenu/en.yaml create mode 100644 files/data/l10n/SettingsMenu/ru.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ee2e99bba..8b121947f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -178,6 +178,7 @@ Feature #6700: Support windowed fullscreen Feature #6706: Save the size of the Options window Feature #6721: [OpenMW-CS] Add option to open records in new window + Feature #6867: Add a way to localize hardcoded strings in GUI Task #6078: First person should not clear depth buffer Task #6161: Refactor Sky to use shaders and be GLES/GL3 friendly Task #6162: Refactor GUI to use shaders and to be GLES and GL3+ friendly diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 215b2e10c5..76c164c90e 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -852,6 +852,7 @@ void OMW::Engine::prepareEngine() mEnvironment.setWorld(*mWorld); mWindowManager->setStore(mWorld->getStore()); + mLuaManager->initL10n(); mWindowManager->initUI(); //Load translation data diff --git a/apps/openmw/mwbase/luamanager.hpp b/apps/openmw/mwbase/luamanager.hpp index c174dddce3..64be66812b 100644 --- a/apps/openmw/mwbase/luamanager.hpp +++ b/apps/openmw/mwbase/luamanager.hpp @@ -31,6 +31,7 @@ namespace MWBase public: virtual ~LuaManager() = default; + virtual std::string translate(const std::string& contextName, const std::string& key) = 0; virtual void newGameStarted() = 0; virtual void gameLoaded() = 0; virtual void registerObject(const MWWorld::Ptr& ptr) = 0; diff --git a/apps/openmw/mwgui/debugwindow.cpp b/apps/openmw/mwgui/debugwindow.cpp index 23c8dbfe2e..f4a4814654 100644 --- a/apps/openmw/mwgui/debugwindow.cpp +++ b/apps/openmw/mwgui/debugwindow.cpp @@ -92,12 +92,14 @@ namespace MWGui // - Shader editor MyGUI::TabItem* itemLV = mTabControl->addItem("Log Viewer"); + itemLV->setCaptionWithReplacing("#{DebugMenu:LogViewer}"); mLogView = itemLV->createWidgetReal ("LogEdit", MyGUI::FloatCoord(0,0,1,1), MyGUI::Align::Stretch); mLogView->setEditReadOnly(true); #ifndef BT_NO_PROFILE MyGUI::TabItem* item = mTabControl->addItem("Physics Profiler"); + item->setCaptionWithReplacing("#{DebugMenu:PhysicsProfiler}"); mBulletProfilerEdit = item->createWidgetReal ("LogEdit", MyGUI::FloatCoord(0,0,1,1), MyGUI::Align::Stretch); #else diff --git a/apps/openmw/mwgui/postprocessorhud.cpp b/apps/openmw/mwgui/postprocessorhud.cpp index 4d84fedf38..31449bbee6 100644 --- a/apps/openmw/mwgui/postprocessorhud.cpp +++ b/apps/openmw/mwgui/postprocessorhud.cpp @@ -316,7 +316,7 @@ namespace MWGui std::ostringstream ss; - const std::string NA = "NA"; + const std::string NA = "#{Interface:NotAvailableShort}"; const std::string endl = "\n"; std::string author = technique->getAuthor().empty() ? NA : std::string(technique->getAuthor()); @@ -340,14 +340,14 @@ namespace MWGui case fx::Technique::Status::Uncompiled: { if (technique->getDynamic()) - ss << "#{fontcolourhtml=header}Locked: #{fontcolourhtml=normal} Cannot be toggled or moved, controlled by external Lua script" << endl << endl; - ss << "#{fontcolourhtml=header}Author: #{fontcolourhtml=normal} " << author << endl << endl - << "#{fontcolourhtml=header}Version: #{fontcolourhtml=normal} " << version << endl << endl - << "#{fontcolourhtml=header}Description: #{fontcolourhtml=normal} " << description << endl << endl - << "#{fontcolourhtml=header}Interiors: #{fontcolourhtml=normal} " << flag_interior - << "#{fontcolourhtml=header} Exteriors: #{fontcolourhtml=normal} " << flag_exterior - << "#{fontcolourhtml=header} Underwater: #{fontcolourhtml=normal} " << flag_underwater - << "#{fontcolourhtml=header} Abovewater: #{fontcolourhtml=normal} " << flag_abovewater; + ss << "#{fontcolourhtml=header}#{PostProcessing:ShaderLocked}: #{fontcolourhtml=normal} #{PostProcessing:ShaderLockedDescription}" << endl << endl; + ss << "#{fontcolourhtml=header}#{PostProcessing:Author}: #{fontcolourhtml=normal} " << author << endl << endl + << "#{fontcolourhtml=header}#{PostProcessing:Version}: #{fontcolourhtml=normal} " << version << endl << endl + << "#{fontcolourhtml=header}#{PostProcessing:Description}: #{fontcolourhtml=normal} " << description << endl << endl + << "#{fontcolourhtml=header}#{PostProcessing:InInteriors}: #{fontcolourhtml=normal} " << flag_interior + << "#{fontcolourhtml=header} #{PostProcessing:InExteriors}: #{fontcolourhtml=normal} " << flag_exterior + << "#{fontcolourhtml=header} #{PostProcessing:Underwater}: #{fontcolourhtml=normal} " << flag_underwater + << "#{fontcolourhtml=header} #{PostProcessing:Abovewater}: #{fontcolourhtml=normal} " << flag_abovewater; break; } case fx::Technique::Status::Parse_Error: @@ -365,7 +365,7 @@ namespace MWGui if (technique->getUniformMap().size() > 0) { MyGUI::Button* resetButton = mConfigArea->createWidget("MW_Button", {0,0,0,24}, MyGUI::Align::Default); - resetButton->setCaption("Reset all to default"); + resetButton->setCaptionWithReplacing("#{PostProcessing:ResetShader}"); resetButton->setTextAlign(MyGUI::Align::Center); resetButton->eventMouseWheel += MyGUI::newDelegate(this, &PostProcessorHud::notifyMouseWheel); resetButton->eventMouseButtonClick += MyGUI::newDelegate(this, &PostProcessorHud::notifyResetButtonClicked); diff --git a/apps/openmw/mwgui/savegamedialog.cpp b/apps/openmw/mwgui/savegamedialog.cpp index a29928c152..700b06e81e 100644 --- a/apps/openmw/mwgui/savegamedialog.cpp +++ b/apps/openmw/mwgui/savegamedialog.cpp @@ -207,7 +207,7 @@ namespace MWGui mCharacterSelection->setIndexSelected(selectedIndex); if (selectedIndex == MyGUI::ITEM_NONE) - mCharacterSelection->setCaption("Select Character ..."); + mCharacterSelection->setCaptionWithReplacing("#{SavegameMenu:SelectCharacter}"); fillSaveList(); @@ -423,7 +423,7 @@ namespace MWGui if (Settings::Manager::getBool("timeplayed","Saves")) { - text << "\n" << "Time played: " << formatTimeplayed(mCurrentSlot->mProfile.mTimePlayed); + text << "\n" << "#{SavegameMenu:TimePlayed}: " << formatTimeplayed(mCurrentSlot->mProfile.mTimePlayed); } mInfoText->setCaptionWithReplacing(text.str()); diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index f1c573673d..d38763663a 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include @@ -37,12 +38,32 @@ namespace { std::string textureMipmappingToStr(const std::string& val) { - if (val == "linear") return "Trilinear"; - if (val == "nearest") return "Bilinear"; - if (val != "none") - Log(Debug::Warning) << "Warning: Invalid texture mipmap option: "<< val; + if (val == "linear") return "#{SettingsMenu:TextureFilteringTrilinear}"; + if (val == "nearest") return "#{SettingsMenu:TextureFilteringBilinear}"; + if (val == "none") return "#{SettingsMenu:TextureFilteringDisabled}"; - return "Other"; + Log(Debug::Warning) << "Warning: Invalid texture mipmap option: "<< val; + return "#{SettingsMenu:TextureFilteringOther}"; + } + + std::string lightingMethodToStr(SceneUtil::LightingMethod method) + { + std::string result; + switch (method) + { + case SceneUtil::LightingMethod::FFP: + result = "#{SettingsMenu:LightingMethodLegacy}"; + break; + case SceneUtil::LightingMethod::PerObjectUniform: + result = "#{SettingsMenu:LightingMethodShadersCompatibility}"; + break; + case SceneUtil::LightingMethod::SingleUBO: + default: + result = "#{SettingsMenu:LightingMethodShaders}"; + break; + } + + return MyGUI::LanguageManager::getInstance().replaceTags(result); } void parseResolution (int &x, int &y, const std::string& str) @@ -306,7 +327,7 @@ namespace MWGui highlightCurrentResolution(); std::string tmip = Settings::Manager::getString("texture mipmap", "General"); - mTextureFilteringButton->setCaption(textureMipmappingToStr(tmip)); + mTextureFilteringButton->setCaptionWithReplacing(textureMipmappingToStr(tmip)); int waterTextureSize = Settings::Manager::getInt("rtt size", "Water"); if (waterTextureSize >= 512) @@ -426,10 +447,10 @@ namespace MWGui if (pos == MyGUI::ITEM_NONE) return; - std::string message = "This change requires a restart to take effect."; - MWBase::Environment::get().getWindowManager()->interactiveMessageBox(message, {"#{sOK}"}, true); + MWBase::Environment::get().getWindowManager()->interactiveMessageBox("#{SettingsMenu:ChangeRequiresRestart}", {"#{sOK}"}, true); - Settings::Manager::setString("lighting method", "Shaders", _sender->getItemNameAt(pos)); + const auto settingsNames = _sender->getUserData>(); + Settings::Manager::setString("lighting method", "Shaders", settingsNames->at(pos)); apply(); } @@ -454,8 +475,7 @@ namespace MWGui void SettingsWindow::onLightsResetButtonClicked(MyGUI::Widget* _sender) { std::vector buttons = {"#{sYes}", "#{sNo}"}; - std::string message = "Resets to default values, would you like to continue? Changes to lighting method will require a restart."; - MWBase::Environment::get().getWindowManager()->interactiveMessageBox(message, buttons, true); + MWBase::Environment::get().getWindowManager()->interactiveMessageBox("#{SettingsMenu:LightingResetToDefaults}", buttons, true); int selectedButton = MWBase::Environment::get().getWindowManager()->readPressedButton(); if (selectedButton == 1 || selectedButton == -1) return; @@ -471,7 +491,9 @@ namespace MWGui for (const auto& setting : settings) Settings::Manager::setString(setting, "Shaders", Settings::Manager::mDefaultSettings[{"Shaders", setting}]); - mLightingMethodButton->setIndexSelected(mLightingMethodButton->findItemIndexWith(Settings::Manager::mDefaultSettings[{"Shaders", "lighting method"}])); + auto lightingMethod = SceneUtil::LightManager::getLightingMethodFromString(Settings::Manager::mDefaultSettings[{"Shaders", "lighting method"}]); + auto lightIndex = mLightingMethodButton->findItemIndexWith(lightingMethodToStr(lightingMethod)); + mLightingMethodButton->setIndexSelected(lightIndex); updateMaxLightsComboBox(mMaxLights); apply(); @@ -636,7 +658,7 @@ namespace MWGui void SettingsWindow::updateLightSettings() { auto lightingMethod = MWBase::Environment::get().getResourceSystem()->getSceneManager()->getLightingMethod(); - std::string lightingMethodStr = SceneUtil::LightManager::getLightingMethodString(lightingMethod); + std::string lightingMethodStr = lightingMethodToStr(lightingMethod); mLightingMethodButton->removeAllItems(); @@ -646,14 +668,17 @@ namespace MWGui SceneUtil::LightingMethod::SingleUBO, }; + std::vector userData; for (const auto& method : methods) { if (!MWBase::Environment::get().getResourceSystem()->getSceneManager()->isSupportedLightingMethod(method)) continue; - mLightingMethodButton->addItem(SceneUtil::LightManager::getLightingMethodString(method)); + mLightingMethodButton->addItem(lightingMethodToStr(method)); + userData.emplace_back(SceneUtil::LightManager::getLightingMethodString(method)); } + mLightingMethodButton->setUserData(userData); mLightingMethodButton->setIndexSelected(mLightingMethodButton->findItemIndexWith(lightingMethodStr)); } diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index fa00f1b758..5442b22df2 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -55,6 +55,7 @@ #include #include "../mwbase/inputmanager.hpp" +#include "../mwbase/luamanager.hpp" #include "../mwbase/statemanager.hpp" #include "../mwbase/soundmanager.hpp" #include "../mwbase/world.hpp" @@ -1065,12 +1066,27 @@ namespace MWGui } else { + std::vector split; + Misc::StringUtils::split(tag, split, ":"); + + // TODO: LocalizationManager should not be a part of lua + const auto& luaManager = MWBase::Environment::get().getLuaManager(); + + // If a key has a "Context:KeyName" format, use YAML to translate data + if (split.size() == 2 && luaManager != nullptr) + { + _result = luaManager->translate(split[0], split[1]); + return; + } + + // If not, treat is as GMST name from legacy localization if (!mStore) { Log(Debug::Error) << "Error: WindowManager::onRetrieveTag: no Store set up yet, can not replace '" << tag << "'"; + _result = tag; return; } - const ESM::GameSetting *setting = mStore->get().find(tag); + const ESM::GameSetting *setting = mStore->get().search(tag); if (setting && setting->mValue.getType()==ESM::VT_String) _result = setting->mValue.getString(); diff --git a/apps/openmw/mwinput/bindingsmanager.cpp b/apps/openmw/mwinput/bindingsmanager.cpp index 82a469890c..4225a8c5d6 100644 --- a/apps/openmw/mwinput/bindingsmanager.cpp +++ b/apps/openmw/mwinput/bindingsmanager.cpp @@ -426,13 +426,13 @@ namespace MWInput switch (action) { case A_Screenshot: - return "Screenshot"; + return "#{SettingsMenu:Screenshot}"; case A_ZoomIn: - return "Zoom In"; + return "#{SettingsMenu:CameraZoomIn}"; case A_ZoomOut: - return "Zoom Out"; + return "#{SettingsMenu:CameraZoomOut}"; case A_ToggleHUD: - return "Toggle HUD"; + return "#{SettingsMenu:ToggleHUD}"; case A_Use: return "#{sUse}"; case A_Activate: @@ -504,7 +504,7 @@ namespace MWInput case A_QuickLoad: return "#{sQuickLoadCmd}"; case A_TogglePostProcessorHUD: - return "Toggle Post Processor HUD"; + return "#{SettingsMenu:TogglePostProcessorHUD}"; default: return std::string(); // not configurable } diff --git a/apps/openmw/mwlua/luamanagerimp.cpp b/apps/openmw/mwlua/luamanagerimp.cpp index f4ca54576e..1678743257 100644 --- a/apps/openmw/mwlua/luamanagerimp.cpp +++ b/apps/openmw/mwlua/luamanagerimp.cpp @@ -55,6 +55,14 @@ namespace MWLua mGlobalScripts.setAutoStartConf(mConfiguration.getGlobalConf()); } + void LuaManager::initL10n() + { + mL10n.init(); + std::vector preferredLocales; + Misc::StringUtils::split(Settings::Manager::getString("preferred locales", "General"), preferredLocales, ", "); + mL10n.setPreferredLocales(preferredLocales); + } + void LuaManager::init() { Context context; @@ -71,11 +79,6 @@ namespace MWLua localContext.mIsGlobal = false; localContext.mSerializer = mLocalSerializer.get(); - mL10n.init(); - std::vector preferredLocales; - Misc::StringUtils::split(Settings::Manager::getString("preferred locales", "General"), preferredLocales, ", "); - mL10n.setPreferredLocales(preferredLocales); - initObjectBindingsForGlobalScripts(context); initCellBindingsForGlobalScripts(context); initObjectBindingsForLocalScripts(localContext); @@ -103,6 +106,11 @@ namespace MWLua mInitialized = true; } + std::string LuaManager::translate(const std::string& contextName, const std::string& key) + { + return mL10n.translate(contextName, key); + } + void LuaManager::loadPermanentStorage(const std::string& userConfigPath) { auto globalPath = std::filesystem::path(userConfigPath) / "global_storage.bin"; diff --git a/apps/openmw/mwlua/luamanagerimp.hpp b/apps/openmw/mwlua/luamanagerimp.hpp index 0e94e37f24..3f3d8566a7 100644 --- a/apps/openmw/mwlua/luamanagerimp.hpp +++ b/apps/openmw/mwlua/luamanagerimp.hpp @@ -29,6 +29,9 @@ namespace MWLua public: LuaManager(const VFS::Manager* vfs, const std::string& libsDir); + // Called by engine.cpp before UI setup. + void initL10n(); + // Called by engine.cpp when the environment is fully initialized. void init(); @@ -39,6 +42,8 @@ namespace MWLua // thread (in parallel with osg Cull). Can not use scene graph. void update(); + std::string translate(const std::string& contextName, const std::string& key) override; + // Called by engine.cpp from the main thread. Can use scene graph. void synchronizedUpdate(); diff --git a/components/detournavigator/asyncnavmeshupdater.cpp b/components/detournavigator/asyncnavmeshupdater.cpp index b3d6d4151c..3cc19d12ba 100644 --- a/components/detournavigator/asyncnavmeshupdater.cpp +++ b/components/detournavigator/asyncnavmeshupdater.cpp @@ -218,7 +218,7 @@ namespace DetourNavigator { if (mSettings.get().mWaitUntilMinDistanceToPlayer == 0) return; - listener.setLabel("Building navigation mesh"); + listener.setLabel("#{Navigation:BuildingNavigationMesh}"); const std::size_t initialJobsLeft = getTotalJobs(); std::size_t maxProgress = initialJobsLeft + mThreads.size(); listener.setProgressRange(maxProgress); diff --git a/components/lua/l10n.cpp b/components/lua/l10n.cpp index 4a1e533f2d..bd9a9be4c5 100644 --- a/components/lua/l10n.cpp +++ b/components/lua/l10n.cpp @@ -18,6 +18,12 @@ namespace LuaUtil ctx[sol::meta_function::call] = &Context::translate; } + std::string L10nManager::translate(const std::string& contextName, const std::string& key) + { + Context& ctx = getContext(contextName).as(); + return ctx.translate(key, sol::nil); + } + void L10nManager::setPreferredLocales(const std::vector& langs) { mPreferredLocales.clear(); diff --git a/components/lua/l10n.hpp b/components/lua/l10n.hpp index a630797933..d1de193421 100644 --- a/components/lua/l10n.hpp +++ b/components/lua/l10n.hpp @@ -19,6 +19,7 @@ namespace LuaUtil const std::vector& getPreferredLocales() const { return mPreferredLocales; } sol::object getContext(const std::string& contextName, const std::string& fallbackLocale = "en"); + std::string translate(const std::string& contextName, const std::string& key); private: struct Context diff --git a/components/widgets/box.cpp b/components/widgets/box.cpp index 3e8f62b4ba..f9a2e26142 100644 --- a/components/widgets/box.cpp +++ b/components/widgets/box.cpp @@ -1,9 +1,28 @@ #include "box.hpp" #include +#include namespace Gui { + // TODO: Since 3.4.2 MyGUI is supposed to automatically translate tags + // If the 3.4.2 become a required minimum version, the ComboBox class may be removed. + void ComboBox::setPropertyOverride(const std::string& _key, const std::string& _value) + { +#if MYGUI_VERSION >= MYGUI_DEFINE_VERSION(3,4,2) + MyGUI::ComboBox::setPropertyOverride (_key, _value); +#else + if (_key == "AddItem") + { + const std::string value = MyGUI::LanguageManager::getInstance().replaceTags(_value); + MyGUI::ComboBox::setPropertyOverride (_key, value); + } + else + { + MyGUI::ComboBox::setPropertyOverride (_key, _value); + } +#endif + } void AutoSizedWidget::notifySizeChange (MyGUI::Widget* w) { diff --git a/components/widgets/box.hpp b/components/widgets/box.hpp index a96d37ead5..1b1b71f156 100644 --- a/components/widgets/box.hpp +++ b/components/widgets/box.hpp @@ -5,11 +5,20 @@ #include #include #include +#include #include "fontwrapper.hpp" namespace Gui { + class ComboBox : public FontWrapper + { + MYGUI_RTTI_DERIVED( ComboBox ) + + protected: + void setPropertyOverride(const std::string& _key, const std::string& _value) override; + }; + class Button : public FontWrapper { MYGUI_RTTI_DERIVED( Button ) diff --git a/components/widgets/widgets.cpp b/components/widgets/widgets.cpp index c1a9a50531..a5ff0b677d 100644 --- a/components/widgets/widgets.cpp +++ b/components/widgets/widgets.cpp @@ -28,6 +28,7 @@ namespace Gui MyGUI::FactoryManager::getInstance().registerFactory("Widget"); MyGUI::FactoryManager::getInstance().registerFactory("Widget"); MyGUI::FactoryManager::getInstance().registerFactory("Widget"); + MyGUI::FactoryManager::getInstance().registerFactory("Widget"); } } diff --git a/files/data/CMakeLists.txt b/files/data/CMakeLists.txt index 052363217f..f476498494 100644 --- a/files/data/CMakeLists.txt +++ b/files/data/CMakeLists.txt @@ -12,10 +12,20 @@ set(BUILTIN_DATA_FILES l10n/Calendar/en.yaml l10n/Calendar/ru.yaml + l10n/DebugMenu/en.yaml + l10n/DebugMenu/ru.yaml l10n/Interface/en.yaml l10n/Interface/ru.yaml + l10n/Navigation/en.yaml + l10n/Navigation/ru.yaml l10n/OMWCamera/en.yaml l10n/OMWCamera/ru.yaml + l10n/PostProcessing/en.yaml + l10n/PostProcessing/ru.yaml + l10n/SavegameMenu/en.yaml + l10n/SavegameMenu/ru.yaml + l10n/SettingsMenu/en.yaml + l10n/SettingsMenu/ru.yaml openmw_aux/util.lua openmw_aux/time.lua diff --git a/files/data/l10n/DebugMenu/en.yaml b/files/data/l10n/DebugMenu/en.yaml new file mode 100644 index 0000000000..af3b31aacd --- /dev/null +++ b/files/data/l10n/DebugMenu/en.yaml @@ -0,0 +1,3 @@ +DebugWindow: "Debug" +LogViewer: "Log Viewer" +PhysicsProfiler: "Physics Profiler" diff --git a/files/data/l10n/DebugMenu/ru.yaml b/files/data/l10n/DebugMenu/ru.yaml new file mode 100644 index 0000000000..afa8bdb904 --- /dev/null +++ b/files/data/l10n/DebugMenu/ru.yaml @@ -0,0 +1,3 @@ +DebugWindow: "Меню отладки" +LogViewer: "Журнал логов" +PhysicsProfiler: "Профилировщик физики" diff --git a/files/data/l10n/Interface/en.yaml b/files/data/l10n/Interface/en.yaml index 4b4ed1584f..a7aaf978e2 100644 --- a/files/data/l10n/Interface/en.yaml +++ b/files/data/l10n/Interface/en.yaml @@ -1,3 +1,4 @@ -Yes: "Yes" No: "No" -Reset: "Reset" \ No newline at end of file +NotAvailableShort: "N/A" +Reset: "Reset" +Yes: "Yes" diff --git a/files/data/l10n/Interface/ru.yaml b/files/data/l10n/Interface/ru.yaml index a224bb9174..ae405abd8f 100644 --- a/files/data/l10n/Interface/ru.yaml +++ b/files/data/l10n/Interface/ru.yaml @@ -1,3 +1,4 @@ -Yes: "Да" No: "Нет" +NotAvailableShort: "Н/Д" Reset: "Обнулить" +Yes: "Да" diff --git a/files/data/l10n/Navigation/en.yaml b/files/data/l10n/Navigation/en.yaml new file mode 100644 index 0000000000..06fb8c26ba --- /dev/null +++ b/files/data/l10n/Navigation/en.yaml @@ -0,0 +1 @@ +BuildingNavigationMesh: "Building navigation mesh" diff --git a/files/data/l10n/Navigation/ru.yaml b/files/data/l10n/Navigation/ru.yaml new file mode 100644 index 0000000000..509c178dea --- /dev/null +++ b/files/data/l10n/Navigation/ru.yaml @@ -0,0 +1 @@ +BuildingNavigationMesh: "Построение навигационной сетки" diff --git a/files/data/l10n/PostProcessing/en.yaml b/files/data/l10n/PostProcessing/en.yaml new file mode 100644 index 0000000000..44cb90cacf --- /dev/null +++ b/files/data/l10n/PostProcessing/en.yaml @@ -0,0 +1,20 @@ +Abovewater: "Abovewater" +Author: "Author" +Configuration: "Configuration" +Description: "Description" +InExteriors: "Exteriors" +InInteriors: "Interiors" +KeyboardControls: | + Keyboard controls: + + Shift+Right-Arrow > Activate shader + Shift+Left-Arrow > Deactive shader + Shift+Up-Arrow > Move shader up + Shift+Down-Arrow > Move shader down +PostProcessHUD: "Postprocess HUD" +ResetShader: "Reset shader to default state" +ShaderLocked: "Locked" +ShaderLockedDescription: "Cannot be toggled or moved, controlled by external Lua script" +ShaderResetUniform: "r" +Underwater: "Underwater" +Version: "Version" diff --git a/files/data/l10n/PostProcessing/ru.yaml b/files/data/l10n/PostProcessing/ru.yaml new file mode 100644 index 0000000000..6bbe3e1e47 --- /dev/null +++ b/files/data/l10n/PostProcessing/ru.yaml @@ -0,0 +1,20 @@ +Abovewater: "Над водой" +Author: "Автор" +Configuration: "Настройки" +Description: "Описание" +InExteriors: "Вне помещений" +InInteriors: "В помещениях" +KeyboardControls: | + Управление с помощью клавиатуры: + + Shift+Right-Arrow > Включить шейдер + Shift+Left-Arrow > Выключить шейдер + Shift+Up-Arrow > Передвинуть шейдер выше + Shift+Down-Arrow > Передвинуть шейдер ниже +PostProcessHUD: "Настройки постобработки" +ResetShader: "Обнулить настройки этого шейдера" +ShaderLocked: "Заблокирован" +ShaderLockedDescription: "Не может быть выключен или перемещен, управляется внешним Lua-скриптом" +ShaderResetUniform: "x" +Underwater: "Под водой" +Version: "Версия" diff --git a/files/data/l10n/SavegameMenu/en.yaml b/files/data/l10n/SavegameMenu/en.yaml new file mode 100644 index 0000000000..b7e3c60a5f --- /dev/null +++ b/files/data/l10n/SavegameMenu/en.yaml @@ -0,0 +1,2 @@ +SelectCharacter: "Select Character..." +TimePlayed: "Time played" diff --git a/files/data/l10n/SavegameMenu/ru.yaml b/files/data/l10n/SavegameMenu/ru.yaml new file mode 100644 index 0000000000..8b87500bd3 --- /dev/null +++ b/files/data/l10n/SavegameMenu/ru.yaml @@ -0,0 +1,2 @@ +SelectCharacter: "Выберите персонажа..." +TimePlayed: "Время в игре" diff --git a/files/data/l10n/SettingsMenu/en.yaml b/files/data/l10n/SettingsMenu/en.yaml new file mode 100644 index 0000000000..da3eeaceb7 --- /dev/null +++ b/files/data/l10n/SettingsMenu/en.yaml @@ -0,0 +1,59 @@ +ActorsProcessingRange: "Actors Processing Range" +Anisotropy: "Anisotropy" +CameraSensitivity: "Camera Sensitivity" +CameraZoomIn: "Zoom Camera In" +CameraZoomOut: "Zoom Camera Out" +ChangeRequiresRestart: "This change requires a restart to take effect." +Controller: "Controller" +FieldOfView: "Field of View" +FrameRateHint: "Hint: press F3 to show\nthe current frame rate." +InvertXAxis: "Invert X Axis" +LightingMethod: "Lighting Method" +LightingMethodLegacy: "Legacy" +LightingMethodShaders: "Shaders" +LightingMethodShadersCompatibility: "Shaders (compatibility)" +LightingResetToDefaults: "Resets to default values, would you like to continue? Changes to lighting method will require a restart." +Lights: "Lights" +LightsBoundingSphereMultiplier: "Bounding Sphere Multiplier" +LightsBoundingSphereMultiplierTooltip: "Default: 1.65\nMultipler for bounding sphere of lights.\nHigher numbers allows for smooth falloff but require an increase in number of max lights.\n\nDoes not effect the illumination or strength of lights." +LightsFadeStartMultiplier: "Fade Start Multiplier" +LightsFadeStartMultiplierTooltip: "Default: 0.85\nFraction of maximum distance at which lights will start to fade.\n\nSet this to a low value for slower transitions or a high value for quicker transitions." +LightsMaximumDistance: "Maximum Light Distance" +LightsMaximumDistanceTooltip: "Default: 8192\nMaximum distance at which lights will appear (measured in units).\n\nSet this to 0 to use an unlimited distance." +LightsMinimumInteriorBrightness: "Minimum Interior Brightness" +LightsMinimumInteriorBrightnessTooltip: "Default: 0.08\nMinimum ambient interior brightness.\n\nIncrease this if you feel interiors are too dark." +MaxLights: "Max Lights" +MaxLightsTooltip: "Default: 8\nMaximum number of lights per object.\n\nA low number near default will cause light popping similar to what you would see with legacy lighting." +MouseAndKeyboard: "Mouse/Keyboard" +PostProcessing: "Post Processing" +PostProcessingTooltip: "Tweaked via Post Processor HUD, see input bindings." +RainRippleDetail: "Rain ripple detail" +RainRippleDetailDense: "Dense" +RainRippleDetailSimple: "Simple" +RainRippleDetailSparse: "Sparse" +ReflectionShaderDetail: "Reflection shader detail" +ReflectionShaderDetailActors: "Actors" +ReflectionShaderDetailGroundcover: "Groundcover" +ReflectionShaderDetailObjects: "Objects" +ReflectionShaderDetailSky: "Sky" +ReflectionShaderDetailTerrain: "Terrain" +ReflectionShaderDetailWorld: "World" +Refraction: "Refraction" +Screenshot: "Screenshot" +Scripts: "Scripts" +TextureFiltering: "Texture Filtering" +TextureFilteringBilinear: "Bilinear" +TextureFilteringDisabled: "None" +TextureFilteringOther: "Other" +TextureFilteringTrilinear: "Trilinear" +ToggleHUD: "Toggle HUD" +TogglePostProcessorHUD: "Toggle Post Processor HUD" +VSync: "VSync" +Water: "Water" +WaterShader: "Water shader" +WaterShaderTextureQuality: "Texture quality" +WindowBorder: "Window Border" +WindowMode: "Window Mode" +WindowModeFullscreen: "Fullscreen" +WindowModeWindowed: "Windowed" +WindowModeWindowedFullscreen: "Windowed Fullscreen" diff --git a/files/data/l10n/SettingsMenu/ru.yaml b/files/data/l10n/SettingsMenu/ru.yaml new file mode 100644 index 0000000000..1662153f7c --- /dev/null +++ b/files/data/l10n/SettingsMenu/ru.yaml @@ -0,0 +1,59 @@ +ActorsProcessingRange: "Дальность обработки персонажей" +Anisotropy: "Анизотропная фильтрация" +CameraSensitivity: "Чувствительность камеры" +CameraZoomIn: "Приблизить камеру" +CameraZoomOut: "Отдалить камеру" +ChangeRequiresRestart: "Чтобы это изменение вступило в силу, нужно перезапустить приложение." +Controller: "Геймпад" +FieldOfView: "Поле зрения" +FrameRateHint: "Подсказка: нажмите F3, чтобы показать\nтекущую частоту смены кадров." +InvertXAxis: "Инвертировать ось X" +LightingMethod: "Способ освещения" +LightingMethodLegacy: "Устаревший" +LightingMethodShaders: "Шейдеры" +LightingMethodShadersCompatibility: "Шейдеры (режим совместимости)" +LightingResetToDefaults: "Обнулить настройки освещения? Смена метода освещения вступит в силу только после перезапуска приложения." +Lights: "Освещение" +LightsBoundingSphereMultiplier: "Множитель размера ограничивающей сферы" +LightsBoundingSphereMultiplierTooltip: "Значение по умолчанию: 1.65\nМножитель размера ограничивающей сферы источников света.\nВысокие значения делают затухание света плавнее, но требуют более высокого максимального количества источников света.\n\nНастройка не влияет на уровень освещения или мощность источников света." +LightsFadeStartMultiplier: "Множитель начала затухания" +LightsFadeStartMultiplierTooltip: "Значение по умолчанию: 0.85\nДоля расстояния (относительно дальности отображения источников света), на которой свет начинает затухать.\n\nНизкие значения ведут к плавному затуханию, высокие - к резкому." +LightsMaximumDistance: "Дальность отображения источников света" +LightsMaximumDistanceTooltip: "Значение по умолчанию: 8192\nМаксимальное расстояние, на котором будут отображаться источники света (во внутриигровых единицах измерения).\n\nЕсли 0, то расстояние не ограничено." +LightsMinimumInteriorBrightness: "Минимальный уровень освещения в помещениях" +LightsMinimumInteriorBrightnessTooltip: "Значение по умолчанию: 0.08\nМинимальный уровень фонового освещения в помещениях.\n\nУвеличьте значение, если помещения в игре кажутся слишком темными." +MaxLights: "Макс. кол-во источников света" +MaxLightsTooltip: "Значение по умолчанию: 8\nМаксимальное количество источников света для каждого объекта.\n\nНизкие числа (близкие к значению по умолчанию) приводят к резким перепадам освещения, как при устаревшем методе освещения." +MouseAndKeyboard: "Мышь/Клавиатура" +PostProcessing: "Постобработка" +PostProcessingTooltip: "Настраивается через меню настроек постобработки, см. привязки клавиш." +RainRippleDetail: "Капли дождя на воде" +RainRippleDetailDense: "Плотные" +RainRippleDetailSimple: "Упрощенные" +RainRippleDetailSparse: "Редкие" +ReflectionShaderDetail: "Детализация отражений" +ReflectionShaderDetailActors: "Персонажи" +ReflectionShaderDetailGroundcover: "Трава" +ReflectionShaderDetailObjects: "Предметы" +ReflectionShaderDetailSky: "Небо" +ReflectionShaderDetailTerrain: "Ландшафт" +ReflectionShaderDetailWorld: "Мир" +Refraction: "Рефракция" +Screenshot: "Снимок экрана" +Scripts: "Скрипты" +TextureFiltering: "Фильтрация текстур" +TextureFilteringBilinear: "Билинейная" +TextureFilteringDisabled: "Отключена" +TextureFilteringOther: "Другая" +TextureFilteringTrilinear: "Трилинейная" +ToggleHUD: "Переключить HUD" +TogglePostProcessorHUD: "Меню настроек постобработки" +VSync: "Вертикальная синхронизация" +Water: "Вода" +WaterShader: "Шейдер воды" +WaterShaderTextureQuality: "Качество текстуры воды" +WindowBorder: "Рамка окна" +WindowMode: "Режим окна" +WindowModeFullscreen: "Полный экран" +WindowModeWindowed: "Оконный" +WindowModeWindowedFullscreen: "Оконный без полей" diff --git a/files/mygui/openmw_chargen_birth.layout b/files/mygui/openmw_chargen_birth.layout index 206e559e45..05f92b9b33 100644 --- a/files/mygui/openmw_chargen_birth.layout +++ b/files/mygui/openmw_chargen_birth.layout @@ -22,7 +22,7 @@ - + diff --git a/files/mygui/openmw_debug_window.layout b/files/mygui/openmw_debug_window.layout index b874280274..a2635c3c46 100644 --- a/files/mygui/openmw_debug_window.layout +++ b/files/mygui/openmw_debug_window.layout @@ -1,7 +1,7 @@ - + diff --git a/files/mygui/openmw_postprocessor_hud.layout b/files/mygui/openmw_postprocessor_hud.layout index 7a04a2f8b0..e299596032 100644 --- a/files/mygui/openmw_postprocessor_hud.layout +++ b/files/mygui/openmw_postprocessor_hud.layout @@ -2,7 +2,7 @@ - + @@ -12,17 +12,11 @@ - + - + diff --git a/files/mygui/openmw_postprocessor_hud.skin.xml b/files/mygui/openmw_postprocessor_hud.skin.xml index 094330620c..b25b7f1372 100644 --- a/files/mygui/openmw_postprocessor_hud.skin.xml +++ b/files/mygui/openmw_postprocessor_hud.skin.xml @@ -16,7 +16,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -59,7 +59,7 @@ - + diff --git a/files/mygui/openmw_savegame_dialog.layout b/files/mygui/openmw_savegame_dialog.layout index 22fa69aa5b..8a0a461eb1 100644 --- a/files/mygui/openmw_savegame_dialog.layout +++ b/files/mygui/openmw_savegame_dialog.layout @@ -17,7 +17,7 @@ - + diff --git a/files/mygui/openmw_settings_window.layout b/files/mygui/openmw_settings_window.layout index 29c927d38b..dfb291ea60 100644 --- a/files/mygui/openmw_settings_window.layout +++ b/files/mygui/openmw_settings_window.layout @@ -73,9 +73,9 @@ - - - + + + @@ -87,7 +87,7 @@ - + @@ -204,10 +204,10 @@ - + - + @@ -219,14 +219,14 @@ - + - + @@ -238,7 +238,7 @@ - + @@ -274,26 +274,26 @@ - + - + - + - - - + + + - + - + @@ -303,7 +303,7 @@ - + @@ -313,15 +313,15 @@ - + - + - + @@ -336,7 +336,7 @@ - + @@ -369,20 +369,20 @@ - + - + - - + + - + @@ -391,7 +391,7 @@ - + @@ -432,7 +432,7 @@ - + @@ -446,7 +446,7 @@ - + @@ -460,14 +460,14 @@ - + - + @@ -476,9 +476,9 @@ - - - + + + @@ -486,7 +486,7 @@ - + @@ -495,12 +495,12 @@ - - - - - - + + + + + + @@ -508,7 +508,7 @@ - + @@ -518,9 +518,9 @@ - - - + + + @@ -529,21 +529,21 @@ - + - - + + - + - + - + @@ -551,9 +551,9 @@ - + - + @@ -561,10 +561,10 @@ - + - + @@ -576,13 +576,13 @@ - + - + - + @@ -594,13 +594,13 @@ - + - + - + @@ -612,13 +612,13 @@ - + - + - + @@ -628,16 +628,16 @@ - + - + - + diff --git a/files/mygui/openmw_text_input.layout b/files/mygui/openmw_text_input.layout index 85376060f4..9f879bc14a 100644 --- a/files/mygui/openmw_text_input.layout +++ b/files/mygui/openmw_text_input.layout @@ -12,7 +12,7 @@ - +