From a00d155e9cb31829a27c3342653e30c6220e93ca Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 4 Aug 2026 15:22:25 -0700 Subject: [PATCH] config: limit command translations to GTK Fixes #13614 Only translate the shared default commands when building the GTK runtime. macOS now use the source strings until we do broader localization. --- src/config/Config.zig | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/config/Config.zig b/src/config/Config.zig index 6d3f4f47b..787c10aed 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -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)); } }