mirror of
https://codeberg.org/fairyglade/ly.git
synced 2026-08-21 04:54:18 +02:00
implement localization
This commit is contained in:
parent
512ef3732a
commit
eeb7a0ab77
1 changed files with 6 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue