From b34fdb56552f3f4ecd9d4ca34b76acf2be37b62c Mon Sep 17 00:00:00 2001 From: Humdinger Date: Fri, 9 Jan 2026 15:09:17 +0100 Subject: [PATCH] DriveSetup: More correct translation behavior The application name should never appear in a translatable string. Otherwise it will always show translated in the app, even if the user configured the Locale prefs to not "Translate app and folder names". Always concatenate the B_TRANSLATE_SYSTEM_NAME'ed string. Change-Id: I511c870bef6efc11dbde52203ecd411c2009495b Reviewed-on: https://review.haiku-os.org/c/haiku/+/10218 Tested-by: Commit checker robot Reviewed-by: waddlesplash --- src/apps/drivesetup/MainWindow.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/apps/drivesetup/MainWindow.cpp b/src/apps/drivesetup/MainWindow.cpp index 48e692639f..dbb87ff9db 100644 --- a/src/apps/drivesetup/MainWindow.cpp +++ b/src/apps/drivesetup/MainWindow.cpp @@ -531,8 +531,9 @@ MainWindow::MessageReceived(BMessage* message) fRegisterFilePanel = new(std::nothrow) BFilePanel(B_OPEN_PANEL, new BMessenger(this), NULL, B_FILE_NODE, false, new BMessage(MSG_REGISTER), NULL, true); - fRegisterFilePanel->Window()->SetTitle(B_TRANSLATE( - "DriveSetup: Register disk image")); + BString title(B_TRANSLATE("%appname%: Register disk image")); + title.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("DriveSetup")); + fRegisterFilePanel->Window()->SetTitle(title); fRegisterFilePanel->SetButtonLabel(B_DEFAULT_BUTTON, B_TRANSLATE("Register")); } @@ -571,8 +572,9 @@ MainWindow::MessageReceived(BMessage* message) fWriteImageFilePanel = new(std::nothrow) BFilePanel( B_OPEN_PANEL, new BMessenger(this), NULL, B_FILE_NODE, false, new BMessage(MSG_WRITE), NULL, true); - fWriteImageFilePanel->Window()->SetTitle(B_TRANSLATE( - "DriveSetup: Select disk image")); + BString title(B_TRANSLATE("%appname%: Select disk image")); + title.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("DriveSetup")); + fWriteImageFilePanel->Window()->SetTitle(title); fWriteImageFilePanel->SetButtonLabel(B_DEFAULT_BUTTON, B_TRANSLATE("Write")); } if (fWriteImageFilePanel != NULL)