Added .inspect and .to_s for debug help
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user