Ticket #5889: PoseView.patch

File PoseView.patch, 8.2 KB (added by mt, 14 years ago)

More PoseView Localization.

  • PoseView.cpp

     
    4343
    4444#include <Alert.h>
    4545#include <Application.h>
     46#include <Catalog.h>
    4647#include <Clipboard.h>
    4748#include <Debug.h>
    4849#include <Dragger.h>
     
    5152#include <Screen.h>
    5253#include <Query.h>
    5354#include <List.h>
     55#include <Locale.h>
    5456#include <MenuItem.h>
    5557#include <NodeMonitor.h>
    5658#include <Path.h>
     
    9395#include "WidthBuffer.h"
    9496
    9597
     98#undef B_TRANSLATE_CONTEXT
     99#define B_TRANSLATE_CONTEXT "libTracker"
     100
    96101using std::min;
    97102using std::max;
    98103
     
    135140    // maximum size of the transparent drag bitmap, use a drag rect
    136141    // if larger in any direction
    137142
    138 const char *kNoCopyToTrashStr = "Sorry, you can't copy items to the Trash.";
    139 const char *kNoLinkToTrashStr = "Sorry, you can't create links in the Trash.";
    140 const char *kNoCopyToRootStr = "You must drop items on one of the disk icons "
    141     "in the \"Disks\" window.";
    142 const char *kOkToMoveStr = "Are you sure you want to move or copy the selected "
    143     "item(s) to this folder?";
    144143
    145144struct AddPosesResult {
    146145    ~AddPosesResult();
     
    574573    if (fColumnList->CountItems() != 0)
    575574        return;
    576575
    577     fColumnList->AddItem(new BColumn("Name", kColumnStart, 145, B_ALIGN_LEFT,
     576    fColumnList->AddItem(new BColumn(B_TRANSLATE("Name"), kColumnStart, 145, B_ALIGN_LEFT,
    578577        kAttrStatName, B_STRING_TYPE, true, true));
    579     fColumnList->AddItem(new BColumn("Size", 200, 80, B_ALIGN_RIGHT,
     578    fColumnList->AddItem(new BColumn(B_TRANSLATE("Size"), 200, 80, B_ALIGN_RIGHT,
    580579        kAttrStatSize, B_OFF_T_TYPE, true, false));
    581     fColumnList->AddItem(new BColumn("Modified", 295, 150, B_ALIGN_LEFT,
     580    fColumnList->AddItem(new BColumn(B_TRANSLATE("Modified"), 295, 150, B_ALIGN_LEFT,
    582581        kAttrStatModified, B_TIME_TYPE, true, false));
    583582
    584583    if (!IsWatchingDateFormatChange())
     
    25102509    if (CountColumns() == 1) {
    25112510        if (runAlert) {
    25122511            BAlert *alert = new BAlert("",
    2513                 "You must have at least one attribute showing.",
    2514                 "Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     2512                B_TRANSLATE("You must have at least one attribute showing."),
     2513                B_TRANSLATE("Cancel"),
     2514                0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    25152515            alert->SetShortcut(0, B_ESCAPE);
    25162516            alert->Go();
    25172517        }
     
    40834083        } else if (types)
    40844084            description = embedTypeAs;
    40854085
    4086         const char *labelText;
    4087         char text[1024];
     4086        BString labelText;
    40884087        if (actionText) {
    40894088            int32 length = 1024 - 1 - (int32)strlen(actionText);
    40904089            if (length > 0) {
    40914090                description.Truncate(length);
    4092                 sprintf(text, actionText, description.String());
    4093                 labelText = text;
     4091                labelText.SetTo(actionText);
     4092                labelText.ReplaceFirst("%s", description.String());
    40944093            } else
    4095                 labelText = "label too long";
     4094                labelText.SetTo(B_TRANSLATE("label too long"));
    40964095        } else
    4097             labelText = description.String();
     4096            labelText = description;
    40984097
    4099         menu->AddItem(new BMenuItem(labelText, 0));
     4098        menu->AddItem(new BMenuItem(labelText.String(), 0));
    41004099    }
    41014100
    41024101    menu->AddSeparatorItem();
    4103     menu->AddItem(new BMenuItem("Cancel", 0));
     4102    menu->AddItem(new BMenuItem(B_TRANSLATE("Cancel"), 0));
    41044103
    41054104    int32 result = -1;
    41064105    BMenuItem *resultingItem = menu->Go(where, false, true);
     
    42544253                        if (specificActionIndex == -1)
    42554254                            return false;
    42564255                    } else if (types.CountItems() > 0) {
    4257                         specificTypeIndex = RunMimeTypeDestinationMenu("Create %s clipping",
     4256                        specificTypeIndex = RunMimeTypeDestinationMenu(
     4257                            B_TRANSLATE("Create %s clipping"),
    42584258                            &types, &typeNames, view->ConvertToScreen(dropPt));
    42594259
    42604260                        if (specificTypeIndex == -1)
     
    47204720    bool okToMove = true;
    47214721
    47224722    if (destFolder->IsRoot()) {
    4723         BAlert *alert = new BAlert("", kNoCopyToRootStr, "Cancel",
     4723        BAlert *alert = new BAlert("",
     4724            B_TRANSLATE("You must drop items on one of the disk icons "
     4725            "in the \"Disks\" window."),
     4726            B_TRANSLATE("Cancel"),
    47244727            NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    47254728        alert->SetShortcut(0, B_ESCAPE);
    47264729        alert->Go();
     
    47294732
    47304733    // can't copy items into the trash
    47314734    if (forceCopy && destIsTrash) {
    4732         BAlert *alert = new BAlert("", kNoCopyToTrashStr, "Cancel",
     4735        BAlert *alert = new BAlert("",
     4736            B_TRANSLATE("Sorry, you can't copy items to the Trash."),
     4737            B_TRANSLATE("Cancel"),
    47334738            NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    47344739        alert->SetShortcut(0, B_ESCAPE);
    47354740        alert->Go();
     
    47384743
    47394744    // can't create symlinks into the trash
    47404745    if (createLink && destIsTrash) {
    4741         BAlert *alert = new BAlert("", kNoLinkToTrashStr, "Cancel",
     4746        BAlert *alert = new BAlert("",
     4747            B_TRANSLATE("Sorry, you can't create links in the Trash."),
     4748            B_TRANSLATE("Cancel"),
    47424749            NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    47434750        alert->SetShortcut(0, B_ESCAPE);
    47444751        alert->Go();
     
    47494756    if (srcWindow->TargetModel()->IsQuery()
    47504757        && !forceCopy && !destIsTrash && !createLink) {
    47514758        srcWindow->UpdateIfNeeded();
    4752         BAlert *alert = new BAlert("", kOkToMoveStr, "Cancel",
    4753             "Move", NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     4759        BAlert *alert = new BAlert("",
     4760            B_TRANSLATE("Are you sure you want to move or copy the selected "
     4761            "item(s) to this folder?"),
     4762            B_TRANSLATE("Cancel"),
     4763            B_TRANSLATE("Move"),
     4764            NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    47544765        alert->SetShortcut(0, B_ESCAPE);
    47554766        okToMove = alert->Go() == 1;
    47564767    }
     
    56105621{
    56115622    BVolume volume (ref->device);
    56125623    if (volume.IsReadOnly()) {
    5613         BAlert *alert = new BAlert ("", "Files cannot be moved or "
    5614             "deleted from a read-only volume.", "Cancel", NULL,
    5615             NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     5624        BAlert *alert = new BAlert ("",
     5625            B_TRANSLATE("Files cannot be moved or "
     5626            "deleted from a read-only volume."),
     5627            B_TRANSLATE("Cancel"),
     5628            NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
    56165629        alert->SetShortcut(0, B_ESCAPE);
    56175630        alert->Go();
    56185631        return false;
     
    56505663    }
    56515664
    56525665    if (entriesToDeleteOnTheSpot->CountItems()) {
    5653         const char *alertText;
     5666        BString alertText;
    56545667        if (ref) {
    5655             alertText = "The selected item cannot be moved to the Trash. "
     5668            alertText.SetTo(B_TRANSLATE("The selected item cannot be moved to the Trash. "
    56565669                "Would you like to delete it instead? (This operation cannot "
    5657                 "be reverted.)";
     5670                "be reverted.)"));
    56585671        } else {
    5659             alertText = "Some of the selected items cannot be moved to the Trash. "
     5672            alertText.SetTo(B_TRANSLATE("Some of the selected items cannot be moved to the Trash. "
    56605673                "Would you like to delete them instead? (This operation cannot "
    5661                 "be reverted.)";
     5674                "be reverted.)"));
    56625675        }
    56635676
    5664         BAlert *alert = new BAlert("", alertText, "Cancel", "Delete");
     5677        BAlert *alert = new BAlert("", alertText.String(),
     5678            B_TRANSLATE("Cancel"),
     5679            B_TRANSLATE("Delete"));
    56655680        alert->SetShortcut(0, B_ESCAPE);
    56665681        if (alert->Go() == 0)
    56675682            return;
     
    59505965
    59515966        if (regExpression.InitCheck() != B_OK) {
    59525967            BString message;
    5953             message << "Error in regular expression:\n\n'";
     5968            message << B_TRANSLATE("Error in regular expression:\n\n'");
    59545969            message << regExpression.ErrorString() << "'";
    5955             (new BAlert("", message.String(), "OK", NULL, NULL, B_WIDTH_AS_USUAL,
     5970            (new BAlert("", message.String(), B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
    59565971                B_STOP_ALERT))->Go();
    59575972            return 0;
    59585973        }
     
    78697884{
    78707885    BMessenger tracker(kTrackerSignature);
    78717886    if (!tracker.IsValid()) {
    7872         BAlert *alert = new BAlert("", "The Tracker must be running "
    7873             "to see Info windows.", "Cancel", NULL, NULL,
    7874             B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     7887        BAlert *alert = new BAlert("",
     7888            B_TRANSLATE("The Tracker must be running to see Info windows."),
     7889            B_TRANSLATE("Cancel"),
     7890            NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    78757891        alert->SetShortcut(0, B_ESCAPE);
    78767892        alert->Go();
    78777893        return;
     
    78857901{
    78867902    BMessenger tracker(kTrackerSignature);
    78877903    if (!tracker.IsValid()) {
    7888         BAlert *alert = new BAlert("", "The Tracker must be running "
    7889             "to see set the default printer.", "Cancel", NULL,
    7890             NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     7904        BAlert *alert = new BAlert("",
     7905            B_TRANSLATE("The Tracker must be running to see set the default printer."),
     7906            B_TRANSLATE("Cancel"),
     7907            NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    78917908        alert->SetShortcut(0, B_ESCAPE);
    78927909        alert->Go();
    78937910        return;