diff --git a/src/kits/tracker/FSUtils.cpp b/src/kits/tracker/FSUtils.cpp index 1af1220c2d..a213147687 100644 --- a/src/kits/tracker/FSUtils.cpp +++ b/src/kits/tracker/FSUtils.cpp @@ -135,12 +135,6 @@ bool DirectoryMatches(const BEntry *, const char *additionalPath, status_t empty_trash(void *); -#ifdef __HAIKU__ - #define OS_NAME "Haiku" -#else - #define OS_NAME "BeOS" -#endif - static const char* kDeleteConfirmationStr = B_TRANSLATE_MARK("Are you sure you want to delete the " @@ -612,8 +606,9 @@ enum { bool -ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction, - const char *toDoAction, bool dontAsk, int32 *confirmedAlready) +ConfirmChangeIfWellKnownDirectory(const BEntry *entry, + const char *ifYouDoAction, const char *toDoAction, + const char *toConfirmAction, bool dontAsk, int32 *confirmedAlready) { // Don't let the user casually move/change important files/folders // @@ -638,21 +633,22 @@ ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction if (DirectoryMatchesOrContains(entry, B_SYSTEM_DIRECTORY)) { warning.SetTo( B_TRANSLATE("If you %ifYouDoAction the system folder or its " - "contents, you won't be able to boot " OS_NAME "! Are you sure you " - "want to do this? To %toDoAction the system folder or its contents " - "anyway, hold down the Shift key and click \"Do it\".")); + "contents, you won't be able to boot Haiku! Are you sure you " + "want to do this? To %toDoAction the system folder or its " + "contents anyway, hold down the Shift key and click " + "\"%toConfirmAction\".")); } else if (DirectoryMatches(entry, B_COMMON_DIRECTORY)) { warning.SetTo( - B_TRANSLATE("If you %ifYouDoAction the common folder, " OS_NAME - " may not behave properly! Are you sure you want to do this? " + B_TRANSLATE("If you %ifYouDoAction the common folder, Haiku " + "may not behave properly! Are you sure you want to do this? " "To %toDoAction the common folder anyway, hold down the " - "Shift key and click \"Do it\".")); + "Shift key and click \"%toConfirmAction\".")); } else if (DirectoryMatches(entry, B_USER_DIRECTORY)) { warning .SetTo( - B_TRANSLATE("If you %ifYouDoAction the home folder, " OS_NAME - " may not behave properly! Are you sure you want to do this? " + B_TRANSLATE("If you %ifYouDoAction the home folder, Haiku " + "may not behave properly! Are you sure you want to do this? " "To %toDoAction the home folder anyway, hold down the " - "Shift key and click \"Do it\".")); + "Shift key and click \"%toConfirmAction\".")); } else if (DirectoryMatchesOrContains(entry, B_USER_CONFIG_DIRECTORY) || DirectoryMatchesOrContains(entry, B_COMMON_SETTINGS_DIRECTORY)) { @@ -661,22 +657,25 @@ ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction || DirectoryMatchesOrContains(entry, "beos_mime", B_COMMON_SETTINGS_DIRECTORY)) { warning.SetTo( - B_TRANSLATE("If you %ifYouDoAction the mime settings, " OS_NAME - " may not behave properly! Are you sure you want to do this? " - "To %toDoAction the mime settings anyway, click \"Do it\".")); + B_TRANSLATE("If you %ifYouDoAction the mime settings, Haiku " + "may not behave properly! Are you sure you want to do this? " + "To %toDoAction the mime settings anyway, click " + "\"%toConfirmAction\".")); requireOverride = false; } else if (DirectoryMatches(entry, B_USER_CONFIG_DIRECTORY)) { warning.SetTo( - B_TRANSLATE("If you %ifYouDoAction the config folder, " OS_NAME - " may not behave properly! Are you sure you want to do this? " - "To %toDoAction the config folder anyway, click \"Do it\".")); + B_TRANSLATE("If you %ifYouDoAction the config folder, Haiku " + "may not behave properly! Are you sure you want to do this? " + "To %toDoAction the config folder anyway, click " + "\"%toConfirmAction\".")); requireOverride = false; } else if (DirectoryMatches(entry, B_USER_SETTINGS_DIRECTORY) || DirectoryMatches(entry, B_COMMON_SETTINGS_DIRECTORY)) { warning.SetTo( - B_TRANSLATE("If you %ifYouDoAction the settings folder, " OS_NAME - " may not behave properly! Are you sure you want to do this? " - "To %toDoAction the settings folder anyway, click \"Do it\".")); + B_TRANSLATE("If you %ifYouDoAction the settings folder, Haiku " + "may not behave properly! Are you sure you want to do this? " + "To %toDoAction the settings folder anyway, click " + "\"%toConfirmAction\".")); requireOverride = false; } } @@ -694,9 +693,18 @@ ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction warning.ReplaceFirst("%ifYouDoAction", ifYouDoAction); warning.ReplaceFirst("%toDoAction", toDoAction); + warning.ReplaceFirst("%toConfirmAction", + BString(toConfirmAction).Capitalize().String()); + warning.ReplaceLast("%toConfirmAction", + BString(toConfirmAction).Capitalize().String()); + + BString buttonLabel(B_TRANSLATE_COMMENT("%toConfirmAction", + "Action label for the button, e.g. Rename")); + buttonLabel.ReplaceFirst("%toConfirmAction", + BString(toConfirmAction).Capitalize().String()); OverrideAlert *alert = new OverrideAlert("", warning.String(), - B_TRANSLATE("Do it"), (requireOverride ? B_SHIFT_KEY : 0), + buttonLabel.String(), (requireOverride ? B_SHIFT_KEY : 0), B_TRANSLATE("Cancel"), 0, NULL, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT); alert->SetShortcut(1, B_ESCAPE); if (alert->Go() == 1) { @@ -756,8 +764,14 @@ InitCopy(CopyLoopControl* loopControl, uint32 moveMode, } if (moveMode == kMoveSelectionTo && !ConfirmChangeIfWellKnownDirectory(&entry, - B_TRANSLATE_COMMENT("move", "As in 'If you move ...'"), - B_TRANSLATE_COMMENT("move", "As in 'To move ...'"), + B_TRANSLATE_COMMENT("move", + "As in 'if you move this folder...' (en) " + "'Wird dieser Ordner verschoben...' (de)"), + B_TRANSLATE_COMMENT("move", + "As in 'to move this folder...' (en) " + "Um diesen Ordner zu verschieben...' (de)"), + B_TRANSLATE_COMMENT("move", + "Button label, 'Move' (en), 'Verschieben' (de)"), false, &askOnceOnly)) { return B_ERROR; } diff --git a/src/kits/tracker/FSUtils.h b/src/kits/tracker/FSUtils.h index eb359028b2..d033e0be2b 100644 --- a/src/kits/tracker/FSUtils.h +++ b/src/kits/tracker/FSUtils.h @@ -247,7 +247,8 @@ bool FSIsDeskDir(const BEntry *); // the second one in the "To do action" sentence. bool ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction, const char *toDoAction, - bool dontAsk = false, int32 *confirmedAlready = NULL); + const char *toConfirmAction, bool dontAsk = false, + int32 *confirmedAlready = NULL); bool CheckDevicesEqual(const entry_ref *entry, const Model *targetModel); diff --git a/src/kits/tracker/InfoWindow.cpp b/src/kits/tracker/InfoWindow.cpp index ade064c560..d164af3f61 100644 --- a/src/kits/tracker/InfoWindow.cpp +++ b/src/kits/tracker/InfoWindow.cpp @@ -433,8 +433,14 @@ BInfoWindow::MessageReceived(BMessage *message) BEntry entry(fModel->EntryRef()); if (!fModel->HasLocalizedName() && ConfirmChangeIfWellKnownDirectory(&entry, - B_TRANSLATE_COMMENT("rename", "As in 'If you rename ...'"), - B_TRANSLATE_COMMENT("rename", "As in 'To rename ...'"))) + B_TRANSLATE_COMMENT("rename", + "As in 'if you rename this folder...' (en) " + "'Wird dieser Ordner umbenannt...' (de)"), + B_TRANSLATE_COMMENT("rename", + "As in 'to rename this folder...' (en) " + "'Um diesen Ordner umzubenennen...' (de)"), + B_TRANSLATE_COMMENT("rename", + "Button label, 'Rename' (en), 'Umbenennen' (de)"))); fAttributeView->BeginEditingTitle(); break; } @@ -799,7 +805,8 @@ BInfoWindow::OpenFilePanel(const entry_ref *ref) if (fFilePanel != NULL) { fFilePanel->SetButtonLabel(B_DEFAULT_BUTTON, B_TRANSLATE("Select")); fFilePanel->Window()->ResizeTo(500, 300); - BString title(B_TRANSLATE_COMMENT("Link \"%name\" to:", "File dialog title for new sym link")); + BString title(B_TRANSLATE_COMMENT("Link \"%name\" to:", + "File dialog title for new sym link")); title.ReplaceFirst("%name", fModel->Name()); fFilePanel->Window()->SetTitle(title.String()); fFilePanel->Show(); @@ -1223,9 +1230,15 @@ AttributeView::MouseDown(BPoint point) } else if (fTitleRect.Contains(point)) { if (!fModel->HasLocalizedName() && ConfirmChangeIfWellKnownDirectory(&entry, - B_TRANSLATE_COMMENT("rename", "As in 'If you rename ...'"), - B_TRANSLATE_COMMENT("rename", "As in 'To rename ...'"), true) - && fTitleEditView == 0) + B_TRANSLATE_COMMENT("rename", + "As in 'if you rename this folder...' (en) " + "'Wird dieser Ordner umbenannt...' (de)"), + B_TRANSLATE_COMMENT("rename", + "As in 'to rename this folder...' (en) " + "'Um diesen Ordner umzubenennen...' (de)"), + B_TRANSLATE_COMMENT("rename", + "Button label, 'Rename' (en), 'Umbenennen' (de)"), true) + && fTitleEditView == 0); BeginEditingTitle(); } else if (fTitleEditView) { FinishEditingTitle(true); diff --git a/src/kits/tracker/TextWidget.cpp b/src/kits/tracker/TextWidget.cpp index 8a47fcf9e0..6ebeb1abbd 100644 --- a/src/kits/tracker/TextWidget.cpp +++ b/src/kits/tracker/TextWidget.cpp @@ -324,8 +324,14 @@ BTextWidget::StartEdit(BRect bounds, BPoseView *view, BPose *pose) BEntry entry(pose->TargetModel()->EntryRef()); if (entry.InitCheck() == B_OK && !ConfirmChangeIfWellKnownDirectory(&entry, - B_TRANSLATE_COMMENT("rename", "As in 'If you rename ...'"), - B_TRANSLATE_COMMENT("rename", "As in 'To rename ...'"))) + B_TRANSLATE_COMMENT("rename", + "As in 'if you rename this folder...' (en) " + "'Wird dieser Ordner umbenannt...' (de)"), + B_TRANSLATE_COMMENT("rename", + "As in 'to rename this folder...' (en) " + "'Um diesen Ordner umzubenennen...' (de)"), + B_TRANSLATE_COMMENT("rename", + "Button label, 'Rename' (en), 'Umbenennen' (de)"))) return; // get bounds with full text length