From 618b912a2087f0ac46792715e20f83d88fc59dec Mon Sep 17 00:00:00 2001 From: Petr Mikheev Date: Wed, 22 Mar 2023 22:54:42 +0100 Subject: [PATCH 1/2] Dehardcode non-game-specific localization GMSTs; Update l10n files. --- apps/openmw/mwgui/console.cpp | 2 +- apps/openmw/mwgui/hud.cpp | 2 +- apps/openmw/mwgui/jailscreen.cpp | 2 +- apps/openmw/mwgui/mainmenu.cpp | 4 +- apps/openmw/mwgui/postprocessorhud.cpp | 2 +- apps/openmw/mwgui/savegamedialog.cpp | 10 +- apps/openmw/mwgui/waitdialog.cpp | 6 +- apps/openmw/mwgui/windowmanagerimp.cpp | 2 +- apps/openmw/mwinput/bindingsmanager.cpp | 12 +-- apps/openmw/mwstate/statemanagerimp.cpp | 49 ++++++---- apps/openmw/mwworld/datetimemanager.cpp | 30 +++--- apps/openmw/mwworld/scene.cpp | 8 +- components/fx/widgets.cpp | 2 +- components/l10n/manager.hpp | 5 + files/data-mw/l10n/Calendar/de.yaml | 2 +- files/data-mw/l10n/Calendar/en.yaml | 2 +- files/data-mw/l10n/Calendar/fr.yaml | 2 +- files/data-mw/l10n/Calendar/gmst.yaml | 16 ++++ files/data-mw/l10n/Calendar/ru.yaml | 2 +- files/data-mw/l10n/Calendar/sv.yaml | 2 +- files/data-mw/l10n/Interface/gmst.yaml | 9 +- files/data-mw/l10n/OMWEngine/gmst.yaml | 52 +++++++++++ files/data/l10n/Calendar/en.yaml | 6 +- files/data/l10n/Interface/de.yaml | 23 +++++ files/data/l10n/Interface/en.yaml | 3 +- files/data/l10n/Interface/fr.yaml | 9 ++ files/data/l10n/Interface/ru.yaml | 8 +- files/data/l10n/Interface/sv.yaml | 9 ++ files/data/l10n/OMWEngine/de.yaml | 73 +++++++++++++++ files/data/l10n/OMWEngine/en.yaml | 62 +++++++++++++ files/data/l10n/OMWEngine/fr.yaml | 74 +++++++++++++++ files/data/l10n/OMWEngine/ru.yaml | 66 +++++++++++++ files/data/l10n/OMWEngine/sv.yaml | 74 +++++++++++++++ files/data/mygui/openmw_alchemy_window.layout | 2 +- files/data/mygui/openmw_chargen_birth.layout | 2 +- files/data/mygui/openmw_chargen_class.layout | 2 +- .../mygui/openmw_chargen_create_class.layout | 2 +- ...penmw_chargen_generate_class_result.layout | 2 +- files/data/mygui/openmw_chargen_race.layout | 2 +- files/data/mygui/openmw_chargen_review.layout | 2 +- .../openmw_chargen_select_attribute.layout | 2 +- .../mygui/openmw_chargen_select_skill.layout | 2 +- ...penmw_chargen_select_specialization.layout | 2 +- .../data/mygui/openmw_companion_window.layout | 2 +- .../mygui/openmw_confirmation_dialog.layout | 4 +- files/data/mygui/openmw_console.layout | 2 +- .../data/mygui/openmw_container_window.layout | 2 +- files/data/mygui/openmw_count_window.layout | 4 +- files/data/mygui/openmw_edit_effect.layout | 4 +- files/data/mygui/openmw_edit_note.layout | 4 +- .../mygui/openmw_enchanting_dialog.layout | 2 +- .../mygui/openmw_itemselection_dialog.layout | 2 +- files/data/mygui/openmw_levelup_dialog.layout | 2 +- .../mygui/openmw_magicselection_dialog.layout | 2 +- files/data/mygui/openmw_merchantrepair.layout | 2 +- .../mygui/openmw_persuasion_dialog.layout | 2 +- .../mygui/openmw_postprocessor_hud.skin.xml | 2 +- files/data/mygui/openmw_quickkeys_menu.layout | 2 +- .../mygui/openmw_quickkeys_menu_assign.layout | 2 +- .../data/mygui/openmw_recharge_dialog.layout | 2 +- files/data/mygui/openmw_repair.layout | 2 +- .../data/mygui/openmw_savegame_dialog.layout | 6 +- .../data/mygui/openmw_settings_window.layout | 92 +++++++++---------- .../mygui/openmw_spell_buying_window.layout | 2 +- .../mygui/openmw_spellcreation_dialog.layout | 2 +- files/data/mygui/openmw_text_input.layout | 2 +- files/data/mygui/openmw_trade_window.layout | 2 +- files/data/mygui/openmw_trainingwindow.layout | 2 +- files/data/mygui/openmw_travel_window.layout | 2 +- files/data/mygui/openmw_wait_dialog.layout | 2 +- 70 files changed, 651 insertions(+), 155 deletions(-) create mode 100644 files/data-mw/l10n/Calendar/gmst.yaml diff --git a/apps/openmw/mwgui/console.cpp b/apps/openmw/mwgui/console.cpp index 1b349c9ae3..6b7cb31c75 100644 --- a/apps/openmw/mwgui/console.cpp +++ b/apps/openmw/mwgui/console.cpp @@ -679,7 +679,7 @@ namespace MWGui void Console::updateConsoleTitle() { - std::string title = "#{sConsoleTitle}"; + std::string title = "#{OMWEngine:ConsoleWindow}"; if (!mConsoleMode.empty()) title = mConsoleMode + " " + title; if (!mPtr.isEmpty()) diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index 8d667082bc..94842e4bb9 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -467,7 +467,7 @@ namespace MWGui void HUD::unsetSelectedSpell() { - std::string_view spellName = "#{sNone}"; + std::string_view spellName = "#{Interface:None}"; if (spellName != mSpellName && mSpellVisible) { mWeaponSpellTimer = 5.0f; diff --git a/apps/openmw/mwgui/jailscreen.cpp b/apps/openmw/mwgui/jailscreen.cpp index 9ff9a9c791..37102d6ae9 100644 --- a/apps/openmw/mwgui/jailscreen.cpp +++ b/apps/openmw/mwgui/jailscreen.cpp @@ -126,7 +126,7 @@ namespace MWGui } std::vector buttons; - buttons.emplace_back("#{sOk}"); + buttons.emplace_back("#{Interface:OK}"); MWBase::Environment::get().getWindowManager()->interactiveMessageBox(message, buttons); } } diff --git a/apps/openmw/mwgui/mainmenu.cpp b/apps/openmw/mwgui/mainmenu.cpp index 079b76b2b9..bca819facf 100644 --- a/apps/openmw/mwgui/mainmenu.cpp +++ b/apps/openmw/mwgui/mainmenu.cpp @@ -107,7 +107,7 @@ namespace MWGui else { ConfirmationDialog* dialog = winMgr->getConfirmationDialog(); - dialog->askForConfirmation("#{sMessage2}"); + dialog->askForConfirmation("#{OMWEngine:QuitGameConfirmation}"); dialog->eventOkClicked.clear(); dialog->eventOkClicked += MyGUI::newDelegate(this, &MainMenu::onExitConfirmed); dialog->eventCancelClicked.clear(); @@ -120,7 +120,7 @@ namespace MWGui else { ConfirmationDialog* dialog = winMgr->getConfirmationDialog(); - dialog->askForConfirmation("#{sNotifyMessage54}"); + dialog->askForConfirmation("#{OMWEngine:NewGameConfirmation}"); dialog->eventOkClicked.clear(); dialog->eventOkClicked += MyGUI::newDelegate(this, &MainMenu::onNewGameConfirmed); dialog->eventCancelClicked.clear(); diff --git a/apps/openmw/mwgui/postprocessorhud.cpp b/apps/openmw/mwgui/postprocessorhud.cpp index dcf66647c3..f90f96c250 100644 --- a/apps/openmw/mwgui/postprocessorhud.cpp +++ b/apps/openmw/mwgui/postprocessorhud.cpp @@ -316,7 +316,7 @@ namespace MWGui std::string_view version = technique->getVersion().empty() ? NA : technique->getVersion(); std::string_view description = technique->getDescription().empty() ? NA : technique->getDescription(); - auto serializeBool = [](bool value) { return value ? "#{sYes}" : "#{sNo}"; }; + auto serializeBool = [](bool value) { return value ? "#{Interface:Yes}" : "#{Interface:No}"; }; const auto flags = technique->getFlags(); diff --git a/apps/openmw/mwgui/savegamedialog.cpp b/apps/openmw/mwgui/savegamedialog.cpp index 1e963a0348..db1acf40d2 100644 --- a/apps/openmw/mwgui/savegamedialog.cpp +++ b/apps/openmw/mwgui/savegamedialog.cpp @@ -85,7 +85,7 @@ namespace MWGui void SaveGameDialog::confirmDeleteSave() { ConfirmationDialog* dialog = MWBase::Environment::get().getWindowManager()->getConfirmationDialog(); - dialog->askForConfirmation("#{sMessage3}"); + dialog->askForConfirmation("#{OMWEngine:DeleteGameConfirmation}"); dialog->eventOkClicked.clear(); dialog->eventOkClicked += MyGUI::newDelegate(this, &SaveGameDialog::onDeleteSlotConfirmed); dialog->eventCancelClicked.clear(); @@ -268,7 +268,7 @@ namespace MWGui if (mCurrentSlot != nullptr && !reallySure) { ConfirmationDialog* dialog = MWBase::Environment::get().getWindowManager()->getConfirmationDialog(); - dialog->askForConfirmation("#{sMessage4}"); + dialog->askForConfirmation("#{OMWEngine:OverwriteGameConfirmation}"); dialog->eventOkClicked.clear(); dialog->eventOkClicked += MyGUI::newDelegate(this, &SaveGameDialog::onConfirmationGiven); dialog->eventCancelClicked.clear(); @@ -277,7 +277,7 @@ namespace MWGui } if (mSaveNameEdit->getCaption().empty()) { - MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage65}"); + MWBase::Environment::get().getWindowManager()->messageBox("#{OMWEngine:EmptySaveNameError}"); return; } } @@ -289,7 +289,7 @@ namespace MWGui if (state == MWBase::StateManager::State_Running && !reallySure) { ConfirmationDialog* dialog = MWBase::Environment::get().getWindowManager()->getConfirmationDialog(); - dialog->askForConfirmation("#{sMessage1}"); + dialog->askForConfirmation("#{OMWEngine:LoadGameConfirmation}"); dialog->eventOkClicked.clear(); dialog->eventOkClicked += MyGUI::newDelegate(this, &SaveGameDialog::onConfirmationGiven); dialog->eventCancelClicked.clear(); @@ -425,7 +425,7 @@ namespace MWGui text << mCurrentSlot->mProfile.mInGameTime.mDay << " " << MWBase::Environment::get().getWorld()->getMonthName(mCurrentSlot->mProfile.mInGameTime.mMonth) << " " - << hour << " " << (pm ? "#{sSaveMenuHelp05}" : "#{sSaveMenuHelp04}"); + << hour << " " << (pm ? "#{Calendar:pm}" : "#{Calendar:am}"); if (Settings::Manager::getBool("timeplayed", "Saves")) { diff --git a/apps/openmw/mwgui/waitdialog.cpp b/apps/openmw/mwgui/waitdialog.cpp index e9d92e7c7a..6159ef0263 100644 --- a/apps/openmw/mwgui/waitdialog.cpp +++ b/apps/openmw/mwgui/waitdialog.cpp @@ -163,9 +163,9 @@ namespace MWGui hour = 12; ESM::EpochTimeStamp currentDate = MWBase::Environment::get().getWorld()->getEpochTimeStamp(); - std::string daysPassed - = Misc::StringUtils::format("(#{sDay} %i)", MWBase::Environment::get().getWorld()->getTimeStamp().getDay()); - std::string_view formattedHour(pm ? "#{sSaveMenuHelp05}" : "#{sSaveMenuHelp04}"); + std::string daysPassed = Misc::StringUtils::format( + "(#{Calendar:day} %i)", MWBase::Environment::get().getWorld()->getTimeStamp().getDay()); + std::string_view formattedHour(pm ? "#{Calendar:pm}" : "#{Calendar:am}"); std::string dateTimeText = Misc::StringUtils::format("%i %s %s %i %s", currentDate.mDay, month, daysPassed, hour, formattedHour); mDateTimeText->setCaptionWithReplacing(dateTimeText); diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 103ee340f3..989638d8ec 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -1408,7 +1408,7 @@ namespace MWGui if (player->getDrawState() == MWMechanics::DrawState::Spell) player->setDrawState(MWMechanics::DrawState::Nothing); - mSpellWindow->setTitle("#{sNone}"); + mSpellWindow->setTitle("#{Interface:None}"); } void WindowManager::unsetSelectedWeapon() diff --git a/apps/openmw/mwinput/bindingsmanager.cpp b/apps/openmw/mwinput/bindingsmanager.cpp index 9eac57e830..a3bd4e28fb 100644 --- a/apps/openmw/mwinput/bindingsmanager.cpp +++ b/apps/openmw/mwinput/bindingsmanager.cpp @@ -473,7 +473,7 @@ namespace MWInput case A_CycleWeaponRight: return "#{sNextWeapon}"; case A_Console: - return "#{sConsoleTitle}"; + return "#{OMWEngine:ConsoleWindow}"; case A_Run: return "#{sRun}"; case A_Sneak: @@ -528,7 +528,7 @@ namespace MWInput std::string BindingsManager::getActionKeyBindingName(int action) { if (mInputBinder->getChannel(action)->getControlsCount() == 0) - return "#{sNone}"; + return "#{Interface:None}"; ICS::Control* c = mInputBinder->getChannel(action)->getAttachedControls().front().control; @@ -551,16 +551,16 @@ namespace MWInput case ICS::InputControlSystem::MouseWheelClick::LEFT: return "Mouse Wheel Left"; default: - return "#{sNone}"; + return "#{Interface:None}"; } else - return "#{sNone}"; + return "#{Interface:None}"; } std::string BindingsManager::getActionControllerBindingName(int action) { if (mInputBinder->getChannel(action)->getControlsCount() == 0) - return "#{sNone}"; + return "#{Interface:None}"; ICS::Control* c = mInputBinder->getChannel(action)->getAttachedControls().front().control; @@ -573,7 +573,7 @@ namespace MWInput return SDLUtil::sdlControllerButtonToString( mInputBinder->getJoystickButtonBinding(c, sFakeDeviceId, ICS::Control::INCREASE)); else - return "#{sNone}"; + return "#{Interface:None}"; } const std::initializer_list& BindingsManager::getActionKeySorting() diff --git a/apps/openmw/mwstate/statemanagerimp.cpp b/apps/openmw/mwstate/statemanagerimp.cpp index 8718b7853c..e35410b484 100644 --- a/apps/openmw/mwstate/statemanagerimp.cpp +++ b/apps/openmw/mwstate/statemanagerimp.cpp @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -124,11 +126,11 @@ void MWState::StateManager::askLoadRecent() { MWState::Slot lastSave = *character->begin(); std::vector buttons; - buttons.emplace_back("#{sYes}"); - buttons.emplace_back("#{sNo}"); + buttons.emplace_back("#{Interface:Yes}"); + buttons.emplace_back("#{Interface:No}"); + std::string message + = MWBase::Environment::get().getL10nManager()->getMessage("OMWEngine", "AskLoadLastSave"); std::string_view tag = "%s"; - std::string message{ MWBase::Environment::get().getWindowManager()->getGameSettingString( - "sLoadLastSaveMsg", tag) }; size_t pos = message.find(tag); message.replace(pos, tag.length(), lastSave.mProfile.mDescription); MWBase::Environment::get().getWindowManager()->interactiveMessageBox(message, buttons); @@ -172,7 +174,7 @@ void MWState::StateManager::newGame(bool bypass) MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_MainMenu); std::vector buttons; - buttons.emplace_back("#{sOk}"); + buttons.emplace_back("#{Interface:OK}"); MWBase::Environment::get().getWindowManager()->interactiveMessageBox(error.str(), buttons); } } @@ -274,7 +276,7 @@ void MWState::StateManager::saveGame(const std::string& description, const Slot* Loading::Listener& listener = *MWBase::Environment::get().getWindowManager()->getLoadingScreen(); // Using only Cells for progress information, since they typically have the largest records by far listener.setProgressRange(MWBase::Environment::get().getWorld()->countSavedGameCells()); - listener.setLabel("#{sNotifyMessage4}", true); + listener.setLabel("#{OMWEngine:SavingInProgress}", true); Loading::ScopedLoad load(&listener); @@ -327,7 +329,7 @@ void MWState::StateManager::saveGame(const std::string& description, const Slot* Log(Debug::Error) << error.str(); std::vector buttons; - buttons.emplace_back("#{sOk}"); + buttons.emplace_back("#{Interface:OK}"); MWBase::Environment::get().getWindowManager()->interactiveMessageBox(error.str(), buttons); // If no file was written, clean up the slot @@ -346,7 +348,7 @@ void MWState::StateManager::quickSave(std::string name) && MWBase::Environment::get().getWindowManager()->isSavingAllowed())) { // You can not save your game right now - MWBase::Environment::get().getWindowManager()->messageBox("#{sSaveGameDenied}"); + MWBase::Environment::get().getWindowManager()->messageBox("#{OMWEngine:SaveGameDenied}"); return; } @@ -389,6 +391,11 @@ void MWState::StateManager::loadGame(const std::filesystem::path& filepath) loadGame(character, filepath); } +struct VersionMismatchError : public std::runtime_error +{ + using std::runtime_error::runtime_error; +}; + void MWState::StateManager::loadGame(const Character* character, const std::filesystem::path& filepath) { try @@ -401,7 +408,7 @@ void MWState::StateManager::loadGame(const Character* character, const std::file reader.open(filepath); if (reader.getFormatVersion() > ESM::CurrentSaveGameFormatVersion) - throw std::runtime_error( + throw VersionMismatchError( "This save file was created using a newer version of OpenMW and is thus not supported. Please upgrade " "to the newest OpenMW version to load this file."); @@ -411,7 +418,7 @@ void MWState::StateManager::loadGame(const Character* character, const std::file Loading::Listener& listener = *MWBase::Environment::get().getWindowManager()->getLoadingScreen(); listener.setProgressRange(100); - listener.setLabel("#{sLoadingMessage14}"); + listener.setLabel("#{OMWEngine:LoadingInProgress}"); Loading::ScopedLoad load(&listener); @@ -584,17 +591,22 @@ void MWState::StateManager::loadGame(const Character* character, const std::file } catch (const std::exception& e) { - std::stringstream error; - error << "Failed to load saved game: " << e.what(); + Log(Debug::Error) << "Failed to load saved game: " << e.what(); - Log(Debug::Error) << error.str(); cleanup(true); MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_MainMenu); std::vector buttons; - buttons.emplace_back("#{sOk}"); - MWBase::Environment::get().getWindowManager()->interactiveMessageBox(error.str(), buttons); + buttons.emplace_back("#{Interface:OK}"); + + std::string error; + if (typeid(e) == typeid(VersionMismatchError)) + error = "#{OMWEngine:LoadingFailed}: #{OMWEngine:LoadingRequiresNewVersionError}"; + else + error = "#{OMWEngine:LoadingFailed}: " + std::string(e.what()); + + MWBase::Environment::get().getWindowManager()->interactiveMessageBox(error, buttons); } } @@ -669,9 +681,10 @@ bool MWState::StateManager::verifyProfile(const ESM::SavedGame& profile) const if (notFound) { std::vector buttons; - buttons.emplace_back("#{sYes}"); - buttons.emplace_back("#{sNo}"); - MWBase::Environment::get().getWindowManager()->interactiveMessageBox("#{sMissingMastersMsg}", buttons, true); + buttons.emplace_back("#{Interface:Yes}"); + buttons.emplace_back("#{Interface:No}"); + MWBase::Environment::get().getWindowManager()->interactiveMessageBox( + "#{OMWEngine:MissingContentFilesConfirmation}", buttons, true); int selectedButton = MWBase::Environment::get().getWindowManager()->readPressedButton(); if (selectedButton == 1 || selectedButton == -1) return false; diff --git a/apps/openmw/mwworld/datetimemanager.cpp b/apps/openmw/mwworld/datetimemanager.cpp index 51113f0d5c..2a347bd5ad 100644 --- a/apps/openmw/mwworld/datetimemanager.cpp +++ b/apps/openmw/mwworld/datetimemanager.cpp @@ -1,5 +1,7 @@ #include "datetimemanager.hpp" +#include + #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" @@ -152,22 +154,28 @@ namespace MWWorld globalVariables[Globals::sYear].setInteger(mYear); } + static std::vector getMonthNames() + { + auto calendarL10n = MWBase::Environment::get().getL10nManager()->getContext("Calendar"); + std::string prefix = "month"; + std::vector months; + int count = 12; + months.reserve(count); + for (int i = 1; i <= count; ++i) + months.push_back(calendarL10n->formatMessage(prefix + std::to_string(i), {}, {})); + return months; + } + std::string_view DateTimeManager::getMonthName(int month) const { + static std::vector months = getMonthNames(); + if (month == -1) month = mMonth; - - const int months = 12; - if (month < 0 || month >= months) + if (month < 0 || month >= static_cast(months.size())) return {}; - - static const std::string_view monthNames[months] = { "sMonthMorningstar", "sMonthSunsdawn", "sMonthFirstseed", - "sMonthRainshand", "sMonthSecondseed", "sMonthMidyear", "sMonthSunsheight", "sMonthLastseed", - "sMonthHeartfire", "sMonthFrostfall", "sMonthSunsdusk", "sMonthEveningstar" }; - - const ESM::GameSetting* setting - = MWBase::Environment::get().getWorld()->getStore().get().find(monthNames[month]); - return setting->mValue.getString(); + else + return months[month]; } bool DateTimeManager::updateGlobalFloat(GlobalVariableName name, float value) diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 754defc271..ae830f88a4 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -592,8 +592,7 @@ namespace MWWorld Loading::Listener* loadingListener = MWBase::Environment::get().getWindowManager()->getLoadingScreen(); Loading::ScopedLoad load(loadingListener); - std::string loadingExteriorText = "#{sLoadingMessage3}"; - loadingListener->setLabel(loadingExteriorText); + loadingListener->setLabel("#{OMWEngine:LoadingExterior}"); loadingListener->setProgressRange(refsToLoad); const auto getDistanceToPlayerCell = [&](const std::pair& cellPosition) { @@ -862,8 +861,7 @@ namespace MWWorld MWBase::Environment::get().getWindowManager()->fadeScreenOut(0.5); Loading::Listener* loadingListener = MWBase::Environment::get().getWindowManager()->getLoadingScreen(); - std::string loadingInteriorText = "#{sLoadingMessage2}"; - loadingListener->setLabel(loadingInteriorText); + loadingListener->setLabel("#{OMWEngine:LoadingInterior}"); Loading::ScopedLoad load(loadingListener); if (mCurrentCell != nullptr && *mCurrentCell == *cell) @@ -1222,7 +1220,7 @@ namespace MWWorld Loading::Listener* loadingListener = MWBase::Environment::get().getWindowManager()->getLoadingScreen(); Loading::ScopedLoad load(loadingListener); - loadingListener->setLabel("#{sLoadingMessage4}"); + loadingListener->setLabel("#{OMWEngine:InitializingData}"); while (!mPreloader->syncTerrainLoad(vec, mRendering.getReferenceTime(), *loadingListener)) { diff --git a/components/fx/widgets.cpp b/components/fx/widgets.cpp index 09482f24e1..f8d12fdba3 100644 --- a/components/fx/widgets.cpp +++ b/components/fx/widgets.cpp @@ -33,7 +33,7 @@ namespace fx if (!uniform) return; - mCheckbutton->setCaptionWithReplacing(value ? "#{sOn}" : "#{sOff}"); + mCheckbutton->setCaptionWithReplacing(value ? "#{Interface:On}" : "#{Interface:Off}"); mFill->setVisible(value); uniform->setValue(value); diff --git a/components/l10n/manager.hpp b/components/l10n/manager.hpp index 272009b68e..ca2ebecebf 100644 --- a/components/l10n/manager.hpp +++ b/components/l10n/manager.hpp @@ -29,6 +29,11 @@ namespace l10n std::shared_ptr getContext( const std::string& contextName, const std::string& fallbackLocale = "en"); + std::string getMessage(const std::string& contextName, std::string_view key) + { + return getContext(contextName)->formatMessage(key, {}, {}); + } + private: void readLangData(const std::string& name, MessageBundles& ctx, const icu::Locale& lang); void updateContext(const std::string& name, MessageBundles& ctx); diff --git a/files/data-mw/l10n/Calendar/de.yaml b/files/data-mw/l10n/Calendar/de.yaml index 794ced965d..b3ee621402 100644 --- a/files/data-mw/l10n/Calendar/de.yaml +++ b/files/data-mw/l10n/Calendar/de.yaml @@ -28,7 +28,7 @@ monthInGenitive10: "Eisherbst" monthInGenitive11: "Abenddämmerung" monthInGenitive12: "Abendstern" -dateFormat: "tag {day} im {monthInGenitive} {year}" +dateFormat: "tag {day} im {monthInGenitive} {year, number, :: group-off}" weekday1: "Sundas" weekday2: "Morndas" diff --git a/files/data-mw/l10n/Calendar/en.yaml b/files/data-mw/l10n/Calendar/en.yaml index 0b009f4c57..b8c850281c 100644 --- a/files/data-mw/l10n/Calendar/en.yaml +++ b/files/data-mw/l10n/Calendar/en.yaml @@ -28,7 +28,7 @@ monthInGenitive10: "Frostfall" monthInGenitive11: "Sun's Dusk" monthInGenitive12: "Evening Star" -dateFormat: "day {day} of {monthInGenitive} {year}" +dateFormat: "day {day} of {monthInGenitive} {year, number, :: group-off}" weekday1: "Sundas" weekday2: "Morndas" diff --git a/files/data-mw/l10n/Calendar/fr.yaml b/files/data-mw/l10n/Calendar/fr.yaml index e9d4e105a1..537e806d83 100644 --- a/files/data-mw/l10n/Calendar/fr.yaml +++ b/files/data-mw/l10n/Calendar/fr.yaml @@ -31,7 +31,7 @@ monthInGenitive10: "Soufflegivre" monthInGenitive11: "Sombreciel" monthInGenitive12: "Soirétoile" -dateFormat: "Le {day} du {monthInGenitive} {year}" +dateFormat: "Le {day} du {monthInGenitive} {year, number, :: group-off}" weekday1: "Sundas" weekday2: "Morndas" diff --git a/files/data-mw/l10n/Calendar/gmst.yaml b/files/data-mw/l10n/Calendar/gmst.yaml new file mode 100644 index 0000000000..0c14325eee --- /dev/null +++ b/files/data-mw/l10n/Calendar/gmst.yaml @@ -0,0 +1,16 @@ +month1: "sMonthMorningstar" +month2: "sMonthSunsdawn" +month3: "sMonthFirstseed" +month4: "sMonthRainshand" +month5: "sMonthSecondseed" +month6: "sMonthMidyear" +month7: "sMonthSunsheight" +month8: "sMonthLastseed" +month9: "sMonthHeartfire" +month10: "sMonthFrostfall" +month11: "sMonthSunsdusk" +month12: "sMonthEveningstar" + +am: "sSaveMenuHelp04" +pm: "sSaveMenuHelp05" +day: "sDay" diff --git a/files/data-mw/l10n/Calendar/ru.yaml b/files/data-mw/l10n/Calendar/ru.yaml index 880ed67f58..95828e1e6b 100644 --- a/files/data-mw/l10n/Calendar/ru.yaml +++ b/files/data-mw/l10n/Calendar/ru.yaml @@ -29,7 +29,7 @@ monthInGenitive10: "Мороза" monthInGenitive11: "Заката" monthInGenitive12: "Вечерней Звезды" -dateFormat: "день {day} {monthInGenitive} {year}" +dateFormat: "день {day} {monthInGenitive} {year, number, :: group-off}" weekday1: "Сандас" weekday2: "Морндас" diff --git a/files/data-mw/l10n/Calendar/sv.yaml b/files/data-mw/l10n/Calendar/sv.yaml index cbd49bbbc6..7aecb93455 100644 --- a/files/data-mw/l10n/Calendar/sv.yaml +++ b/files/data-mw/l10n/Calendar/sv.yaml @@ -4,4 +4,4 @@ # En: No use translating names on months and weekdays to Swedish when the game's content isn't in Swedish. It will probably just confuse people. Therefore, only dateFormat is present in this file. -dateFormat: "dag {day} av {monthInGenitive} år {year}" +dateFormat: "dag {day} av {monthInGenitive} år {year, number, :: group-off}" diff --git a/files/data-mw/l10n/Interface/gmst.yaml b/files/data-mw/l10n/Interface/gmst.yaml index 0420243ba7..f40a7ee943 100644 --- a/files/data-mw/l10n/Interface/gmst.yaml +++ b/files/data-mw/l10n/Interface/gmst.yaml @@ -1,6 +1,9 @@ -On: "sOn" -Off: "sOff" +Cancel: "sCancel" +Close: "sClose" +No: "sNo" None: "sNone" OK: "sOK" +Off: "sOff" +On: "sOn" Yes: "sYes" -No: "sNo" + diff --git a/files/data-mw/l10n/OMWEngine/gmst.yaml b/files/data-mw/l10n/OMWEngine/gmst.yaml index 50181aedd6..6971e17c76 100644 --- a/files/data-mw/l10n/OMWEngine/gmst.yaml +++ b/files/data-mw/l10n/OMWEngine/gmst.yaml @@ -1,4 +1,56 @@ +AskLoadLastSave: "sLoadLastSaveMsg" +AudioEffects: "sEffects" +AudioFootsteps: "sFootsteps" +AudioMaster: "sMaster" +AudioMusic: "sMusic" +Audio: "sAudio" +AudioVoice: "sVoice" ConfirmResetBindings: "sNotifyMessage66" ConfirmResolution: "sNotifyMessage67" +ConsoleWindow: "sConsoleTitle" +Controls: "sControls" +DelayHigh: "sSlow" +DelayLow: "sFast" +DeleteGameConfirmation: "sMessage3" +DeleteGame: "sDeleteGame" +DetailLevel: "sDetail_Level" +DifficultyEasy: "sEasy" +DifficultyHard: "sHard" +Difficulty: "sDifficulty" +DistanceHigh: "sFar" +DistanceLow: "sNear" +EmptySaveNameError: "sNotifyMessage65" +EnableController: "sEnableJoystick" +FieldOfViewHigh: "sHigh" +FieldOfViewLow: "sLow" +GammaCorrection: "sGamma_Correction" +GammaDark: "sDark_Gamma" +GammaLight: "sLight_Gamma" +InitializingData: "sLoadingMessage4" +InvertYAxis: "sMouseFlip" +LoadGameConfirmation: "sMessage1" +LoadingExterior: "sLoadingMessage3" +LoadingInProgress: "sLoadingMessage12" +LoadingInterior: "sLoadingMessage2" +MenuHelpDelay: "sMenu_Help_Delay" +MenuTransparency: "sTransparency_Menu" +MissingContentFilesConfirmation: "sMissingMastersMsg" +NewGameConfirmation: "sNotifyMessage54" +OverwriteGameConfirmation: "sMessage4" +Preferences: "sPrefs" +QualityHigh: "sHigh" +QualityLow: "sLow" +QualityMedium: "sMedium" +QuitGameConfirmation: "sMessage2" RebindAction: "sControlsMenu3" +ResetControls: "sControlsMenu1" +SaveGameDenied: "sSaveGameDenied" +SavingInProgress: "sNotifyMessage4" +SensitivityHigh: "sHigh" +SensitivityLow: "sLow" SettingsWindow: "sOptions" +Subtitles: "sSubtitles" +TransparencyFull: "sFull" +TransparencyNone: "sNone" +Video: "sVideo" +ViewDistance: "sRender_Distance" diff --git a/files/data/l10n/Calendar/en.yaml b/files/data/l10n/Calendar/en.yaml index 912b980d01..6fd9c070bd 100644 --- a/files/data/l10n/Calendar/en.yaml +++ b/files/data/l10n/Calendar/en.yaml @@ -26,7 +26,7 @@ monthInGenitive10: "October" monthInGenitive11: "November" monthInGenitive12: "December" -dateFormat: "day {day} of {monthInGenitive} {year}" +dateFormat: "{day} {monthInGenitive} {year, number, :: group-off}" weekday1: "Sunday" weekday2: "Monday" @@ -35,3 +35,7 @@ weekday4: "Wednesday" weekday5: "Thursday" weekday6: "Friday" weekday7: "Saturday" + +am: "am" +pm: "pm" +day: "day" diff --git a/files/data/l10n/Interface/de.yaml b/files/data/l10n/Interface/de.yaml index 47780b25c7..1cabad01a9 100644 --- a/files/data/l10n/Interface/de.yaml +++ b/files/data/l10n/Interface/de.yaml @@ -2,3 +2,26 @@ No: "Nein" NotAvailableShort: "N/A" Reset: "Zurücksetzen" Yes: "Ja" + +# To be translated: + +#DurationDay: "{days} d " +#DurationHour: "{hours} h " +#DurationMinute: "{minutes} min " +#DurationMonth: |- +# {months, plural, +# one{{months} mo } +# other{{months} mos } +# } +#DurationSecond: "{seconds} s " +#DurationYear: |- +# {years, plural, +# one{{years} yr } +# other{{years} yrs } +# } +#Cancel: "Cancel" +#Close: "Close" +#None: "None" +#OK: "OK" +#Off: "Off" +#On: "On" diff --git a/files/data/l10n/Interface/en.yaml b/files/data/l10n/Interface/en.yaml index 45c2dcaeea..df450b5c38 100644 --- a/files/data/l10n/Interface/en.yaml +++ b/files/data/l10n/Interface/en.yaml @@ -20,4 +20,5 @@ On: "On" Off: "Off" None: "None" OK: "OK" - +Cancel: "Cancel" +Close: "Close" diff --git a/files/data/l10n/Interface/fr.yaml b/files/data/l10n/Interface/fr.yaml index eb4a4879f8..25c90d9896 100644 --- a/files/data/l10n/Interface/fr.yaml +++ b/files/data/l10n/Interface/fr.yaml @@ -16,3 +16,12 @@ No: "Non" NotAvailableShort: "N/A" Reset: "Réinitialiser" Yes: "Oui" + +# To be translated: + +#Cancel: "Cancel" +#Close: "Close" +#None: "None" +#OK: "OK" +#Off: "Off" +#On: "On" diff --git a/files/data/l10n/Interface/ru.yaml b/files/data/l10n/Interface/ru.yaml index ec5c5b393f..6d81dd7797 100644 --- a/files/data/l10n/Interface/ru.yaml +++ b/files/data/l10n/Interface/ru.yaml @@ -1,3 +1,5 @@ +Cancel: "Отмена" +Close: "Закрыть" DurationDay: "{days} д " DurationHour: "{hours} ч " DurationMinute: "{minutes} мин " @@ -11,5 +13,9 @@ DurationYear: |- } No: "Нет" NotAvailableShort: "Н/Д" -Reset: "Обнулить" +None: "Нет" +OK: "OK" +Off: "Выкл" +On: "Вкл" +Reset: "Сбросить" Yes: "Да" diff --git a/files/data/l10n/Interface/sv.yaml b/files/data/l10n/Interface/sv.yaml index aad4d74015..3dc5b91f63 100644 --- a/files/data/l10n/Interface/sv.yaml +++ b/files/data/l10n/Interface/sv.yaml @@ -8,3 +8,12 @@ No: "Nej" NotAvailableShort: "N/A" Reset: "Återställ" Yes: "Ja" + +# To be translated: + +#Cancel: "Cancel" +#Close: "Close" +#None: "None" +#OK: "OK" +#Off: "Off" +#On: "On" diff --git a/files/data/l10n/OMWEngine/de.yaml b/files/data/l10n/OMWEngine/de.yaml index 6b9018b5a6..11e6c401f4 100644 --- a/files/data/l10n/OMWEngine/de.yaml +++ b/files/data/l10n/OMWEngine/de.yaml @@ -1,3 +1,8 @@ +# Console + +#-- To be translated +#ConsoleWindow: "Console" + # Debug window DebugWindow: "Debug" @@ -10,12 +15,38 @@ PhysicsProfiler: "Physik-Profiler" BuildingNavigationMesh: "Baue Navigationsgitter" +#-- To be translated +#AskLoadLastSave: "The most recent save is '%s'. Do you want to load it?" +#InitializingData: "Initializing Data..." +#LoadingExterior: "Loading Area" +#LoadingFailed: "Failed to load saved game" +#LoadingInterior: "Loading Area" +#LoadingInProgress: "Loading Save Game" +#LoadingRequiresNewVersionError: |- +# This save file was created using a newer version of OpenMW and is thus not supported. +# Please upgrade to the newest OpenMW version to load this file. +#NewGameConfirmation: "Do you want to start a new game and lose the current one?" +#SaveGameDenied: "The game cannot be saved right now." +#SavingInProgress: "Saving..." +#QuitGameConfirmation: "Quit the game?" + # Save game menu SelectCharacter: "Charakterauswahl..." TimePlayed: "Spielzeit" +#-- To be translated +#DeleteGame: "Delete Game" +#DeleteGameConfirmation: "Are you sure you want to delete this saved game?" +#EmptySaveNameError: "Game can not be saved without a name!" +#LoadGameConfirmation: "Do you want to load a saved game and lose the current one?" +#MissingContentFilesConfirmation: | +# The currently selected content files do not match the ones used by this save game. +# Errors may occur during load or game play. +# Do you wish to continue? +#OverwriteGameConfirmation: "Are you sure you want to overwrite this saved game?" + # Settings menu @@ -84,3 +115,45 @@ WindowMode: "Fenstermodus" WindowModeFullscreen: "Vollbild" WindowModeWindowed: "Fenster" WindowModeWindowedFullscreen: "Fenster Vollbild" + +#-- To be translated +#Audio: "Audio" +#AudioMaster: "Master" +#AudioVoice: "Voice" +#AudioEffects: "Effects" +#AudioFootsteps: "Footsteps" +#AudioMusic: "Music" +#ConfirmResetBindings: "Reset all controls to the default?" +#ConfirmResolution: "New resolution will be applied immediately. Do you want to continue?" +#Controls: "Controls" +#DelayLow: "Fast" +#DelayHigh: "Slow" +#DetailLevel: "Detail Level" +#Difficulty: "Difficulty" +#DifficultyEasy: "Easy" +#DifficultyHard: "Hard" +#DistanceHigh: "Far" +#DistanceLow: "Near" +#EnableController: "Enable Controller" +#FieldOfViewLow: "Low" +#FieldOfViewHigh: "High" +#GammaCorrection: "Gamma Correction" +#GammaDark: "Dark" +#GammaLight: "Light" +#InvertYAxis: "Invert Y Axis" +#MenuHelpDelay: "Menu Help Delay" +#MenuTransparency: "Menu Transparency" +#Preferences: "Prefs" +#QualityHigh: "High" +#QualityLow: "Low" +#QualityMedium: "Medium" +#RebindAction: "Press a key or button to rebind this control." +#ResetControls: "Reset Controls" +#SensitivityHigh: "High" +#SensitivityLow: "Low" +#SettingsWindow: "Options" +#Subtitles: "Subtitles" +#TransparencyFull: "Full" +#TransparencyNone: "None" +#Video: "Video" +#ViewDistance: "View Distance" diff --git a/files/data/l10n/OMWEngine/en.yaml b/files/data/l10n/OMWEngine/en.yaml index 5ef7d0c052..9098f84af7 100644 --- a/files/data/l10n/OMWEngine/en.yaml +++ b/files/data/l10n/OMWEngine/en.yaml @@ -1,3 +1,7 @@ +# Console + +ConsoleWindow: "Console" + # Debug window DebugWindow: "Debug" @@ -8,11 +12,33 @@ PhysicsProfiler: "Physics Profiler" # Messages +AskLoadLastSave: "The most recent save is '%s'. Do you want to load it?" BuildingNavigationMesh: "Building navigation mesh" +InitializingData: "Initializing Data..." +LoadingExterior: "Loading Area" +LoadingFailed: "Failed to load saved game" +LoadingInterior: "Loading Area" +LoadingInProgress: "Loading Save Game" +LoadingRequiresNewVersionError: |- + This save file was created using a newer version of OpenMW and is thus not supported. + Please upgrade to the newest OpenMW version to load this file. +NewGameConfirmation: "Do you want to start a new game and lose the current one?" +SaveGameDenied: "The game cannot be saved right now." +SavingInProgress: "Saving..." +QuitGameConfirmation: "Quit the game?" # Save game menu +DeleteGame: "Delete Game" +DeleteGameConfirmation: "Are you sure you want to delete this saved game?" +EmptySaveNameError: "Game can not be saved without a name!" +LoadGameConfirmation: "Do you want to load a saved game and lose the current one?" +MissingContentFilesConfirmation: | + The currently selected content files do not match the ones used by this save game. + Errors may occur during load or game play. + Do you wish to continue? +OverwriteGameConfirmation: "Are you sure you want to overwrite this saved game?" SelectCharacter: "Select Character..." TimePlayed: "Time played" @@ -21,6 +47,12 @@ TimePlayed: "Time played" ActorsProcessingRange: "Actors Processing Range" Anisotropy: "Anisotropy" +Audio: "Audio" +AudioEffects: "Effects" +AudioFootsteps: "Footsteps" +AudioMaster: "Master" +AudioMusic: "Music" +AudioVoice: "Voice" CameraSensitivity: "Camera Sensitivity" CameraZoomIn: "Zoom Camera In" CameraZoomOut: "Zoom Camera Out" @@ -28,9 +60,25 @@ ChangeRequiresRestart: "This change requires a restart to take effect." ConfirmResetBindings: "Reset all controls to the default?" ConfirmResolution: "New resolution will be applied immediately. Do you want to continue?" Controller: "Controller" +Controls: "Controls" +DelayLow: "Fast" +DelayHigh: "Slow" +DetailLevel: "Detail Level" +Difficulty: "Difficulty" +DifficultyEasy: "Easy" +DifficultyHard: "Hard" +DistanceHigh: "Far" +DistanceLow: "Near" +EnableController: "Enable Controller" FieldOfView: "Field of View" +FieldOfViewHigh: "High" +FieldOfViewLow: "Low" FrameRateHint: "Hint: press F3 to show\nthe current frame rate." +GammaCorrection: "Gamma Correction" +GammaDark: "Dark" +GammaLight: "Light" InvertXAxis: "Invert X Axis" +InvertYAxis: "Invert Y Axis" Language: "Language" LanguageNote: "Note: these settings do not affect strings from ESM files." LightingMethod: "Lighting Method" @@ -49,11 +97,17 @@ 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." +MenuHelpDelay: "Menu Help Delay" +MenuTransparency: "Menu Transparency" MouseAndKeyboard: "Mouse/Keyboard" PostProcessing: "Post Processing" PostProcessingTooltip: "Tweaked via Post Processor HUD, see input bindings." +Preferences: "Prefs" PrimaryLanguage: "Primary Language" PrimaryLanguageTooltip: "Localization files for this language have the highest priority." +QualityHigh: "High" +QualityLow: "Low" +QualityMedium: "Medium" RainRippleDetail: "Rain ripple detail" RainRippleDetailDense: "Dense" RainRippleDetailSimple: "Simple" @@ -67,12 +121,16 @@ ReflectionShaderDetailSky: "Sky" ReflectionShaderDetailTerrain: "Terrain" ReflectionShaderDetailWorld: "World" Refraction: "Refraction" +ResetControls: "Reset Controls" Screenshot: "Screenshot" Scripts: "Scripts" ScriptsDisabled: "Load a game to access script settings." SecondaryLanguage: "Secondary Language" SecondaryLanguageTooltip: "Localization files for this language may be used if the primary language files lack the necessary lines." +SensitivityHigh: "High" +SensitivityLow: "Low" SettingsWindow: "Options" +Subtitles: "Subtitles" TextureFiltering: "Texture Filtering" TextureFilteringBilinear: "Bilinear" TextureFilteringDisabled: "None" @@ -80,6 +138,10 @@ TextureFilteringOther: "Other" TextureFilteringTrilinear: "Trilinear" ToggleHUD: "Toggle HUD" TogglePostProcessorHUD: "Toggle Post Processor HUD" +TransparencyFull: "Full" +TransparencyNone: "None" +Video: "Video" +ViewDistance: "View Distance" VSync: "VSync" VSyncAdaptive: "Adaptive" Water: "Water" diff --git a/files/data/l10n/OMWEngine/fr.yaml b/files/data/l10n/OMWEngine/fr.yaml index b2f4197a64..ce574b2208 100644 --- a/files/data/l10n/OMWEngine/fr.yaml +++ b/files/data/l10n/OMWEngine/fr.yaml @@ -1,3 +1,9 @@ +# Console + +#-- To be translated +#ConsoleWindow: "Console" + + # Debug window DebugWindow: "Fenêtre de débogage" @@ -9,12 +15,38 @@ PhysicsProfiler: "Profileur des performances de la physique" BuildingNavigationMesh: "Construction du mesh de navigation" +#-- To be translated +#AskLoadLastSave: "The most recent save is '%s'. Do you want to load it?" +#InitializingData: "Initializing Data..." +#LoadingExterior: "Loading Area" +#LoadingFailed: "Failed to load saved game" +#LoadingInterior: "Loading Area" +#LoadingInProgress: "Loading Save Game" +#LoadingRequiresNewVersionError: |- +# This save file was created using a newer version of OpenMW and is thus not supported. +# Please upgrade to the newest OpenMW version to load this file. +#NewGameConfirmation: "Do you want to start a new game and lose the current one?" +#SaveGameDenied: "The game cannot be saved right now." +#SavingInProgress: "Saving..." +#QuitGameConfirmation: "Quit the game?" + # Save game menu SelectCharacter: "Sélection du personnage..." TimePlayed: "Temps de jeu" +#-- To be translated +#DeleteGame: "Delete Game" +#DeleteGameConfirmation: "Are you sure you want to delete this saved game?" +#EmptySaveNameError: "Game can not be saved without a name!" +#LoadGameConfirmation: "Do you want to load a saved game and lose the current one?" +#MissingContentFilesConfirmation: | +# The currently selected content files do not match the ones used by this save game. +# Errors may occur during load or game play. +# Do you wish to continue? +#OverwriteGameConfirmation: "Are you sure you want to overwrite this saved game?" + # Settings menu @@ -84,3 +116,45 @@ WindowMode: "Mode d'affichage" WindowModeFullscreen: "Plein écran" WindowModeWindowed: "Fenêtré" WindowModeWindowedFullscreen: "Fenêtré plein écran" + +#-- To be translated +#Audio: "Audio" +#AudioMaster: "Master" +#AudioVoice: "Voice" +#AudioEffects: "Effects" +#AudioFootsteps: "Footsteps" +#AudioMusic: "Music" +#ConfirmResetBindings: "Reset all controls to the default?" +#ConfirmResolution: "New resolution will be applied immediately. Do you want to continue?" +#Controls: "Controls" +#DelayLow: "Fast" +#DelayHigh: "Slow" +#DetailLevel: "Detail Level" +#Difficulty: "Difficulty" +#DifficultyEasy: "Easy" +#DifficultyHard: "Hard" +#DistanceHigh: "Far" +#DistanceLow: "Near" +#EnableController: "Enable Controller" +#FieldOfViewLow: "Low" +#FieldOfViewHigh: "High" +#GammaCorrection: "Gamma Correction" +#GammaDark: "Dark" +#GammaLight: "Light" +#InvertYAxis: "Invert Y Axis" +#MenuHelpDelay: "Menu Help Delay" +#MenuTransparency: "Menu Transparency" +#Preferences: "Prefs" +#QualityHigh: "High" +#QualityLow: "Low" +#QualityMedium: "Medium" +#RebindAction: "Press a key or button to rebind this control." +#ResetControls: "Reset Controls" +#SensitivityHigh: "High" +#SensitivityLow: "Low" +#SettingsWindow: "Options" +#Subtitles: "Subtitles" +#TransparencyFull: "Full" +#TransparencyNone: "None" +#Video: "Video" +#ViewDistance: "View Distance" diff --git a/files/data/l10n/OMWEngine/ru.yaml b/files/data/l10n/OMWEngine/ru.yaml index 11e93dd031..a89d7a01b9 100644 --- a/files/data/l10n/OMWEngine/ru.yaml +++ b/files/data/l10n/OMWEngine/ru.yaml @@ -1,3 +1,7 @@ +# Console + +ConsoleWindow: "Консоль" + # Debug window DebugWindow: "Меню отладки" @@ -8,11 +12,33 @@ PhysicsProfiler: "Профилировщик физики" # Messages +AskLoadLastSave: "Последнее сохранение - '%s'. Загрузить?" BuildingNavigationMesh: "Построение навигационной сетки" +InitializingData: "Загрузка..." +LoadingExterior: "Загрузка области" +LoadingFailed: "Не удалось загрузить сохраненную игру" +LoadingInterior: "Загрузка области" +LoadingInProgress: "Загрузка сохранения" +LoadingRequiresNewVersionError: |- + Это сохранение создано более новой версией OpenMW и поэтому не может быть загружено. + Обновите OpenMW до последней версии, чтобы загрузить этот файл. +NewGameConfirmation: "Вы хотите начать новую игру? Текущая игра будет потеряна." +SaveGameDenied: "В данный момент игру нельзя сохранить." +SavingInProgress: "Сохранение..." +QuitGameConfirmation: "Выйти из игры?" # Save game menu +DeleteGame: "Удалить игру" +DeleteGameConfirmation: "Вы уверены, что хотите удалить это сохранение?" +EmptySaveNameError: "Имя сохранения не может быть пустым!" +LoadGameConfirmation: "Вы хотите загрузить сохранение? Текущая игра будет потеряна." +MissingContentFilesConfirmation: | + Выбранные ESM/ESP файлы не соответствуют тем, которые использовались для этого сохранения. + Во время загрузки или в процессе игры могут возникнуть ошибки. + Вы хотите продолжить? +OverwriteGameConfirmation: "Вы уверены, что хотите перезаписать это сохранение?" SelectCharacter: "Выберите персонажа..." TimePlayed: "Время в игре" @@ -21,14 +47,38 @@ TimePlayed: "Время в игре" ActorsProcessingRange: "Дальность обработки персонажей" Anisotropy: "Анизотропная фильтрация" +Audio: "Звук" +AudioEffects: "Эффекты" +AudioFootsteps: "Шаги" +AudioMaster: "Общая громкость" +AudioMusic: "Музыка" +AudioVoice: "Голос" CameraSensitivity: "Чувствительность камеры" CameraZoomIn: "Приблизить камеру" CameraZoomOut: "Отдалить камеру" ChangeRequiresRestart: "Чтобы это изменение вступило в силу, нужно перезапустить приложение." +ConfirmResetBindings: "Сбросить все настройки управления?" +ConfirmResolution: "Разрешение будет изменено немедленно. Продолжить?" Controller: "Геймпад" +Controls: "Управление" +DelayLow: "Маленькая" +DelayHigh: "Большая" +DetailLevel: "Уровень детализации" +Difficulty: "Сложность" +DifficultyEasy: "Легко" +DifficultyHard: "Сложно" +DistanceHigh: "Далеко" +DistanceLow: "Близко" +EnableController: "Геймпад" FieldOfView: "Поле зрения" +FieldOfViewLow: "Маленькое" +FieldOfViewHigh: "Большое" FrameRateHint: "Подсказка: нажмите F3, чтобы показать\nтекущую частоту смены кадров." +GammaCorrection: "Гамма-коррекция" +GammaDark: "Темно" +GammaLight: "Светло" InvertXAxis: "Инвертировать ось X" +InvertYAxis: "Инвертировать ось Y" Language: "Язык" LanguageNote: "Примечание: эти настройки не затрагивают строки из ESM-файлов." LightingMethod: "Способ освещения" @@ -47,11 +97,17 @@ LightsMinimumInteriorBrightness: "Минимальный уровень осве LightsMinimumInteriorBrightnessTooltip: "Значение по умолчанию: 0.08\nМинимальный уровень фонового освещения в помещениях.\n\nУвеличьте значение, если помещения в игре кажутся слишком темными." MaxLights: "Макс. кол-во источников света" MaxLightsTooltip: "Значение по умолчанию: 8\nМаксимальное количество источников света для каждого объекта.\n\nНизкие числа (близкие к значению по умолчанию) приводят к резким перепадам освещения, как при устаревшем методе освещения." +MenuHelpDelay: "Задержка всплывающих подсказок" +MenuTransparency: "Прозрачность меню" MouseAndKeyboard: "Мышь/Клавиатура" PostProcessing: "Постобработка" PostProcessingTooltip: "Настраивается через меню настроек постобработки, см. привязки клавиш." +Preferences: "Настройки" PrimaryLanguage: "Основной язык" PrimaryLanguageTooltip: "Язык, строки на котором будут использоваться в первую очередь." +QualityHigh: "Высокое" +QualityLow: "Низкое" +QualityMedium: "Среднее" RainRippleDetail: "Капли дождя на воде" RainRippleDetailDense: "Плотные" RainRippleDetailSimple: "Упрощенные" @@ -64,18 +120,28 @@ ReflectionShaderDetailSky: "Небо" ReflectionShaderDetailTerrain: "Ландшафт" ReflectionShaderDetailWorld: "Мир" Refraction: "Рефракция" +RebindAction: "Нажмите клавишу, которую нужно назначить на это действие." +ResetControls: "Сбросить" Screenshot: "Снимок экрана" Scripts: "Скрипты" ScriptsDisabled: "Загрузите игру, чтобы получить доступ к настройкам скриптов." SecondaryLanguage: "Дополнительный язык" SecondaryLanguageTooltip: "Язык, строки на котором будут использоваться, если соответствующие строки на основном языке не найдены." +SensitivityHigh: "Высокая" +SensitivityLow: "Низкая" +SettingsWindow: "Настройки" +Subtitles: "Субтитры" TextureFiltering: "Фильтрация текстур" TextureFilteringBilinear: "Билинейная" TextureFilteringDisabled: "Отключена" TextureFilteringOther: "Другая" TextureFilteringTrilinear: "Трилинейная" +TransparencyFull: "Прозрачное" +TransparencyNone: "Непрозрачное" ToggleHUD: "Переключить HUD" TogglePostProcessorHUD: "Меню настроек постобработки" +ViewDistance: "Дальность обзора" +Video: "Видео" VSync: "Вертикальная синхронизация" VSyncAdaptive: "Адаптивная" Water: "Вода" diff --git a/files/data/l10n/OMWEngine/sv.yaml b/files/data/l10n/OMWEngine/sv.yaml index 704d1f719b..85d83ada70 100644 --- a/files/data/l10n/OMWEngine/sv.yaml +++ b/files/data/l10n/OMWEngine/sv.yaml @@ -1,3 +1,9 @@ +# Console + +#-- To be translated +#ConsoleWindow: "Console" + + # Debug window DebugWindow: "Felsökning" @@ -9,6 +15,21 @@ PhysicsProfiler: "Fysikprofilerare" BuildingNavigationMesh: "Bygger navigeringsmesh" +#-- To be translated +#AskLoadLastSave: "The most recent save is '%s'. Do you want to load it?" +#InitializingData: "Initializing Data..." +#LoadingExterior: "Loading Area" +#LoadingFailed: "Failed to load saved game" +#LoadingInterior: "Loading Area" +#LoadingInProgress: "Loading Save Game" +#LoadingRequiresNewVersionError: |- +# This save file was created using a newer version of OpenMW and is thus not supported. +# Please upgrade to the newest OpenMW version to load this file. +#NewGameConfirmation: "Do you want to start a new game and lose the current one?" +#SaveGameDenied: "The game cannot be saved right now." +#SavingInProgress: "Saving..." +#QuitGameConfirmation: "Quit the game?" + # Save game menu @@ -16,6 +37,18 @@ SelectCharacter: "Välj spelfigur..." TimePlayed: "Speltid" +#-- To be translated +#DeleteGame: "Delete Game" +#DeleteGameConfirmation: "Are you sure you want to delete this saved game?" +#EmptySaveNameError: "Game can not be saved without a name!" +#LoadGameConfirmation: "Do you want to load a saved game and lose the current one?" +#MissingContentFilesConfirmation: | +# The currently selected content files do not match the ones used by this save game. +# Errors may occur during load or game play. +# Do you wish to continue? +#OverwriteGameConfirmation: "Are you sure you want to overwrite this saved game?" + + # Settings menu ActorsProcessingRange: "Processavstånd för figurer" @@ -86,3 +119,44 @@ WindowModeHint: "Notera: Fullskärm i fönsterläge\nanvänder alltid skärmens WindowModeWindowed: "Fönster" WindowModeWindowedFullscreen: "Fullskärm i fönsterläge" +#-- To be translated +#Audio: "Audio" +#AudioMaster: "Master" +#AudioVoice: "Voice" +#AudioEffects: "Effects" +#AudioFootsteps: "Footsteps" +#AudioMusic: "Music" +#ConfirmResetBindings: "Reset all controls to the default?" +#ConfirmResolution: "New resolution will be applied immediately. Do you want to continue?" +#Controls: "Controls" +#DelayLow: "Fast" +#DelayHigh: "Slow" +#DetailLevel: "Detail Level" +#Difficulty: "Difficulty" +#DifficultyEasy: "Easy" +#DifficultyHard: "Hard" +#DistanceHigh: "Far" +#DistanceLow: "Near" +#EnableController: "Enable Controller" +#FieldOfViewLow: "Low" +#FieldOfViewHigh: "High" +#GammaCorrection: "Gamma Correction" +#GammaDark: "Dark" +#GammaLight: "Light" +#InvertYAxis: "Invert Y Axis" +#MenuHelpDelay: "Menu Help Delay" +#MenuTransparency: "Menu Transparency" +#Preferences: "Prefs" +#QualityHigh: "High" +#QualityLow: "Low" +#QualityMedium: "Medium" +#RebindAction: "Press a key or button to rebind this control." +#ResetControls: "Reset Controls" +#SensitivityHigh: "High" +#SensitivityLow: "Low" +#SettingsWindow: "Options" +#Subtitles: "Subtitles" +#TransparencyFull: "Full" +#TransparencyNone: "None" +#Video: "Video" +#ViewDistance: "View Distance" diff --git a/files/data/mygui/openmw_alchemy_window.layout b/files/data/mygui/openmw_alchemy_window.layout index 8e1082952c..8e87c23326 100644 --- a/files/data/mygui/openmw_alchemy_window.layout +++ b/files/data/mygui/openmw_alchemy_window.layout @@ -110,7 +110,7 @@ - + diff --git a/files/data/mygui/openmw_chargen_birth.layout b/files/data/mygui/openmw_chargen_birth.layout index 05f92b9b33..c87c7e82d3 100644 --- a/files/data/mygui/openmw_chargen_birth.layout +++ b/files/data/mygui/openmw_chargen_birth.layout @@ -22,7 +22,7 @@ - + diff --git a/files/data/mygui/openmw_chargen_class.layout b/files/data/mygui/openmw_chargen_class.layout index cd01b836ca..c1074f947c 100644 --- a/files/data/mygui/openmw_chargen_class.layout +++ b/files/data/mygui/openmw_chargen_class.layout @@ -79,7 +79,7 @@ - + diff --git a/files/data/mygui/openmw_chargen_create_class.layout b/files/data/mygui/openmw_chargen_create_class.layout index 17a5c8684b..f2ee41398b 100644 --- a/files/data/mygui/openmw_chargen_create_class.layout +++ b/files/data/mygui/openmw_chargen_create_class.layout @@ -83,7 +83,7 @@ - + diff --git a/files/data/mygui/openmw_chargen_generate_class_result.layout b/files/data/mygui/openmw_chargen_generate_class_result.layout index 42da935bf5..b4468b809e 100644 --- a/files/data/mygui/openmw_chargen_generate_class_result.layout +++ b/files/data/mygui/openmw_chargen_generate_class_result.layout @@ -29,7 +29,7 @@ - + diff --git a/files/data/mygui/openmw_chargen_race.layout b/files/data/mygui/openmw_chargen_race.layout index 4f95dac5cb..08bc12d337 100644 --- a/files/data/mygui/openmw_chargen_race.layout +++ b/files/data/mygui/openmw_chargen_race.layout @@ -82,7 +82,7 @@ - + diff --git a/files/data/mygui/openmw_chargen_review.layout b/files/data/mygui/openmw_chargen_review.layout index 2443115eb6..1f158dc064 100644 --- a/files/data/mygui/openmw_chargen_review.layout +++ b/files/data/mygui/openmw_chargen_review.layout @@ -117,7 +117,7 @@ - + diff --git a/files/data/mygui/openmw_chargen_select_attribute.layout b/files/data/mygui/openmw_chargen_select_attribute.layout index 115c8642d6..621ba90817 100644 --- a/files/data/mygui/openmw_chargen_select_attribute.layout +++ b/files/data/mygui/openmw_chargen_select_attribute.layout @@ -24,7 +24,7 @@ - + diff --git a/files/data/mygui/openmw_chargen_select_skill.layout b/files/data/mygui/openmw_chargen_select_skill.layout index 009c2e96f4..c047d7158d 100644 --- a/files/data/mygui/openmw_chargen_select_skill.layout +++ b/files/data/mygui/openmw_chargen_select_skill.layout @@ -59,7 +59,7 @@ - + diff --git a/files/data/mygui/openmw_chargen_select_specialization.layout b/files/data/mygui/openmw_chargen_select_specialization.layout index 9c5b54557b..35bd48718b 100644 --- a/files/data/mygui/openmw_chargen_select_specialization.layout +++ b/files/data/mygui/openmw_chargen_select_specialization.layout @@ -26,7 +26,7 @@ - + diff --git a/files/data/mygui/openmw_companion_window.layout b/files/data/mygui/openmw_companion_window.layout index dd1fa84479..7fd5e5e969 100644 --- a/files/data/mygui/openmw_companion_window.layout +++ b/files/data/mygui/openmw_companion_window.layout @@ -22,7 +22,7 @@ - + diff --git a/files/data/mygui/openmw_confirmation_dialog.layout b/files/data/mygui/openmw_confirmation_dialog.layout index beaa4bf339..5affca5bc9 100644 --- a/files/data/mygui/openmw_confirmation_dialog.layout +++ b/files/data/mygui/openmw_confirmation_dialog.layout @@ -18,10 +18,10 @@ - + - + diff --git a/files/data/mygui/openmw_console.layout b/files/data/mygui/openmw_console.layout index ccb18e1ba6..a4b02de585 100644 --- a/files/data/mygui/openmw_console.layout +++ b/files/data/mygui/openmw_console.layout @@ -1,7 +1,7 @@  - + diff --git a/files/data/mygui/openmw_container_window.layout b/files/data/mygui/openmw_container_window.layout index 5783779db9..ee59d43ef0 100644 --- a/files/data/mygui/openmw_container_window.layout +++ b/files/data/mygui/openmw_container_window.layout @@ -19,7 +19,7 @@ - + diff --git a/files/data/mygui/openmw_count_window.layout b/files/data/mygui/openmw_count_window.layout index 3f1729f56d..0d7b35c0a5 100644 --- a/files/data/mygui/openmw_count_window.layout +++ b/files/data/mygui/openmw_count_window.layout @@ -19,10 +19,10 @@ - + - + diff --git a/files/data/mygui/openmw_edit_effect.layout b/files/data/mygui/openmw_edit_effect.layout index 545cb66e47..bacfeafb94 100644 --- a/files/data/mygui/openmw_edit_effect.layout +++ b/files/data/mygui/openmw_edit_effect.layout @@ -109,11 +109,11 @@ - + - + diff --git a/files/data/mygui/openmw_edit_note.layout b/files/data/mygui/openmw_edit_note.layout index 765315aa3f..9c44c8eea0 100644 --- a/files/data/mygui/openmw_edit_note.layout +++ b/files/data/mygui/openmw_edit_note.layout @@ -21,10 +21,10 @@ - + - + diff --git a/files/data/mygui/openmw_enchanting_dialog.layout b/files/data/mygui/openmw_enchanting_dialog.layout index 4738cdc13d..c0e3ba0d21 100644 --- a/files/data/mygui/openmw_enchanting_dialog.layout +++ b/files/data/mygui/openmw_enchanting_dialog.layout @@ -156,7 +156,7 @@ - + diff --git a/files/data/mygui/openmw_itemselection_dialog.layout b/files/data/mygui/openmw_itemselection_dialog.layout index 636a864e1f..39fdb425b1 100644 --- a/files/data/mygui/openmw_itemselection_dialog.layout +++ b/files/data/mygui/openmw_itemselection_dialog.layout @@ -9,7 +9,7 @@ - + diff --git a/files/data/mygui/openmw_levelup_dialog.layout b/files/data/mygui/openmw_levelup_dialog.layout index 7849d507f6..ef161d7f58 100644 --- a/files/data/mygui/openmw_levelup_dialog.layout +++ b/files/data/mygui/openmw_levelup_dialog.layout @@ -158,7 +158,7 @@ - + diff --git a/files/data/mygui/openmw_magicselection_dialog.layout b/files/data/mygui/openmw_magicselection_dialog.layout index 870592a536..c4e84fe686 100644 --- a/files/data/mygui/openmw_magicselection_dialog.layout +++ b/files/data/mygui/openmw_magicselection_dialog.layout @@ -11,7 +11,7 @@ - + diff --git a/files/data/mygui/openmw_merchantrepair.layout b/files/data/mygui/openmw_merchantrepair.layout index fc85dc7aeb..60f5e05096 100644 --- a/files/data/mygui/openmw_merchantrepair.layout +++ b/files/data/mygui/openmw_merchantrepair.layout @@ -24,7 +24,7 @@ - + diff --git a/files/data/mygui/openmw_persuasion_dialog.layout b/files/data/mygui/openmw_persuasion_dialog.layout index 977da40f8f..facb4a6b75 100644 --- a/files/data/mygui/openmw_persuasion_dialog.layout +++ b/files/data/mygui/openmw_persuasion_dialog.layout @@ -41,7 +41,7 @@ - + diff --git a/files/data/mygui/openmw_postprocessor_hud.skin.xml b/files/data/mygui/openmw_postprocessor_hud.skin.xml index 35ab652f2c..af8fc30db0 100644 --- a/files/data/mygui/openmw_postprocessor_hud.skin.xml +++ b/files/data/mygui/openmw_postprocessor_hud.skin.xml @@ -45,7 +45,7 @@ - + diff --git a/files/data/mygui/openmw_quickkeys_menu.layout b/files/data/mygui/openmw_quickkeys_menu.layout index 829c64d0c6..ba6832cf95 100644 --- a/files/data/mygui/openmw_quickkeys_menu.layout +++ b/files/data/mygui/openmw_quickkeys_menu.layout @@ -32,7 +32,7 @@ - + diff --git a/files/data/mygui/openmw_quickkeys_menu_assign.layout b/files/data/mygui/openmw_quickkeys_menu_assign.layout index 649294e9d3..716d22d2bf 100644 --- a/files/data/mygui/openmw_quickkeys_menu_assign.layout +++ b/files/data/mygui/openmw_quickkeys_menu_assign.layout @@ -21,7 +21,7 @@ - + diff --git a/files/data/mygui/openmw_recharge_dialog.layout b/files/data/mygui/openmw_recharge_dialog.layout index 6260390653..e40be62af2 100644 --- a/files/data/mygui/openmw_recharge_dialog.layout +++ b/files/data/mygui/openmw_recharge_dialog.layout @@ -30,7 +30,7 @@ - + diff --git a/files/data/mygui/openmw_repair.layout b/files/data/mygui/openmw_repair.layout index bf58b6c811..b7127de6c2 100644 --- a/files/data/mygui/openmw_repair.layout +++ b/files/data/mygui/openmw_repair.layout @@ -37,7 +37,7 @@ - + diff --git a/files/data/mygui/openmw_savegame_dialog.layout b/files/data/mygui/openmw_savegame_dialog.layout index a1cdba89ab..1e40b5dd34 100644 --- a/files/data/mygui/openmw_savegame_dialog.layout +++ b/files/data/mygui/openmw_savegame_dialog.layout @@ -54,7 +54,7 @@ - + @@ -63,10 +63,10 @@ - + - + diff --git a/files/data/mygui/openmw_settings_window.layout b/files/data/mygui/openmw_settings_window.layout index 61a25cf2f6..4168121584 100644 --- a/files/data/mygui/openmw_settings_window.layout +++ b/files/data/mygui/openmw_settings_window.layout @@ -5,10 +5,10 @@ - + - + @@ -19,17 +19,17 @@ - + - + - + @@ -40,17 +40,17 @@ - + - + - + @@ -62,14 +62,14 @@ - + - + - + @@ -90,11 +90,11 @@ - + - + @@ -125,7 +125,7 @@ - + @@ -140,9 +140,9 @@ - + - + @@ -153,7 +153,7 @@ - + @@ -164,7 +164,7 @@ - + @@ -175,7 +175,7 @@ - + @@ -186,7 +186,7 @@ - + @@ -198,7 +198,7 @@ - + @@ -217,7 +217,7 @@ - + @@ -234,7 +234,7 @@ - + @@ -251,11 +251,11 @@ - + - + @@ -265,16 +265,16 @@ - + - + - + @@ -291,8 +291,8 @@ - - + + @@ -342,15 +342,15 @@ - + - + - + @@ -363,16 +363,16 @@ - + - + - + @@ -398,7 +398,7 @@ - + @@ -410,7 +410,7 @@ - + @@ -422,14 +422,14 @@ - + - + - + @@ -479,9 +479,9 @@ - - - + + + @@ -634,7 +634,7 @@ - + @@ -705,7 +705,7 @@ - + diff --git a/files/data/mygui/openmw_spell_buying_window.layout b/files/data/mygui/openmw_spell_buying_window.layout index 3481575de8..25a02945ee 100644 --- a/files/data/mygui/openmw_spell_buying_window.layout +++ b/files/data/mygui/openmw_spell_buying_window.layout @@ -24,7 +24,7 @@ - + diff --git a/files/data/mygui/openmw_spellcreation_dialog.layout b/files/data/mygui/openmw_spellcreation_dialog.layout index e7c27655d1..c284927a37 100644 --- a/files/data/mygui/openmw_spellcreation_dialog.layout +++ b/files/data/mygui/openmw_spellcreation_dialog.layout @@ -85,7 +85,7 @@ - + diff --git a/files/data/mygui/openmw_text_input.layout b/files/data/mygui/openmw_text_input.layout index 9f879bc14a..9ba6abffa0 100644 --- a/files/data/mygui/openmw_text_input.layout +++ b/files/data/mygui/openmw_text_input.layout @@ -12,7 +12,7 @@ - + diff --git a/files/data/mygui/openmw_trade_window.layout b/files/data/mygui/openmw_trade_window.layout index 44f6597fde..49ccf25ba2 100644 --- a/files/data/mygui/openmw_trade_window.layout +++ b/files/data/mygui/openmw_trade_window.layout @@ -76,7 +76,7 @@ - + diff --git a/files/data/mygui/openmw_trainingwindow.layout b/files/data/mygui/openmw_trainingwindow.layout index 19c6a6712b..80526068ce 100644 --- a/files/data/mygui/openmw_trainingwindow.layout +++ b/files/data/mygui/openmw_trainingwindow.layout @@ -22,7 +22,7 @@ - + diff --git a/files/data/mygui/openmw_travel_window.layout b/files/data/mygui/openmw_travel_window.layout index 7dd9df4ebd..96de2fc08d 100644 --- a/files/data/mygui/openmw_travel_window.layout +++ b/files/data/mygui/openmw_travel_window.layout @@ -25,7 +25,7 @@ - + diff --git a/files/data/mygui/openmw_wait_dialog.layout b/files/data/mygui/openmw_wait_dialog.layout index 460002b879..4b18c9b8a8 100644 --- a/files/data/mygui/openmw_wait_dialog.layout +++ b/files/data/mygui/openmw_wait_dialog.layout @@ -35,7 +35,7 @@ - + From f442e2831ed61c0b7d980ece603b57690bb3d50d Mon Sep 17 00:00:00 2001 From: Petr Mikheev Date: Fri, 24 Mar 2023 19:27:25 +0100 Subject: [PATCH 2/2] Fixes in calendar.lua --- files/data-mw/CMakeLists.txt | 4 ++++ files/data-mw/openmw_aux/calendarconfig.lua | 7 ++++++ files/data/CMakeLists.txt | 3 ++- files/data/openmw_aux/calendar.lua | 26 +++++++++------------ files/data/openmw_aux/calendarconfig.lua | 9 +++++++ 5 files changed, 33 insertions(+), 16 deletions(-) create mode 100644 files/data-mw/openmw_aux/calendarconfig.lua create mode 100644 files/data/openmw_aux/calendarconfig.lua diff --git a/files/data-mw/CMakeLists.txt b/files/data-mw/CMakeLists.txt index 982c7d7390..79bba2a3cd 100644 --- a/files/data-mw/CMakeLists.txt +++ b/files/data-mw/CMakeLists.txt @@ -6,6 +6,7 @@ set(BUILTIN_DATA_MW_FILES # Month names and date formatting l10n/Calendar/de.yaml l10n/Calendar/en.yaml + l10n/Calendar/gmst.yaml l10n/Calendar/ru.yaml l10n/Calendar/sv.yaml l10n/Calendar/fr.yaml @@ -15,6 +16,9 @@ set(BUILTIN_DATA_MW_FILES # L10n for OpenMW menus and non-game-specific messages l10n/OMWEngine/gmst.yaml + + # Game-specific settings for calendar.lua + openmw_aux/calendarconfig.lua ) foreach (f ${BUILTIN_DATA_MW_FILES}) diff --git a/files/data-mw/openmw_aux/calendarconfig.lua b/files/data-mw/openmw_aux/calendarconfig.lua new file mode 100644 index 0000000000..6ac6a5bffd --- /dev/null +++ b/files/data-mw/openmw_aux/calendarconfig.lua @@ -0,0 +1,7 @@ +return { + monthsDuration = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, + daysInWeek = 7, + startingYear = 427, + startingYearDay = 227, + startingWeekDay = 1, +} diff --git a/files/data/CMakeLists.txt b/files/data/CMakeLists.txt index 34aedea862..64cbee0479 100644 --- a/files/data/CMakeLists.txt +++ b/files/data/CMakeLists.txt @@ -47,7 +47,7 @@ set(BUILTIN_DATA_FILES l10n/OMWEngine/ru.yaml l10n/OMWEngine/sv.yaml l10n/OMWEngine/fr.yaml - + # L10n for post-processing HUD and built-in shaders l10n/OMWShaders/de.yaml l10n/OMWShaders/en.yaml @@ -58,6 +58,7 @@ set(BUILTIN_DATA_FILES openmw_aux/util.lua openmw_aux/time.lua openmw_aux/calendar.lua + openmw_aux/calendarconfig.lua openmw_aux/ui.lua builtin.omwscripts diff --git a/files/data/openmw_aux/calendar.lua b/files/data/openmw_aux/calendar.lua index 85b9db8e49..7dba60dbeb 100644 --- a/files/data/openmw_aux/calendar.lua +++ b/files/data/openmw_aux/calendar.lua @@ -6,17 +6,13 @@ local core = require('openmw.core') local time = require('openmw_aux.time') +local conf = require('openmw_aux.calendarconfig') local l10n = core.l10n('Calendar') -local monthsDuration = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} -local daysInWeek = 7 +local monthsDuration = conf.monthsDuration local daysInYear = 0 for _, d in ipairs(monthsDuration) do daysInYear = daysInYear + d end -local startingYear = 427 -local startingYearDay = 227 -local startingWeekDay = 1 - local function gameTime(t) if not t then return core.getGameTime() @@ -43,10 +39,10 @@ local function formatGameTime(formatStr, timestamp) timestamp = timestamp or core.getGameTime() local t = {} - local day = math.floor(timestamp / time.day) - t.year = math.floor(day / daysInYear) + startingYear - t.yday = (day + startingYearDay - 1) % daysInYear + 1 - t.wday = (day + startingWeekDay - 1) % daysInWeek + 1 + local day = math.floor(timestamp / time.day) + conf.startingYearDay - 1 + t.year = math.floor(day / daysInYear) + conf.startingYear + t.yday = day % daysInYear + 1 + t.wday = (day + conf.startingWeekDay - conf.startingYearDay) % conf.daysInWeek + 1 timestamp = timestamp % time.day t.hour = math.floor(timestamp / time.hour) timestamp = timestamp % time.hour @@ -75,10 +71,10 @@ local function formatGameTime(formatStr, timestamp) if tag == '%M' then return string.format('%02d', t.min) end if tag == '%m' then return string.format('%02d', t.month) end if tag == '%p' then - if t.hour > 0 and t.hour <= 12 then - return 'am' + if t.hour >= 0 and t.hour < 12 then + return l10n('am') else - return 'pm' + return l10n('pm') end end if tag == '%S' then return string.format('%02d', t.sec) end @@ -122,7 +118,7 @@ return { --- The number of days in a week -- @field [parent=#calendar] #number daysInWeek - daysInWeek = daysInWeek, + daysInWeek = conf.daysInWeek, --- The number of days in a month -- @function [parent=#calendar] daysInMonth @@ -153,7 +149,7 @@ return { -- @param dayIndex -- @return #string weekdayName = function(d) - return l10n('weekday' .. ((d-1) % daysInWeek + 1)) + return l10n('weekday' .. ((d-1) % conf.daysInWeek + 1)) end, } diff --git a/files/data/openmw_aux/calendarconfig.lua b/files/data/openmw_aux/calendarconfig.lua new file mode 100644 index 0000000000..275e1acaba --- /dev/null +++ b/files/data/openmw_aux/calendarconfig.lua @@ -0,0 +1,9 @@ +return { + monthsDuration = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, + daysInWeek = 7, + + -- It is the day of OpenMW 0.1.0 release, we use it as default starting date + startingYear = 2008, + startingYearDay = 151, + startingWeekDay = 0, +}