refactor(dashboard): routes name zones, objects and phrases through GameText

The routes' own zone name helpers and the CDClient's English zone and
leaderboard header copies give way to GameText, so every name comes from
the locale in the viewer's language; the Network page's world labels,
mail, missions, leaderboards, item info (cached per language) and the
settings/vanity help strings too. Reward code 4 and the plaque text name
their zone from the locale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-29 22:06:30 -05:00
parent 17b9479c0e
commit 1f8dd73e0b
29 changed files with 146 additions and 206 deletions

View File

@@ -1,4 +1,5 @@
#include "CharacterProgress.h"
#include "GameText.h"
#include <chrono>
#include <ctime>
@@ -186,10 +187,8 @@ namespace {
for (const auto& [zoneId, s] : stats) zoneIds.insert(zoneId);
for (const auto& [zoneId, zone] : catalog.zones) if (zone.released) zoneIds.insert(zoneId);
zoneIds.erase(0); // character select
const auto& names = ZoneNames();
nlohmann::json zones = nlohmann::json::array();
for (const auto zoneId : zoneIds) {
const auto key = std::to_string(zoneId);
const auto zone = catalog.zones.find(zoneId);
nlohmann::json summary = nlohmann::json::array();
if (zone != catalog.zones.end()) {
@@ -206,7 +205,7 @@ namespace {
}
}
const auto category = zone != catalog.zones.end() ? zone->second.category : std::nullopt;
zones.push_back({ {"id", zoneId}, {"name", names.contains(key) ? names[key] : nlohmann::json("Zone " + key)}, {"visited", visited.contains(zoneId)},
zones.push_back({ {"id", zoneId}, {"name", GameText::ZoneName(zoneId)}, {"visited", visited.contains(zoneId)},
{"category", category ? nlohmann::json(*category) : nlohmann::json(nullptr)}, {"stats", stats.contains(zoneId) ? stats[zoneId] : nlohmann::json(nullptr)},
{"summary", summary} });
}