Add translation support for Randomizer UI components

- Add LanguageManager integration to Plandomizer.cpp, randomizer_check_tracker.cpp,
  randomizer_item_tracker.cpp, and randomizer_entrance_tracker.cpp
- Add ~100 new translation keys to Espanol.json for Randomizer UI
- Include lenguajes folder in AppImage/DEB packaging via CMakeLists.txt
- Update PLAN_TRADUCCION.md with Randomizer translation status and packaging info
This commit is contained in:
2026-04-03 17:51:28 -06:00
parent ccbbcec3c3
commit ca5c80fc47
7 changed files with 6906 additions and 138 deletions

View File

@@ -1,6 +1,7 @@
#include "Plandomizer.h"
#include <soh/SohGui/SohGui.hpp>
#include "soh/SohGui/UIWidgets.hpp"
#include "soh/SohGui/LanguageManager.h"
#include "soh/util.h"
#include <vector>
#include <set>
@@ -19,6 +20,8 @@
#include "soh/Enhancements/randomizer/Traps.h"
#include "soh/Enhancements/randomizer/3drando/shops.hpp"
using namespace SohGui;
extern "C" {
#include "include/z64item.h"
#include "objects/gameplay_keep/gameplay_keep.h"
@@ -727,7 +730,7 @@ void PlandomizerOverlayText(std::pair<Rando::Item, uint32_t> drawObject) {
void PlandomizerDrawItemPopup(uint32_t index) {
if (shouldPopup && ImGui::BeginPopup("ItemList")) {
PlandoPushImageButtonStyle();
ImGui::SeparatorText("Resources");
ImGui::SeparatorText(LanguageManager::Instance().GetString("Resources").c_str());
ImGui::BeginTable("Infinite Item Table", 7);
for (auto& item : infiniteItemList) {
ImGui::PushID(item);
@@ -752,7 +755,7 @@ void PlandomizerDrawItemPopup(uint32_t index) {
}
ImGui::EndTable();
ImGui::SeparatorText("Spoiler Log Rewards");
ImGui::SeparatorText(LanguageManager::Instance().GetString("Spoiler Log Rewards").c_str());
ImGui::BeginTable("Item Button Table", 8);
uint32_t itemIndex = 0;
@@ -875,8 +878,8 @@ void PlandomizerDrawIceTrapSetup(uint32_t index) {
ImGui::PushID(index);
ImGui::BeginTable("IceTrap", 2, ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersInner);
ImGui::TableSetupColumn("Model", ImGuiTableColumnFlags_WidthFixed, 36.0f);
ImGui::TableSetupColumn("Trap Options");
ImGui::TableSetupColumn(LanguageManager::Instance().GetString("Model").c_str(), ImGuiTableColumnFlags_WidthFixed, 36.0f);
ImGui::TableSetupColumn(LanguageManager::Instance().GetString("Trap Options").c_str());
ImGui::TableHeadersRow();
ImGui::TableNextColumn();
@@ -896,7 +899,7 @@ void PlandomizerDrawIceTrapSetup(uint32_t index) {
PlandomizerDrawIceTrapPopUp(index);
ImGui::SameLine();
ImGui::TableNextColumn();
ImGui::Text("Name: ");
ImGui::Text("%s", LanguageManager::Instance().GetString("Name: ").c_str());
ImGui::SameLine();
if (plandoLogData[index].iceTrapModel.GetRandomizerGet() != RG_NONE &&
plandoLogData[index].iceTrapModel.GetRandomizerGet() != RG_SOLD_OUT) {
@@ -964,7 +967,7 @@ void PlandomizerDrawOptions() {
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch);
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch);
ImGui::TableNextColumn();
ImGui::SeparatorText("Load/Save Spoiler Log");
ImGui::SeparatorText(LanguageManager::Instance().GetString("Load/Save Spoiler Log").c_str());
PlandomizerPopulateSeedList();
static size_t selectedList = 0;
if (existingSeedList.size() != 0) {
@@ -972,7 +975,7 @@ void PlandomizerDrawOptions() {
"##JsonFiles", &selectedList, existingSeedList,
UIWidgets::ComboboxOptions().Color(THEME_COLOR).LabelPosition(UIWidgets::LabelPositions::None));
} else {
ImGui::Text("No Spoiler Logs found.");
ImGui::Text(LanguageManager::Instance().GetString("No Spoiler Logs found.").c_str());
}
ImGui::BeginDisabled(existingSeedList.empty());
if (UIWidgets::Button("Load", UIWidgets::ButtonOptions().Color(THEME_COLOR).Size(UIWidgets::Sizes::Inline))) {
@@ -988,7 +991,7 @@ void PlandomizerDrawOptions() {
ImGui::EndDisabled();
ImGui::TableNextColumn();
ImGui::SeparatorText("Current Seed Hash");
ImGui::SeparatorText(LanguageManager::Instance().GetString("Current Seed Hash").c_str());
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + (ImGui::GetContentRegionAvail().x * 0.5f) - (34.0f * 5.0f));
if (spoilerLogData.size() > 0) {
if (ImGui::BeginTable("HashIcons", 5)) {
@@ -1040,14 +1043,14 @@ void PlandomizerDrawOptions() {
ImGui::EndTable();
}
} else {
ImGui::Text("No Spoiler Log Loaded");
ImGui::Text(LanguageManager::Instance().GetString("No Spoiler Log Loaded").c_str());
}
ImGui::EndTable();
}
ImGui::SeparatorText("Options");
ImGui::SeparatorText(LanguageManager::Instance().GetString("Options").c_str());
if (plandoLogData.size() == 0) {
ImGui::Text("Please Load Spoiler Data...");
ImGui::Text(LanguageManager::Instance().GetString("Please Load Spoiler Data...").c_str());
return;
}
@@ -1098,7 +1101,7 @@ void PlandomizerDrawOptions() {
}
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Type to search and press Enter");
ImGui::SetTooltip(LanguageManager::Instance().GetString("Type to search and press Enter").c_str());
}
ImGui::SameLine();
if (UIWidgets::Button("A-Z", UIWidgets::ButtonOptions()
@@ -1147,7 +1150,7 @@ void PlandomizerDrawHintsWindow() {
ImGui::BeginChild("Hints");
if (ImGui::BeginTable("Hints Window", 1, ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_ScrollY)) {
ImGui::TableSetupColumn("Hint Entries");
ImGui::TableSetupColumn(LanguageManager::Instance().GetString("Hint Entries").c_str());
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableHeadersRow();
@@ -1155,14 +1158,14 @@ void PlandomizerDrawHintsWindow() {
ImGui::PushID(index);
ImGui::TableNextColumn();
ImGui::SeparatorText(hintData.hintName.c_str());
ImGui::Text("Current Hint: ");
ImGui::Text("%s", LanguageManager::Instance().GetString("Current Hint: ").c_str());
ImGui::SameLine();
ImGui::TextWrapped("%s", hintData.hintText.c_str());
if (spoilerHintData.size() > 0) {
hintInputText = plandoHintData[index].hintText.c_str();
}
ImGui::Text("New Hint: ");
ImGui::Text("%s", LanguageManager::Instance().GetString("New Hint: ").c_str());
ImGui::SameLine();
if (UIWidgets::Button(randomizeButton.c_str(), UIWidgets::ButtonOptions()
.Color(THEME_COLOR)
@@ -1193,11 +1196,11 @@ void PlandomizerDrawLocationsWindow(RandomizerCheckArea rcArea) {
uint32_t index = 0;
ImGui::BeginChild("Locations");
if (ImGui::BeginTable("Locations Window", 4, ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_ScrollY)) {
ImGui::TableSetupColumn("Spoiler Log Check Name", ImGuiTableColumnFlags_WidthFixed, 250.0f);
ImGui::TableSetupColumn("Spoiler Log Reward", ImGuiTableColumnFlags_WidthFixed, 190.0f);
ImGui::TableSetupColumn("New Reward", ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoHeaderLabel,
ImGui::TableSetupColumn(LanguageManager::Instance().GetString("Spoiler Log Check Name").c_str(), ImGuiTableColumnFlags_WidthFixed, 250.0f);
ImGui::TableSetupColumn(LanguageManager::Instance().GetString("Spoiler Log Reward").c_str(), ImGuiTableColumnFlags_WidthFixed, 190.0f);
ImGui::TableSetupColumn(LanguageManager::Instance().GetString("New Reward").c_str(), ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoHeaderLabel,
34.0f);
ImGui::TableSetupColumn("Additional Options");
ImGui::TableSetupColumn(LanguageManager::Instance().GetString("Additional Options").c_str());
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableHeadersRow();
@@ -1223,7 +1226,7 @@ void PlandomizerDrawLocationsWindow(RandomizerCheckArea rcArea) {
} else if (spoilerData.shopPrice != -1) {
ImGui::TableNextColumn();
ImGui::BeginTable("Shops", 1, ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersInner);
ImGui::TableSetupColumn("Shop Price");
ImGui::TableSetupColumn(LanguageManager::Instance().GetString("Shop Price").c_str());
ImGui::TableHeadersRow();
ImGui::TableNextColumn();
PlandomizerDrawShopSlider(index);
@@ -1243,12 +1246,12 @@ void PlandomizerDrawSpoilerTable() {
ImGui::BeginChild("Main");
UIWidgets::PushStyleTabs(THEME_COLOR);
if (ImGui::BeginTabBar("Check Tabs")) {
if (ImGui::BeginTabItem("Gossip Stones")) {
if (ImGui::BeginTabItem(LanguageManager::Instance().GetString("Gossip Stones").c_str())) {
getTabID = TAB_HINTS;
PlandomizerDrawHintsWindow();
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Locations")) {
if (ImGui::BeginTabItem(LanguageManager::Instance().GetString("Locations").c_str())) {
getTabID = TAB_LOCATIONS;
PlandomizerDrawLocationsWindow(selectedArea);
ImGui::EndTabItem();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff