i18n: export proper _ function
parent
4cf127a064
commit
238573d42e
|
|
@ -33,9 +33,14 @@ pub fn init(resources_dir: []const u8) InitError!void {
|
||||||
return error.OutOfMemory;
|
return error.OutOfMemory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Translate a message for the Ghostty domain.
|
||||||
|
pub fn _(msgid: [*:0]const u8) [*:0]const u8 {
|
||||||
|
return dgettext(build_config.bundle_id, msgid);
|
||||||
|
}
|
||||||
|
|
||||||
// Manually include function definitions for the gettext functions
|
// Manually include function definitions for the gettext functions
|
||||||
// as libintl.h isn't always easily available (e.g. in musl)
|
// as libintl.h isn't always easily available (e.g. in musl)
|
||||||
extern fn bindtextdomain(domainname: [*:0]const u8, dirname: [*:0]const u8) ?[*:0]const u8;
|
extern fn bindtextdomain(domainname: [*:0]const u8, dirname: [*:0]const u8) ?[*:0]const u8;
|
||||||
extern fn textdomain(domainname: [*:0]const u8) ?[*:0]const u8;
|
extern fn textdomain(domainname: [*:0]const u8) ?[*:0]const u8;
|
||||||
pub extern fn gettext(msgid: [*:0]const u8) [*:0]const u8;
|
extern fn gettext(msgid: [*:0]const u8) [*:0]const u8;
|
||||||
pub const _ = gettext;
|
extern fn dgettext(domainname: [*:0]const u8, msgid: [*:0]const u8) [*:0]const u8;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue