Use whoami's own uucore locale in the whoami command (#19144)

## Description
`whoami` sets up uutils' error translations with
`localized_help_template("touch")`, so it loads `touch`'s translations
instead of `whoami`'s. Any `uu_whoami` error message ID would then be
looked up in the wrong translations and could show up as a raw ID. This
PR passes `"whoami"`, like the other uutils-backed commands (`mktemp`,
`mv`, `cp`, `mkdir`, `touch`, `uname`) already do for their own utils.

This is the nushell-side fix I mentioned in #19004. The main cause of
that issue (uucore keeping whichever util's translations loaded first)
is upstream and tracked in uutils/coreutils#15040.

## User-facing changes (Release notes)
- Fixed `whoami` loading translations for the wrong command, which could
make its error messages show up untranslated.

## Additional notes
Related #19004
This commit is contained in:
Aakarshit Verma authored and GitHub committed 2026-10-11 09:26:23 -05:00
1 parent af37214641
commit 6f7c91f790
1 file changed
+1 -1
+1 -1
View File
@@ -33,7 +33,7 @@ impl Command for Whoami {
_input: PipelineData,
) -> Result<PipelineData, ShellError> {
// setup the uutils error translation
let _ = localized_help_template("touch");
let _ = localized_help_template("whoami");
let output = match uu_whoami::whoami() {
Ok(username) => username.to_string_lossy().to_string(),