feat(linux): add locale info
This commit is contained in:
@@ -23,6 +23,13 @@ pub fn getHostname(allocator: std.mem.Allocator) ![]u8 {
|
|||||||
return hostname;
|
return hostname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn getLocale(allocator: std.mem.Allocator) ![]u8 {
|
||||||
|
const locale = std.process.getEnvVarOwned(allocator, "LANG") catch |err| if (err == error.EnvironmentVariableNotFound) {
|
||||||
|
return allocator.dupe(u8, "Unknown");
|
||||||
|
} else return err;
|
||||||
|
return locale;
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns the system uptime.
|
/// Returns the system uptime.
|
||||||
///
|
///
|
||||||
/// Uses `sysinfo` to fetch the system uptime and calculates the elapsed time.
|
/// Uses `sysinfo` to fetch the system uptime and calculates the elapsed time.
|
||||||
|
|||||||
Reference in New Issue
Block a user