Add Farsi Bigclock (#673)

* Change config type for bigclock

* Seprates big clock's hard codes from its logic

* Adds Farsi (fa) to big clock langs

* Minor changes

* Makes requested changes
This commit is contained in:
Kian A.
2024-08-07 18:17:27 +03:30
committed by GitHub
parent 2bd0d0d4f3
commit 00c94f8ffd
9 changed files with 272 additions and 117 deletions

View File

@@ -4,13 +4,14 @@ const enums = @import("../enums.zig");
const Animation = enums.Animation;
const Input = enums.Input;
const ViMode = enums.ViMode;
const Bigclock = enums.Bigclock;
animation: Animation = .none,
animation_timeout_sec: u12 = 0,
asterisk: ?u8 = '*',
auth_fails: u64 = 10,
bg: u16 = 0,
bigclock: bool = false,
bigclock: Bigclock = .none,
blank_box: bool = true,
border_fg: u16 = 8,
box_title: ?[]const u8 = null,

View File

@@ -85,6 +85,22 @@ pub fn configFieldHandler(_: std.mem.Allocator, field: ini.IniField) ?ini.IniFie
return null;
}
if (std.mem.eql(u8, field.key, "bigclock")) {
// The option now uses a string (which then gets converted into an enum) instead of an boolean
// It also includes the ability to change active bigclock's language
var mapped_field = field;
if (std.mem.eql(u8, field.value, "true")){
mapped_field.value = "en";
mapped_config_fields = true;
}else if (std.mem.eql(u8, field.value, "false")){
mapped_field.value = "none";
mapped_config_fields = true;
}
return mapped_field;
}
return field;
}