Changeset 1026


Ignore:
Timestamp:
Oct 24, 2006, 8:34:13 PM (15 years ago)
Author:
livings124
Message:

Use localized strings where necessary. Also a fix for the port checker. Thanks to Cédric Luthi for these.

Location:
trunk
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r1021 r1026  
    9393                A2173E1C0A33C1B300B0D8AB /* ActionButtonPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = A2173E1B0A33C1B300B0D8AB /* ActionButtonPressed.png */; };
    9494                A21DFF100A292B2B007C5F76 /* Transfers.png in Resources */ = {isa = PBXBuildFile; fileRef = A21DFF0F0A292B2B007C5F76 /* Transfers.png */; };
     95                A22A8D560AEEAFA5007E9CB9 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A22A8D540AEEAFA5007E9CB9 /* Localizable.strings */; };
    9596                A2305A800A3DC9E400AB2D77 /* ProgressBarWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = A2305A7C0A3DC9E400AB2D77 /* ProgressBarWhite.png */; };
    9697                A2305A810A3DC9E400AB2D77 /* ProgressBarBlue.png in Resources */ = {isa = PBXBuildFile; fileRef = A2305A7D0A3DC9E400AB2D77 /* ProgressBarBlue.png */; };
     
    317318                A2173E1B0A33C1B300B0D8AB /* ActionButtonPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ActionButtonPressed.png; path = macosx/Images/ActionButtonPressed.png; sourceTree = "<group>"; };
    318319                A21DFF0F0A292B2B007C5F76 /* Transfers.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Transfers.png; path = macosx/Images/Transfers.png; sourceTree = "<group>"; };
     320                A22A8D550AEEAFA5007E9CB9 /* English */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.strings; name = English; path = macosx/English.lproj/Localizable.strings; sourceTree = "<group>"; };
    319321                A2305A7C0A3DC9E400AB2D77 /* ProgressBarWhite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarWhite.png; path = macosx/Images/ProgressBarWhite.png; sourceTree = "<group>"; };
    320322                A2305A7D0A3DC9E400AB2D77 /* ProgressBarBlue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarBlue.png; path = macosx/Images/ProgressBarBlue.png; sourceTree = "<group>"; };
     
    497499                        isa = PBXGroup;
    498500                        children = (
     501                                A22A8D540AEEAFA5007E9CB9 /* Localizable.strings */,
    499502                                A259316A0A73B2CC002F4FE7 /* Transmission Help */,
    500503                                A2F8951E0A2D4BA500ED2127 /* Credits.rtf */,
     
    853856                                35B038140AC5B6EC00A10FDF /* ResumeNoWaitOff.png in Resources */,
    854857                                A29C8B330ACC6E93000ED9F9 /* YellowDot.tiff in Resources */,
     858                                A22A8D560AEEAFA5007E9CB9 /* Localizable.strings in Resources */,
    855859                        );
    856860                        runOnlyForDeploymentPostprocessing = 0;
     
    970974                        sourceTree = "<group>";
    971975                };
     976                A22A8D540AEEAFA5007E9CB9 /* Localizable.strings */ = {
     977                        isa = PBXVariantGroup;
     978                        children = (
     979                                A22A8D550AEEAFA5007E9CB9 /* English */,
     980                        );
     981                        name = Localizable.strings;
     982                        sourceTree = "<group>";
     983                };
    972984                A2912C520A2956E80097A0CA /* PrefsWindow.nib */ = {
    973985                        isa = PBXVariantGroup;
  • trunk/macosx/Controller.m

    r1024 r1026  
    202202    }
    203203
    204     [fActionButton setToolTip: @"Shortcuts for changing global settings."];
    205     [fSpeedLimitButton setToolTip: @"Speed Limit overrides the total bandwidth limits with its own limits."];
     204    [fActionButton setToolTip: NSLocalizedString(@"Shortcuts for changing global settings.", "Main window -> 1st bottom left button (action) tooltip")];
     205    [fSpeedLimitButton setToolTip: NSLocalizedString(@"Speed Limit overrides the total bandwidth limits with its own limits.", "Main window -> 2nd bottom left button (turtle) tooltip")];
    206206
    207207    [fTableView setTorrents: fDisplayedTorrents];
     
    278278   
    279279    //set upload limit action button
    280     [fUploadLimitItem setTitle: [NSString stringWithFormat: @"Limit (%d KB/s)",
     280    [fUploadLimitItem setTitle: [NSString stringWithFormat: NSLocalizedString(@"Limit (%d KB/s)", "Action context menu -> upload limit"),
    281281                    [fDefaults integerForKey: @"UploadLimit"]]];
    282282    if ([fDefaults boolForKey: @"CheckUpload"])
     
    286286
    287287        //set download limit action menu
    288     [fDownloadLimitItem setTitle: [NSString stringWithFormat: @"Limit (%d KB/s)",
     288    [fDownloadLimitItem setTitle: [NSString stringWithFormat: NSLocalizedString(@"Limit (%d KB/s)", "Action context menu -> download limit"),
    289289                    [fDefaults integerForKey: @"DownloadLimit"]]];
    290290    if ([fDefaults boolForKey: @"CheckDownload"])
     
    294294   
    295295    //set ratio action menu
    296     [fRatioSetItem setTitle: [NSString stringWithFormat: @"Stop at Ratio (%.2f)",
     296    [fRatioSetItem setTitle: [NSString stringWithFormat: NSLocalizedString(@"Stop at Ratio (%.2f)", "Action context menu -> ratio stop"),
    297297                                [fDefaults floatForKey: @"RatioLimit"]]];
    298298    if ([fDefaults boolForKey: @"RatioCheck"])
     
    395395        {
    396396            NSString * message = active == 1
    397                 ? @"There is an active transfer. Do you really want to quit?"
     397                ? NSLocalizedString(@"There is an active transfer. Do you really want to quit?", "Confirm Quit panel -> message")
    398398                : [NSString stringWithFormat:
    399                     @"There are %d active transfers. Do you really want to quit?", active];
    400 
    401             NSBeginAlertSheet(@"Confirm Quit", @"Quit", @"Cancel", nil, fWindow, self,
     399                    NSLocalizedString(@"There are %d active transfers. Do you really want to quit?", "Confirm Quit panel -> message"), active];
     400
     401            NSBeginAlertSheet(NSLocalizedString(@"Confirm Quit", "Confirm Quit panel -> title"), NSLocalizedString(@"Quit", "Confirm Quit panel -> button"), NSLocalizedString(@"Cancel", "Confirm Quit panel -> button"), nil, fWindow, self,
    402402                                @selector(quitSheetDidEnd:returnCode:contextInfo:), nil, nil, message);
    403403            return NSTerminateLater;
     
    542542    [panel setCanChooseDirectories: YES];
    543543
    544     [panel setMessage: [NSString stringWithFormat: @"Select the download folder for \"%@\"", [torrent name]]];
     544    [panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the download folder for \"%@\"", "Open torrent -> select destination folder"), [torrent name]]];
    545545   
    546546    NSDictionary * dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: torrent, @"Torrent", files, @"Files", nil];
     
    726726            if (selected == 1)
    727727            {
    728                 title = [NSString stringWithFormat: @"Comfirm Removal of \"%@\"",
     728                title = [NSString stringWithFormat: NSLocalizedString(@"Confirm Removal of \"%@\"", "Removal confirm panel -> title"),
    729729                            [[fDisplayedTorrents objectAtIndex: [fTableView selectedRow]] name]];
    730                 message = @"This transfer is active."
     730                message = NSLocalizedString(@"This transfer is active."
    731731                            " Once removed, continuing the transfer will require the torrent file."
    732                             " Do you really want to remove it?";
     732                            " Do you really want to remove it?", "Removal confirm panel -> message");
    733733            }
    734734            else
    735735            {
    736                 title = [NSString stringWithFormat: @"Comfirm Removal of %d Transfers", selected];
     736                title = [NSString stringWithFormat: NSLocalizedString(@"Confirm Removal of %d Transfers", "Removal confirm panel -> title"), selected];
    737737                if (selected == active)
    738                     message = [NSString stringWithFormat: @"There are %d active transfers.", active];
     738                    message = [NSString stringWithFormat: NSLocalizedString(@"There are %d active transfers.", "Removal confirm panel -> message part 1"), active];
    739739                else
    740                     message = [NSString stringWithFormat: @"There are %d transfers (%d active).", selected, active];
     740                    message = [NSString stringWithFormat: NSLocalizedString(@"There are %d transfers (%d active).", "Removal confirm panel -> message part 1"), selected, active];
    741741                message = [message stringByAppendingString:
    742                     @" Once removed, continuing the transfers will require the torrent files."
    743                     " Do you really want to remove them?"];
     742                    NSLocalizedString(@" Once removed, continuing the transfers will require the torrent files."
     743                    " Do you really want to remove them?", "Removal confirm panel -> message part 2")];
    744744            }
    745745
    746             NSBeginAlertSheet(title, @"Remove", @"Cancel", nil, fWindow, self,
     746            NSBeginAlertSheet(title, NSLocalizedString(@"Remove", "Removal confirm panel -> button"), NSLocalizedString(@"Cancel", "Removal confirm panel -> button"), nil, fWindow, self,
    747747                nil, @selector(removeSheetDidEnd:returnCode:contextInfo:), dict, message);
    748748            return;
     
    865865    {
    866866        NSAlert * alert = [[NSAlert alloc] init];
    867         [alert addButtonWithTitle: @"OK"];
    868         [alert setMessageText: [NSString stringWithFormat: @"Copy of \"%@\" Cannot Be Created", [torrent name]]];
     867        [alert addButtonWithTitle: NSLocalizedString(@"OK", "Torrent file copy alert -> button")];
     868        [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Copy of \"%@\" Cannot Be Created", "Torrent file copy alert -> title"), [torrent name]]];
    869869        [alert setInformativeText: [NSString stringWithFormat:
    870                 @"The torrent file (%@) cannot be found.", [torrent torrentLocation]]];
     870                NSLocalizedString(@"The torrent file (%@) cannot be found.", "Torrent file copy alert -> message"), [torrent torrentLocation]]];
    871871        [alert setAlertStyle: NSWarningAlertStyle];
    872872       
     
    961961    if (![fStatusBar isHidden])
    962962    {
    963         [fTotalDLField setStringValue: [@"Total DL: " stringByAppendingString: [NSString stringForSpeed: downloadRate]]];
    964         [fTotalULField setStringValue: [@"Total UL: " stringByAppendingString: [NSString stringForSpeed: uploadRate]]];
     963        [fTotalDLField setStringValue: [NSLocalizedString(@"Total DL: ", "Status bar -> total download") stringByAppendingString: [NSString stringForSpeed: downloadRate]]];
     964        [fTotalULField setStringValue: [NSLocalizedString(@"Total UL: ", "Status bar -> total upload") stringByAppendingString: [NSString stringForSpeed: uploadRate]]];
    965965    }
    966966
     
    987987    }
    988988
    989     [GrowlApplicationBridge notifyWithTitle: @"Download Complete" description: [torrent name]
     989    [GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Download Complete", "Growl notification title") description: [torrent name]
    990990        notificationName: GROWL_DOWNLOAD_COMPLETE iconData: nil priority: 0 isSticky: NO clickContext: nil];
    991991
     
    12291229   
    12301230    int totalCount = [fTorrents count];
    1231     [totalTorrentsString appendFormat: @"%d Transfer%s", totalCount, totalCount == 1 ? "" : "s"];
     1231    if (totalCount > 1)
     1232        [totalTorrentsString appendFormat: NSLocalizedString(@"%d Transfers", "Status bar transfer count"), totalCount];
     1233    else
     1234        [totalTorrentsString appendFormat: NSLocalizedString(@"%d Transfer", "Status bar transfer count"), totalCount];
    12321235   
    12331236    [fTotalTorrentsField setStringValue: totalTorrentsString];
     
    13351338       
    13361339        [GrowlApplicationBridge notifyWithTitle: fSpeedLimitEnabled
    1337             ? @"Speed Limit Auto Enabled" : @"Speed Limit Auto Disabled"
    1338             description: @"Bandwidth settings changed"
     1340                ? NSLocalizedString(@"Speed Limit Auto Enabled", "Growl notification title")
     1341                : NSLocalizedString(@"Speed Limit Auto Disabled", "Growl notification title")
     1342            description: NSLocalizedString(@"Bandwidth settings changed", "Growl notification description")
    13391343            notificationName: GROWL_AUTO_SPEED_LIMIT iconData: nil priority: 0 isSticky: NO clickContext: nil];
    13401344    }
     
    13731377    [noLimitItem setState: !enable ? NSOnState : NSOffState];
    13741378   
    1375     [limitItem setTitle: [NSString stringWithFormat: @"Limit (%d KB/s)",
     1379    [limitItem setTitle: [NSString stringWithFormat: NSLocalizedString(@"Limit (%d KB/s)", "Action context menu -> upload/download limit"),
    13761380                            [[dict objectForKey: @"Limit"] intValue]]];
    13771381
     
    13971401    [fRatioNotSetItem setState: !enable ? NSOnState : NSOffState];
    13981402   
    1399     [fRatioSetItem setTitle: [NSString stringWithFormat: @"Stop at Ratio (%.2f)",
     1403    [fRatioSetItem setTitle: [NSString stringWithFormat: NSLocalizedString(@"Stop at Ratio (%.2f)", "Action context menu -> ratio stop"),
    14001404                            [[dict objectForKey: @"Ratio"] floatValue]]];
    14011405
     
    14881492    }
    14891493   
    1490     [GrowlApplicationBridge notifyWithTitle: @"Seeding Complete" description: [[notification object] name]
     1494    [GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Seeding Complete", "Growl notification title") description: [[notification object] name]
    14911495        notificationName: GROWL_SEEDING_COMPLETE iconData: nil priority: 0 isSticky: NO clickContext: nil];
    14921496}
     
    15981602            //import only actually happened if the torrent array is larger
    15991603            if (oldCount < [fTorrents count])
    1600                 [GrowlApplicationBridge notifyWithTitle: @"Torrent File Auto Added" description: file
     1604                [GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Torrent File Auto Added", "Growl notification title") description: file
    16011605                    notificationName: GROWL_AUTO_ADD iconData: nil priority: 0 isSticky: NO clickContext: nil];
    16021606        }
     
    19131917    if ([ident isEqualToString: TOOLBAR_OPEN])
    19141918    {
    1915         [item setLabel: @"Open"];
    1916         [item setPaletteLabel: @"Open Torrent Files"];
    1917         [item setToolTip: @"Open torrent files"];
     1919        [item setLabel: NSLocalizedString(@"Open", "Open toolbar item -> label")];
     1920        [item setPaletteLabel: NSLocalizedString(@"Open Torrent Files", "Open toolbar item -> palette label")];
     1921        [item setToolTip: NSLocalizedString(@"Open torrent files", "Open toolbar item -> tooltip")];
    19181922        [item setImage: [NSImage imageNamed: @"Open.png"]];
    19191923        [item setTarget: self];
     
    19221926    else if ([ident isEqualToString: TOOLBAR_REMOVE])
    19231927    {
    1924         [item setLabel: @"Remove"];
    1925         [item setPaletteLabel: @"Remove Selected"];
    1926         [item setToolTip: @"Remove selected transfers"];
     1928        [item setLabel: NSLocalizedString(@"Remove", "Remove toolbar item -> label")];
     1929        [item setPaletteLabel: NSLocalizedString(@"Remove Selected", "Remove toolbar item -> palette label")];
     1930        [item setToolTip: NSLocalizedString(@"Remove selected transfers", "Remove toolbar item -> tooltip")];
    19271931        [item setImage: [NSImage imageNamed: @"Remove.png"]];
    19281932        [item setTarget: self];
     
    19311935    else if ([ident isEqualToString: TOOLBAR_INFO])
    19321936    {
    1933         [item setLabel: @"Inspector"];
    1934         [item setPaletteLabel: @"Toggle Inspector"];
    1935         [item setToolTip: @"Toggle the torrent inspector"];
     1937        [item setLabel: NSLocalizedString(@"Inspector", "Inspector toolbar item -> label")];
     1938        [item setPaletteLabel: NSLocalizedString(@"Toggle Inspector", "Inspector toolbar item -> palette label")];
     1939        [item setToolTip: NSLocalizedString(@"Toggle the torrent inspector", "Inspector toolbar item -> tooltip")];
    19361940        [item setImage: [NSImage imageNamed: @"Info.png"]];
    19371941        [item setTarget: self];
     
    19401944    else if ([ident isEqualToString: TOOLBAR_PAUSE_ALL])
    19411945    {
    1942         [item setLabel: @"Pause All"];
     1946        [item setLabel: NSLocalizedString(@"Pause All", "Pause All toolbar item -> label")];
    19431947        [item setPaletteLabel: [item label]];
    1944         [item setToolTip: @"Pause all transfers"];
     1948        [item setToolTip: NSLocalizedString(@"Pause all transfers", "Pause All toolbar item -> tooltip")];
    19451949        [item setImage: [NSImage imageNamed: @"PauseAll.png"]];
    19461950        [item setTarget: self];
     
    19491953    else if ([ident isEqualToString: TOOLBAR_RESUME_ALL])
    19501954    {
    1951         [item setLabel: @"Resume All"];
     1955        [item setLabel: NSLocalizedString(@"Resume All", "Resume All toolbar item -> label")];
    19521956        [item setPaletteLabel: [item label]];
    1953         [item setToolTip: @"Resume all transfers"];
     1957        [item setToolTip: NSLocalizedString(@"Resume all transfers", "Resume All toolbar item -> tooltip")];
    19541958        [item setImage: [NSImage imageNamed: @"ResumeAll.png"]];
    19551959        [item setTarget: self];
     
    19581962    else if ([ident isEqualToString: TOOLBAR_PAUSE_SELECTED])
    19591963    {
    1960         [item setLabel: @"Pause"];
    1961         [item setPaletteLabel: @"Pause Selected"];
    1962         [item setToolTip: @"Pause selected transfers"];
     1964        [item setLabel: NSLocalizedString(@"Pause", "Pause toolbar item -> label")];
     1965        [item setPaletteLabel: NSLocalizedString(@"Pause Selected", "Pause toolbar item -> palette label")];
     1966        [item setToolTip: NSLocalizedString(@"Pause selected transfers", "Pause toolbar item -> tooltip")];
    19631967        [item setImage: [NSImage imageNamed: @"PauseSelected.png"]];
    19641968        [item setTarget: self];
     
    19671971    else if ([ident isEqualToString: TOOLBAR_RESUME_SELECTED])
    19681972    {
    1969         [item setLabel: @"Resume"];
    1970         [item setPaletteLabel: @"Resume Selected"];
    1971         [item setToolTip: @"Resume selected transfers"];
     1973        [item setLabel: NSLocalizedString(@"Resume", "Resume toolbar item -> label")];
     1974        [item setPaletteLabel: NSLocalizedString(@"Resume Selected", "Resume toolbar item -> palette label")];
     1975        [item setToolTip: NSLocalizedString(@"Resume selected transfers", "Resume toolbar item -> tooltip")];
    19721976        [item setImage: [NSImage imageNamed: @"ResumeSelected.png"]];
    19731977        [item setTarget: self];
     
    19761980    else if ([ident isEqualToString: TOOLBAR_FILTER])
    19771981    {
    1978         [item setLabel: @"Filter"];
    1979         [item setPaletteLabel: @"Toggle Filter"];
    1980         [item setToolTip: @"Toggle the filter bar"];
     1982        [item setLabel: NSLocalizedString(@"Filter", "Filter toolbar item -> label")];
     1983        [item setPaletteLabel: NSLocalizedString(@"Toggle Filter", "Filter toolbar item -> palette label")];
     1984        [item setToolTip: NSLocalizedString(@"Toggle the filter bar", "Filter toolbar item -> tooltip")];
    19811985        [item setImage: [NSImage imageNamed: @"Filter.png"]];
    19821986        [item setTarget: self];
     
    20972101    if (action == @selector(showInfo:))
    20982102    {
    2099         NSString * title = [[fInfoController window] isVisible] ? @"Hide Inspector" : @"Show Inspector";
     2103        NSString * title = [[fInfoController window] isVisible] ? NSLocalizedString(@"Hide Inspector", "View menu -> Inspector") : NSLocalizedString(@"Show Inspector", "View menu -> Inspector");
    21002104        if (![[menuItem title] isEqualToString: title])
    21012105                [menuItem setTitle: title];
     
    21112115    if (action == @selector(toggleStatusBar:))
    21122116    {
    2113         NSString * title = [fStatusBar isHidden] ? @"Show Status Bar" : @"Hide Status Bar";
     2117        NSString * title = [fStatusBar isHidden] ? NSLocalizedString(@"Show Status Bar", "View menu -> Status Bar") : NSLocalizedString(@"Hide Status Bar", "View menu -> Status Bar");
    21142118        if (![[menuItem title] isEqualToString: title])
    21152119            [menuItem setTitle: title];
     
    21212125    if (action == @selector(toggleFilterBar:))
    21222126    {
    2123         NSString * title = [fFilterBar isHidden] ? @"Show Filter Bar" : @"Hide Filter Bar";
     2127        NSString * title = [fFilterBar isHidden] ? NSLocalizedString(@"Show Filter Bar", "View menu -> Filter Bar") : NSLocalizedString(@"Hide Filter Bar", "View menu -> Filter Bar");
    21242128        if (![[menuItem title] isEqualToString: title])
    21252129            [menuItem setTitle: title];
  • trunk/macosx/InfoWindowController.m

    r1025 r1026  
    123123        if (numberSelected > 0)
    124124        {
    125             [fNameField setStringValue: [NSString stringWithFormat: @"%d Torrents Selected", numberSelected]];
     125            [fNameField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d Torrents Selected", "Inspector -> above tabs -> selected torrents"), numberSelected]];
    126126       
    127127            uint64_t size = 0;
     
    131131                size += [torrent size];
    132132           
    133             [fSizeField setStringValue: [[NSString stringForFileSize: size] stringByAppendingString: @" Total"]];
     133            [fSizeField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%@ Total", "Inspector -> above tabs -> total size (several torrents selected)"), [NSString stringForFileSize: size]]];
    134134        }
    135135        else
    136136        {
    137             [fNameField setStringValue: @"No Torrents Selected"];
     137            [fNameField setStringValue: NSLocalizedString(@"No Torrents Selected", "Inspector -> above tabs -> selected torrents")];
    138138            [fSizeField setStringValue: @""];
    139 
     139   
    140140            [fDownloadedValidField setStringValue: @""];
    141141            [fDownloadedTotalField setStringValue: @""];
     
    242242        while ((torrent = [enumerator nextObject]))
    243243            [fFiles addObjectsFromArray: [torrent fileList]];
    244    
    245         [fFileTableStatusField setStringValue: [NSString stringWithFormat: @"%d file%s", [fFiles count],
    246                                                 [fFiles count] == 1 ? "" : "s"]];
    247     }
    248     else
    249         [fFileTableStatusField setStringValue: @"info not available"];
     244       
     245        if ([fFiles count] > 1)
     246            [fFileTableStatusField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d files", "Inspector -> Files tab -> bottom text (number of files)"), [fFiles count]]];
     247        else
     248            [fFileTableStatusField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d file", "Inspector -> Files tab -> bottom text (number of files)"), [fFiles count]]];
     249    }
     250    else
     251        [fFileTableStatusField setStringValue: NSLocalizedString(@"info not available", "Inspector -> Files tab -> bottom text (number of files)")];
    250252   
    251253    [fFileTable deselectAll: nil];
     
    312314   
    313315    BOOL active = [torrent isActive];
    314     [fConnectedPeersField setStringValue: active ? [NSString stringWithFormat: @"%d (%d incoming)",
     316    [fConnectedPeersField setStringValue: active ? [NSString stringWithFormat: NSLocalizedString(@"%d (%d incoming)", "Inspector -> Peers tab -> connected"),
    315317                                                    [torrent totalPeers], [torrent totalPeersIncoming]]: @""];
    316318    [fDownloadingFromField setStringValue: active ? [NSString stringWithInt: [torrent peersUploading]] : @""];
     
    526528        NSDictionary * file = [fFiles objectAtIndex: row];
    527529        if ([[column identifier] isEqualToString: @"Size"])
    528             return [[[file objectForKey: @"Size"] stringValue] stringByAppendingString: @" bytes"];
     530            return [[[file objectForKey: @"Size"] stringValue] stringByAppendingString: NSLocalizedString(@" bytes", "Inspector -> Files tab -> table row tooltip")];
    529531        else
    530532            return [file objectForKey: @"Name"];
    531533    }
    532534    else if (tableView == fPeerTable)
    533         return [NSString stringWithFormat: @"From %@ connection",
    534                 [[[fPeers objectAtIndex: row] objectForKey: @"Incoming"] boolValue] ? @"incoming" : @"outgoing"];
     535    {
     536        if ([[[fPeers objectAtIndex: row] objectForKey: @"Incoming"] boolValue])
     537            return NSLocalizedString(@"From incoming connection", "Inspector -> Peers tab -> table row tooltip");
     538        else
     539            return NSLocalizedString(@"From outgoing connection", "Inspector -> Peers tab -> table row tooltip");
     540    }
    535541    else
    536542        return nil;
  • trunk/macosx/MessageWindowController.m

    r1025 r1026  
    175175    [panel setCanSelectHiddenExtension: YES];
    176176   
    177     [panel beginSheetForDirectory: nil file: @"untitled" modalForWindow: [self window] modalDelegate: self
     177    [panel beginSheetForDirectory: nil file: NSLocalizedString(@"untitled", "Save log panel -> default file name") modalForWindow: [self window] modalDelegate: self
    178178        didEndSelector: @selector(writeToFileSheetClosed:returnCode:contextInfo:) contextInfo: string];
    179179}
     
    186186        {
    187187            NSAlert * alert = [[NSAlert alloc] init];
    188             [alert addButtonWithTitle: @"OK"];
    189             [alert setMessageText: [NSString stringWithFormat: @"Log Could Not Be Saved"]];
     188            [alert addButtonWithTitle: NSLocalizedString(@"OK", "Save log alert panel -> button")];
     189            [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Log Could Not Be Saved", "Save log alert panel -> title")]];
    190190            [alert setInformativeText: [NSString stringWithFormat:
    191                     @"There was a problem creating the file \"%@\".", [[panel filename] lastPathComponent]]];
     191                    NSLocalizedString(@"There was a problem creating the file \"%@\".", "Save log alert panel -> message"), [[panel filename] lastPathComponent]]];
    192192            [alert setAlertStyle: NSWarningAlertStyle];
    193193           
  • trunk/macosx/PiecesView.m

    r1021 r1026  
    136136       
    137137        [fImageView setToolTip: [[NSUserDefaults standardUserDefaults] boolForKey: @"PiecesViewShowAvailability"]
    138                             ? @"Piece Availability" : @"Piece Progress"];
     138                            ? NSLocalizedString(@"Piece Availability", "Inspector -> Activity -> detailed pieces view tooltip")
     139                            : NSLocalizedString(@"Piece Progress", "Inspector -> Activity -> detailed pieces view tooltip")];
    139140       
    140141        //actually draw the box
     
    383384    [defaults setBool: showAvailability forKey: @"PiecesViewShowAvailability"];
    384385   
    385     [fImageView setToolTip: showAvailability ? @"Piece Availability" : @"Piece Progress"];
     386    [fImageView setToolTip: showAvailability ? NSLocalizedString(@"Piece Availability", "Inspector -> Activity -> detailed pieces view tooltip")
     387                                             : NSLocalizedString(@"Piece Progress", "Inspector -> Activity -> detailed pieces view tooltip")];
    386388   
    387389    [self updateView: YES];
  • trunk/macosx/PortChecker.m

    r958 r1026  
    9696        if ([nodes count] != 1)
    9797        {
    98             NSLog(@"Unable to get port status: invalid (outdated) XPath expression");
    99             [self callBackWithStatus: PORT_STATUS_ERROR];
     98            NSArray * title = [shieldsUpProbe nodesForXPath: @"/html/head/title" error: nil];
     99            // This may happen when we probe twice too quickly
     100            if ([title count] > 1 || ![[[title objectAtIndex: 0] stringValue] isEqualToString:
     101                                                                    @"NanoProbe System Already In Use"])
     102            {
     103                NSLog(@"Unable to get port status: invalid (outdated) XPath expression");
     104                [[shieldsUpProbe XMLData] writeToFile: @"/tmp/shieldsUpProbe.html" atomically: YES];
     105                [self callBackWithStatus: PORT_STATUS_ERROR];
     106            }
    100107        }
    101108        else
  • trunk/macosx/PrefsController.m

    r1025 r1026  
    3838#define UPDATE_NEVER    2
    3939
    40 #define TOOLBAR_GENERAL     @"General"
    41 #define TOOLBAR_TRANSFERS   @"Transfers"
    42 #define TOOLBAR_BANDWIDTH   @"Bandwidth"
    43 #define TOOLBAR_NETWORK     @"Network"
     40#define TOOLBAR_GENERAL     NSLocalizedString(@"General", "Preferences -> General toolbar item title")
     41#define TOOLBAR_TRANSFERS   NSLocalizedString(@"Transfers", "Preferences -> Transfers toolbar item title")
     42#define TOOLBAR_BANDWIDTH   NSLocalizedString(@"Bandwidth", "Preferences -> Bandwidth toolbar item title")
     43#define TOOLBAR_NETWORK     NSLocalizedString(@"Network", "Preferences -> Network toolbar item title")
    4444
    4545@interface PrefsController (Private)
     
    378378        PortChecker * checker = [[PortChecker alloc] initWithDelegate: self];
    379379
    380         [fPortStatusField setStringValue: [@"Checking port status" stringByAppendingEllipsis]];
     380        [fPortStatusField setStringValue: [NSLocalizedString(@"Checking port status", "Preferences -> Network -> port status") stringByAppendingEllipsis]];
    381381        [fPortStatusProgress startAnimation: self];
    382382       
     
    391391    {
    392392        case PORT_STATUS_OPEN:
    393             [fPortStatusField setStringValue: @"Port is open"];
     393            [fPortStatusField setStringValue: NSLocalizedString(@"Port is open", "Preferences -> Network -> port status")];
    394394            [fPortStatusImage setImage: [NSImage imageNamed: @"GreenDot.tiff"]];
    395395            break;
    396396        case PORT_STATUS_STEALTH:
    397             [fPortStatusField setStringValue: @"Port is stealth"];
     397            [fPortStatusField setStringValue: NSLocalizedString(@"Port is stealth", "Preferences -> Network -> port status")];
    398398            [fPortStatusImage setImage: [NSImage imageNamed: @"RedDot.tiff"]];
    399399            break;
    400400        case PORT_STATUS_CLOSED:
    401             [fPortStatusField setStringValue: @"Port is closed"];
     401            [fPortStatusField setStringValue: NSLocalizedString(@"Port is closed", "Preferences -> Network -> port status")];
    402402            [fPortStatusImage setImage: [NSImage imageNamed: @"RedDot.tiff"]];
    403403            break;
    404404        case PORT_STATUS_ERROR:
    405             [fPortStatusField setStringValue: @"Unable to check port status"];
     405            [fPortStatusField setStringValue: NSLocalizedString(@"Unable to check port status", "Preferences -> Network -> port status")];
    406406            [fPortStatusImage setImage: [NSImage imageNamed: @"YellowDot.tiff"]];
    407407            break;
     
    428428    if (status == 2)
    429429    {
    430         [fNatStatusField setStringValue: @"Port successfully mapped"];
     430        [fNatStatusField setStringValue: NSLocalizedString(@"Port successfully mapped", "Preferences -> Network -> port map status")];
    431431        [fNatStatusImage setImage: [NSImage imageNamed: @"GreenDot.tiff"]];
    432432    }
    433433    else if (status == 3 || status == 4)
    434434    {
    435         [fNatStatusField setStringValue: @"Error mapping port"];
     435        [fNatStatusField setStringValue: NSLocalizedString(@"Error mapping port", "Preferences -> Network -> port map status")];
    436436        [fNatStatusImage setImage: [NSImage imageNamed: @"RedDot.tiff"]];
    437437    }
  • trunk/macosx/StringAdditions.m

    r839 r1026  
    4545{
    4646    if (size < 1024)
    47         return [NSString stringWithFormat: @"%lld bytes", size];
     47        return [NSString stringWithFormat: NSLocalizedString(@"%lld bytes", "File size"), size];
    4848
    4949    float convertedSize = (float) size;
     
    5252    {
    5353        convertedSize /= 1024.0;
    54         unit = @" KB";
     54        unit = NSLocalizedString(@" KB", "File size (beware of leading space)");
    5555    }
    5656    else if (size < 1073741824)
    5757    {
    5858        convertedSize /= 1048576.0;
    59         unit = @" MB";
     59        unit = NSLocalizedString(@" MB", "File size (beware of leading space)");
    6060    }
    6161    else
    6262    {
    6363        convertedSize /= 1073741824.0;
    64         unit = @" GB";
     64        unit = NSLocalizedString(@" GB", "File size (beware of leading space)");
    6565    }
    6666
     
    7979+ (NSString *) stringForSpeed: (float) speed
    8080{
    81     return [[self stringForSpeedAbbrev: speed] stringByAppendingString: @"B/s"];
     81    return [[self stringForSpeedAbbrev: speed] stringByAppendingString: NSLocalizedString(@"B/s", "Transfer speed (Bytes per second)")];
    8282}
    8383
  • trunk/macosx/Torrent.m

    r1010 r1026  
    194194    [fProgressString setString: @""];
    195195    if ([self progress] < 1.0)
    196         [fProgressString appendFormat: @"%@ of %@ (%.2f%%)", [NSString stringForFileSize:
     196        [fProgressString appendFormat: NSLocalizedString(@"%@ of %@ (%.2f%%)", "Torrent -> progress string"), [NSString stringForFileSize:
    197197                [self downloadedValid]], [NSString stringForFileSize: [self size]], 100.0 * [self progress]];
    198198    else
    199         [fProgressString appendFormat: @"%@, uploaded %@ (Ratio: %@)", [NSString stringForFileSize:
     199        [fProgressString appendFormat: NSLocalizedString(@"%@, uploaded %@ (Ratio: %@)", "Torrent -> progress string"), [NSString stringForFileSize:
    200200                [self size]], [NSString stringForFileSize: [self uploadedTotal]],
    201201                [NSString stringForRatioWithDownload: [self downloadedTotal] upload: [self uploadedTotal]]];
     
    207207        case TR_STATUS_PAUSE:
    208208            if (fFinishedSeeding)
    209                 tempString = @"Seeding complete";
     209                tempString = NSLocalizedString(@"Seeding complete", "Torrent -> status string");
    210210            else if (fWaitToStart)
    211                 tempString = [@"Waiting to start" stringByAppendingEllipsis];
     211                tempString = [NSLocalizedString(@"Waiting to start", "Torrent -> status string") stringByAppendingEllipsis];
    212212            else
    213                 tempString = @"Paused";
     213                tempString = NSLocalizedString(@"Paused", "Torrent -> status string");
    214214           
    215215            [fStatusString setString: tempString];
     
    219219
    220220        case TR_STATUS_CHECK:
    221             tempString = [@"Checking existing files" stringByAppendingEllipsis];
     221            tempString = [NSLocalizedString(@"Checking existing files", "Torrent -> status string") stringByAppendingEllipsis];
    222222           
    223223            [fStatusString setString: tempString];
     
    229229        case TR_STATUS_DOWNLOAD:
    230230            [fStatusString setString: @""];
    231             [fStatusString appendFormat:
    232                 @"Downloading from %d of %d peer%s", [self peersUploading], [self totalPeers],
    233                 [self totalPeers] == 1 ? "" : "s"];
     231            if ([self totalPeers] > 1)
     232                [fStatusString appendFormat: NSLocalizedString(@"Downloading from %d of %d peers", "Torrent -> status string"), [self peersUploading], [self totalPeers]];
     233            else
     234                [fStatusString appendFormat: NSLocalizedString(@"Downloading from %d of %d peer", "Torrent -> status string"), [self peersUploading], [self totalPeers]];
    234235           
    235236            [fRemainingTimeString setString: @""];
     
    237238            if (eta < 0)
    238239            {
    239                 [fRemainingTimeString setString: @"Unknown"];
    240                 [fProgressString appendString: @" - remaining time unknown"];
     240                [fRemainingTimeString setString: NSLocalizedString(@"Unknown", "Torrent -> remaining time")];
     241                [fProgressString appendString: NSLocalizedString(@" - remaining time unknown", "Torrent -> progress string")];
    241242            }
    242243            else
    243244            {
    244245                if (eta < 60)
    245                     [fRemainingTimeString appendFormat: @"%d sec", eta];
     246                    [fRemainingTimeString appendFormat: NSLocalizedString(@"%d sec", "Torrent -> remaining time"), eta];
    246247                else if (eta < 3600) //60 * 60
    247                     [fRemainingTimeString appendFormat: @"%d min %02d sec", eta / 60, eta % 60];
     248                    [fRemainingTimeString appendFormat: NSLocalizedString(@"%d min %02d sec", "Torrent -> remaining time"), eta / 60, eta % 60];
    248249                else if (eta < 86400) //24 * 60 * 60
    249                     [fRemainingTimeString appendFormat: @"%d hr %02d min", eta / 3600, (eta / 60) % 60];
     250                    [fRemainingTimeString appendFormat: NSLocalizedString(@"%d hr %02d min", "Torrent -> remaining time"), eta / 3600, (eta / 60) % 60];
    250251                else
    251                     [fRemainingTimeString appendFormat: @"%d day%s %d hr",
    252                                                 eta / 86400, eta / 86400 == 1 ? "" : "s", (eta / 3600) % 24];
     252                {
     253                    if (eta / 86400 > 1)
     254                        [fRemainingTimeString appendFormat: NSLocalizedString(@"%d days %d hr", "Torrent -> remaining time"),
     255                                                eta / 86400, (eta / 3600) % 24];
     256                    else
     257                        [fRemainingTimeString appendFormat: NSLocalizedString(@"%d day %d hr", "Torrent -> remaining time"),
     258                                                eta / 86400, (eta / 3600) % 24];
     259                }
    253260               
    254                 [fProgressString appendFormat: @" - %@ remaining", fRemainingTimeString];
     261                [fProgressString appendFormat: NSLocalizedString(@" - %@ remaining", "Torrent -> progress string"), fRemainingTimeString];
    255262            }
    256263           
     
    259266        case TR_STATUS_SEED:
    260267            [fStatusString setString: @""];
    261             [fStatusString appendFormat:
    262                 @"Seeding to %d of %d peer%s",
    263                 [self peersDownloading], [self totalPeers], [self totalPeers] == 1 ? "" : "s"];
     268            if ([self totalPeers] > 1)
     269                [fStatusString appendFormat: NSLocalizedString(@"Seeding to %d of %d peers", "Torrent -> status string"), [self peersDownloading], [self totalPeers]];
     270            else
     271                [fStatusString appendFormat: NSLocalizedString(@"Seeding to %d of %d peer", "Torrent -> status string"), [self peersDownloading], [self totalPeers]];
    264272           
    265273            break;
    266274
    267275        case TR_STATUS_STOPPING:
    268             tempString = [@"Stopping" stringByAppendingEllipsis];
     276            tempString = [NSLocalizedString(@"Stopping", "Torrent -> status string") stringByAppendingEllipsis];
    269277       
    270278            [fStatusString setString: tempString];
     
    276284    if (fStat->error & TR_ETRACKER)
    277285    {
    278         [fStatusString setString: [@"Error: " stringByAppendingString: [NSString stringWithUTF8String: fStat->trackerError]]];
     286        [fStatusString setString: [NSLocalizedString(@"Error: ", "Torrent -> status string") stringByAppendingString: [NSString stringWithUTF8String: fStat->trackerError]]];
    279287        if (!fError && [self isActive])
    280288        {
     
    295303        if ([self progress] < 1.0)
    296304        {
    297             stringToAppend = [NSString stringWithFormat: @"DL: %@, ", [NSString stringForSpeed: [self downloadRate]]];
     305            stringToAppend = [NSString stringWithFormat: NSLocalizedString(@"DL: %@, ", "Torrent -> status string"), [NSString stringForSpeed: [self downloadRate]]];
    298306            [fShortStatusString setString: @""];
    299307        }
     
    303311                                                upload: [self uploadedTotal]];
    304312       
    305             [fShortStatusString setString: [NSString stringWithFormat: @"Ratio: %@, ", ratioString]];
    306             [fRemainingTimeString setString: [@"Ratio: " stringByAppendingString: ratioString]];
     313            [fShortStatusString setString: [NSString stringWithFormat: NSLocalizedString(@"Ratio: %@, ", "Torrent -> status string"), ratioString]];
     314            [fRemainingTimeString setString: [NSLocalizedString(@"Ratio: ", "Torrent -> status string") stringByAppendingString: ratioString]];
    307315        }
    308316       
    309         stringToAppend = [stringToAppend stringByAppendingString: [@"UL: " stringByAppendingString:
     317        stringToAppend = [stringToAppend stringByAppendingString: [NSLocalizedString(@"UL: ", "Torrent -> status string") stringByAppendingString:
    310318                                                [NSString stringForSpeed: [self uploadRate]]]];
    311319
     
    468476    {
    469477        NSAlert * alert = [[NSAlert alloc] init];
    470         [alert setMessageText: [NSString stringWithFormat: @"Not enough remaining disk space to download \"%@\" completely.",
     478        [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Not enough remaining disk space to download \"%@\" completely.", "Torrent file disk space alert -> title"),
    471479                                    [self name]]];
    472480        [alert setInformativeText: [NSString stringWithFormat:
    473                         @"The transfer will be paused. Clear up space on %@ to continue.", volume]];
    474         [alert addButtonWithTitle: @"OK"];
    475         [alert addButtonWithTitle: @"Download Anyway"];
     481                        NSLocalizedString(@"The transfer will be paused. Clear up space on %@ to continue.", "Torrent file disk space alert -> message"), volume]];
     482        [alert addButtonWithTitle: NSLocalizedString(@"OK", "Torrent file disk space alert -> button")];
     483        [alert addButtonWithTitle: NSLocalizedString(@"Download Anyway", "Torrent file disk space alert -> button")];
    476484       
    477485        if ([alert runModal] == NSAlertFirstButtonReturn)
     
    548556- (NSString *) torrentLocationString
    549557{
    550     return fPrivateTorrent ? @"Transmission Support Folder" : [fPublicTorrentLocation stringByAbbreviatingWithTildeInPath];
     558    return fPrivateTorrent ? NSLocalizedString(@"Transmission Support Folder", "Torrent -> location") : [fPublicTorrentLocation stringByAbbreviatingWithTildeInPath];
    551559}
    552560
     
    571579    {
    572580        case TR_STATUS_PAUSE:
    573             return @"Paused";
     581            return NSLocalizedString(@"Paused", "Torrent -> status string");
    574582            break;
    575583
    576584        case TR_STATUS_CHECK:
    577             return [@"Checking existing files" stringByAppendingEllipsis];
     585            return [NSLocalizedString(@"Checking existing files", "Torrent -> status string") stringByAppendingEllipsis];
    578586            break;
    579587
    580588        case TR_STATUS_DOWNLOAD:
    581             return @"Downloading";
     589            return NSLocalizedString(@"Downloading", "Torrent -> status string");
    582590            break;
    583591
    584592        case TR_STATUS_SEED:
    585             return @"Seeding";
     593            return NSLocalizedString(@"Seeding", "Torrent -> status string");
    586594            break;
    587595
    588596        case TR_STATUS_STOPPING:
    589             return [@"Stopping" stringByAppendingEllipsis];
     597            return [NSLocalizedString(@"Stopping", "Torrent -> status string") stringByAppendingEllipsis];
    590598            break;
    591599       
    592600        default:
    593             return @"N/A";
     601            return NSLocalizedString(@"N/A", "Torrent -> status string");
    594602    }
    595603}
Note: See TracChangeset for help on using the changeset viewer.