mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-05 15:18:40 +00:00
config: limit command translations to GTK (#13615)
Fixes #13614 Only translate the shared default commands when building the GTK runtime. macOS now use the source strings until we do broader localization.
This commit is contained in:
@@ -8749,9 +8749,16 @@ pub const RepeatableCommand = struct {
|
||||
try self.value.ensureUnusedCapacity(alloc, inputpkg.command.defaults.len);
|
||||
try self.value_c.ensureUnusedCapacity(alloc, inputpkg.command.defaults.len);
|
||||
for (inputpkg.command.defaults) |cmd| {
|
||||
const translated = cmd.translated();
|
||||
self.value.appendAssumeCapacity(translated);
|
||||
self.value_c.appendAssumeCapacity(try translated.cval(alloc));
|
||||
// Translation is currently a GTK-only feature. In particular,
|
||||
// translating these shared strings for the embedded runtime gives
|
||||
// the macOS app a localized command palette in an otherwise
|
||||
// unlocalized UI.
|
||||
const localized = if (comptime build_config.app_runtime == .gtk)
|
||||
cmd.translated()
|
||||
else
|
||||
cmd;
|
||||
self.value.appendAssumeCapacity(localized);
|
||||
self.value_c.appendAssumeCapacity(try localized.cval(alloc));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user