Added .inspect and .to_s for debug help

This commit is contained in:
2026-05-20 19:23:33 +01:00
parent 7d48b226ab
commit 75b1bc5dbd
3 changed files with 64 additions and 3 deletions
+8
View File
@@ -134,4 +134,12 @@ inline Key key_from_sym(mrb_state *mrb, mrb_sym sym) {
localization_key_map[key_name] = new_id;
return new_id;
}
// This is only used for debugging and inspect output, so performance is not a concern
inline std::string get_key_name(Key key) {
for (const auto &[str, k] : localization_key_map)
if (k == key)
return str;
return "Unknown Key";
}
} // namespace Localization