Added simple localizations for locations

This commit is contained in:
Vladislav Khorev committed 2026-07-07 12:11:34 +03:00
1 parent e2d9105b02
commit ef5b142425
4 files changed
+16 -5

No files matched your search

+11 -3
View File
@@ -101,6 +101,14 @@ namespace ZL {
gameState_(gameState),
audioPlayer_(audioPlayer)
{
localizedLocationName["uni_interior"][Language::Russian] = "Университет, 3 этаж";
localizedLocationName["uni_interior"][Language::English] = "University, 3rd floor";
localizedLocationName["uni_exterior"][Language::Russian] = "Университет, двор";
localizedLocationName["uni_exterior"][Language::English] = "University, exterior";
localizedLocationName["location_dorm"][Language::Russian] = "Общежитие, 1 этаж";
localizedLocationName["location_dorm"][Language::English] = "Dormitory, 1st floor";
}
void MenuManager::setup(Inventory& inv, const std::string& zipFile) {
@@ -445,7 +453,7 @@ namespace ZL {
SaveSlotInfo info = getSlotInfoFunc(slot);
std::string label = info.empty
? "Empty"
: info.locationName + "\n" + info.savedAt;
: localizedLocationName[info.locationName][ZL::g_currentLanguage] + "\n" + info.savedAt;
uiManager.setTextButtonText(kSlotButtons[i], label);
}
uiManager.setTextButtonCallback(kSlotButtons[i], [this, slot](const std::string&) {
@@ -473,7 +481,7 @@ namespace ZL {
SaveSlotInfo info = getSlotInfoFunc(slot);
std::string label = info.empty
? "Empty"
: info.locationName + "\n" + info.savedAt;
: localizedLocationName[info.locationName][ZL::g_currentLanguage] + "\n" + info.savedAt;
uiManager.setTextButtonText(buttonName, label);
}
uiManager.setTextButtonCallback(buttonName, [this, slot, buttonName](const std::string&) {
@@ -482,7 +490,7 @@ namespace ZL {
SaveSlotInfo info = getSlotInfoFunc(slot);
std::string label = info.empty
? "Empty"
: info.locationName + "\n" + info.savedAt;
: localizedLocationName[info.locationName][ZL::g_currentLanguage] + "\n" + info.savedAt;
uiManager.setTextButtonText(buttonName, label);
}
});