implement localization

This commit is contained in:
RadsammyT 2026-03-17 18:06:06 -04:00
commit eeb7a0ab77
No known key found for this signature in database

View file

@ -1094,13 +1094,18 @@ pub fn main() !void {
var iter = CustomCommands.binds.iterator();
while (iter.next()) |i| {
const concat = try std.mem.concat(state.allocator, u8,
var concat = try std.mem.concat(state.allocator, u8,
&[_][]const u8{
i.key_ptr.*,
" ",
i.value_ptr.name
}
);
inline for(@typeInfo(Lang).@"struct".fields) |lang_key| {
const new = try std.mem.replaceOwned(u8, state.allocator, concat, "$" ++ lang_key.name, @field(state.lang, lang_key.name));
state.allocator.free(concat);
concat = new;
}
try state.custom_binds.append(state.allocator, .{
.lbl = .init(
concat,