Ticket #7767: Tracker_alert_label_to_verb_3.diff

File Tracker_alert_label_to_verb_3.diff, 5.5 KB (added by jscipione, 12 years ago)

Change instances of %toConfirmAction to %ifYouDoAction where it makes sense to put the name of the action e.g. rename instead of the name of the button label e.g. Rename.

  • src/kits/tracker/FSUtils.cpp

    diff --git src/kits/tracker/FSUtils.cpp src/kits/tracker/FSUtils.cpp
    index 1af1220..916dc65 100644
    bool DirectoryMatches(const BEntry *, const char *additionalPath,  
    135135
    136136status_t empty_trash(void *);
    137137
    138 #ifdef __HAIKU__
    139     #define OS_NAME "Haiku"
    140 #else
    141     #define OS_NAME "BeOS"
    142 #endif
    143 
    144138
    145139static const char* kDeleteConfirmationStr =
    146140    B_TRANSLATE_MARK("Are you sure you want to delete the "
    enum {  
    612606
    613607
    614608bool
    615 ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction,
    616     const char *toDoAction, bool dontAsk, int32 *confirmedAlready)
     609ConfirmChangeIfWellKnownDirectory(const BEntry *entry,
     610    const char *ifYouDoAction, const char *toConfirmAction,
     611    bool dontAsk, int32 *confirmedAlready)
    617612{
    618613    // Don't let the user casually move/change important files/folders
    619614    //
    ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction  
    638633    if (DirectoryMatchesOrContains(entry, B_SYSTEM_DIRECTORY)) {
    639634        warning.SetTo(
    640635            B_TRANSLATE("If you %ifYouDoAction the system folder or its "
    641             "contents, you won't be able to boot " OS_NAME "! Are you sure you "
    642             "want to do this? To %toDoAction the system folder or its contents "
    643             "anyway, hold down the Shift key and click \"Do it\"."));
     636            "contents, you won't be able to boot Haiku! Are you sure you "
     637            "want to do this? To %ifYouDoAction the system folder or its "
     638            "contents anyway, hold down the Shift key and click "
     639            "\"%toConfirmAction\"."));
    644640    } else if (DirectoryMatches(entry, B_COMMON_DIRECTORY)) {
    645641        warning.SetTo(
    646             B_TRANSLATE("If you %ifYouDoAction the common folder, " OS_NAME
    647             " may not behave properly! Are you sure you want to do this? "
    648             "To %toDoAction the common folder anyway, hold down the "
    649             "Shift key and click \"Do it\"."));
     642            B_TRANSLATE("If you %ifYouDoAction the common folder, Haiku "
     643            "may not behave properly! Are you sure you want to do this? "
     644            "To %ifYouDoAction the common folder anyway, hold down the "
     645            "Shift key and click \"%toConfirmAction\"."));
    650646    } else if (DirectoryMatches(entry, B_USER_DIRECTORY)) {
    651647        warning .SetTo(
    652             B_TRANSLATE("If you %ifYouDoAction the home folder, " OS_NAME
    653             " may not behave properly! Are you sure you want to do this? "
    654             "To %toDoAction the home folder anyway, hold down the "
    655             "Shift key and click \"Do it\"."));
     648            B_TRANSLATE("If you %ifYouDoAction the home folder, Haiku "
     649            "may not behave properly! Are you sure you want to do this? "
     650            "To %ifYouDoAction the home folder anyway, hold down the "
     651            "Shift key and click \"%toConfirmAction\"."));
    656652    } else if (DirectoryMatchesOrContains(entry, B_USER_CONFIG_DIRECTORY)
    657653        || DirectoryMatchesOrContains(entry, B_COMMON_SETTINGS_DIRECTORY)) {
    658654
    ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction  
    661657            || DirectoryMatchesOrContains(entry, "beos_mime",
    662658                B_COMMON_SETTINGS_DIRECTORY)) {
    663659            warning.SetTo(
    664                 B_TRANSLATE("If you %ifYouDoAction the mime settings, " OS_NAME
    665                 " may not behave properly! Are you sure you want to do this? "
    666                 "To %toDoAction the mime settings anyway, click \"Do it\"."));
     660                B_TRANSLATE("If you %ifYouDoAction the mime settings, Haiku "
     661                "may not behave properly! Are you sure you want to do this? "
     662                "To %ifYouDoAction the mime settings anyway, click "
     663                "\"%toConfirmAction\"."));
    667664            requireOverride = false;
    668665        } else if (DirectoryMatches(entry, B_USER_CONFIG_DIRECTORY)) {
    669666            warning.SetTo(
    670                 B_TRANSLATE("If you %ifYouDoAction the config folder, " OS_NAME
    671                 " may not behave properly! Are you sure you want to do this? "
    672                 "To %toDoAction the config folder anyway, click \"Do it\"."));
     667                B_TRANSLATE("If you %ifYouDoAction the config folder, Haiku "
     668                "may not behave properly! Are you sure you want to do this? "
     669                "To %ifYouDoAction the config folder anyway, click "
     670                "\"%toConfirmAction\"."));
    673671            requireOverride = false;
    674672        } else if (DirectoryMatches(entry, B_USER_SETTINGS_DIRECTORY)
    675673            || DirectoryMatches(entry, B_COMMON_SETTINGS_DIRECTORY)) {
    676674            warning.SetTo(
    677                 B_TRANSLATE("If you %ifYouDoAction the settings folder, " OS_NAME
    678                 " may not behave properly! Are you sure you want to do this? "
    679                 "To %toDoAction the settings folder anyway, click \"Do it\"."));
     675                B_TRANSLATE("If you %ifYouDoAction the settings folder, Haiku "
     676                "may not behave properly! Are you sure you want to do this? "
     677                "To %ifYouDoAction the settings folder anyway, click "
     678                "\"%toConfirmAction\"."));
    680679            requireOverride = false;
    681680        }
    682681    }
    ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction  
    693692        return true;
    694693
    695694    warning.ReplaceFirst("%ifYouDoAction", ifYouDoAction);
    696     warning.ReplaceFirst("%toDoAction", toDoAction);
     695    warning.ReplaceFirst("%toConfirmAction", toConfirmAction);
     696    warning.ReplaceLast("%toConfirmAction",
     697        BString(toConfirmAction).Capitalize().String());
     698
     699    BString buttonLabel(B_TRANSLATE_COMMENT("%toConfirmAction",
     700        "Action label for the button, e.g. Rename"));
     701    buttonLabel.ReplaceFirst("%toConfirmAction",
     702        BString(toConfirmAction).Capitalize().String());
    697703
    698704    OverrideAlert *alert = new OverrideAlert("", warning.String(),
    699         B_TRANSLATE("Do it"), (requireOverride ? B_SHIFT_KEY : 0),
     705        buttonLabel.String(), (requireOverride ? B_SHIFT_KEY : 0),
    700706        B_TRANSLATE("Cancel"), 0, NULL, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    701707    alert->SetShortcut(1, B_ESCAPE);
    702708    if (alert->Go() == 1) {