From 21a07f08a3666a278cb1904914e1ef6834f03a67 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 25 Aug 2025 10:03:52 +0200 Subject: [PATCH] config_paths: fix compiled-in locale dir for installed, non-embed builds Commit bf65b9e3a74 (Change `gettext` paths to be relocatable (#11195), 2025-03-30) broke the locale path. Commit c3740b85be4 (config_paths: fix compiled-in locale dir, 2025-06-12) fixed what it calls "case 4", but "case 2" is also affected; fix that. Before/after: $ ~/.local/opt/fish/bin/fish -d config paths.locale: /home/johannes/.local/opt/fish/share/fish/locale $ ~/.local/opt/fish/bin/fish -d config paths.locale: /home/johannes/.local/opt/fish/share/locale Fixes https://github.com/fish-shell/fish-shell/issues/11683#issuecomment-3218190662 --- src/env/config_paths.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/env/config_paths.rs b/src/env/config_paths.rs index dbb7b8e8e..0d1cf0de9 100644 --- a/src/env/config_paths.rs +++ b/src/env/config_paths.rs @@ -57,6 +57,8 @@ let data_dir = base_path.join("share/fish/install"); #[cfg(not(feature = "embed-data"))] let data_dir = base_path.join("share/fish"); + let locale = + (!cfg!(feature = "embed-data")).then(|| base_path.join("share/locale")); paths = ConfigPaths { // One obvious path is ~/.local (with fish in ~/.local/bin/). // If we picked ~/.local/share/fish as our data path, @@ -66,7 +68,7 @@ sysconf: base_path.join("etc/fish"), doc: base_path.join("share/doc/fish"), bin: Some(base_path.join("bin")), - locale: Some(data_dir.join("locale")), + locale, } } else if exec_path.ends_with("fish") { FLOG!(