Permalink
Browse files

Localize menubar, fix a bug with the episodes list

  • Loading branch information...
1 parent d8ea23e commit 27ab44b552f3d5098ab5bae00941206f1156730f @victorpimentel committed May 3, 2011
@@ -74,7 +74,7 @@ -(void)drawRect:(NSRect)rect
[green_gradient drawInRect:NSMakeRect(0, location.y, location.x+10, HEIGHT) angle:270];
- NSString* s = @"ON";
+ NSString* s = TSLocalizeString(@"On");
NSMutableDictionary* attr = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[NSFont boldSystemFontOfSize:15.0], NSFontAttributeName,
[NSColor colorWithDeviceRed:0.2 green:0.333 blue:0.027 alpha:1.0], NSForegroundColorAttributeName,
@@ -89,7 +89,7 @@ -(void)drawRect:(NSRect)rect
int x = location.x+KNOB_WIDTH-2;
[gray_gradient drawInRect:NSMakeRect(x, location.y, WIDTH-x, HEIGHT) angle:270];
- s = @"OFF";
+ s = TSLocalizeString(@"Off");
[attr setObject:[NSColor colorWithDeviceWhite:0.2 alpha:0.66] forKey:NSForegroundColorAttributeName];
sz = [s sizeWithAttributes:attr];
pt.x = location.x+KNOB_WIDTH+(KNOB_MAX_X-sz.width)/2;
@@ -104,6 +104,10 @@ - (IBAction) displayPresetTorrentsWindow:(id)sender
// Always remember the user preference
[showQuality setState: [TSUserDefaults getBoolFromKey:@"AutoSelectHDVersion" withDefault:1]];
+ // Grab the list of episodes
+ [episodeArrayController removeObjects:[episodeArrayController content]];
+ [self setEpisodesForSelectedShow];
+
[NSApp beginSheet: PTWindow
modalForWindow: [[NSApplication sharedApplication] mainWindow]
modalDelegate: nil
@@ -128,7 +128,7 @@ - (IBAction) checkNow:(id)sender
checkerThread = nil;
// Notify the user to give him some feedback
[GrowlApplicationBridge notifyWithTitle:@"TVShows"
- description:@"Checking for new episodes..."
+ description:TSLocalizeString(@"Checking for new episodes...")
notificationName:@"Checking For New Episodes"
iconData:TVShowsHelperIcon
priority:0
@@ -138,7 +138,7 @@ - (IBAction) checkNow:(id)sender
// First disable the menubar option
[checkShowsItem setAction:nil];
- [checkShowsItem setTitle:@"Checking now, please wait..."];
+ [checkShowsItem setTitle:TSLocalizeString(@"Checking now, please wait...")];
// And start the thread
checkerThread = [[NSThread alloc] initWithTarget:self selector:@selector(runLoop) object:nil];
@@ -242,8 +242,6 @@ - (void) activateStatusMenu
{
statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] retain];
- // Uncomment this area and fill in the name of your image<br />
- // to add a custom icon to your status item.<br />
[statusItem setImage:[NSImage imageNamed:@"TVShows-Menu-Icon-Black"]];
[statusItem setAlternateImage:[NSImage imageNamed:@"TVShows-Menu-Icon-White"]];
[statusItem setEnabled:YES];
@@ -252,6 +250,15 @@ - (void) activateStatusMenu
[statusItem setAction:@selector(openApplication:)];
[statusItem setMenu:statusMenu];
+
+ // Localize
+ [lastUpdateItem setTitle:[NSString stringWithFormat:@"%@ %@", TSLocalizeString(@"Last Checked:"), TSLocalizeString(@"Never")]];
+ [checkShowsItem setTitle:TSLocalizeString(@"Checking now, please wait...")];
+ [subscriptionsItem setTitle:[NSString stringWithFormat:@"%@...", TSLocalizeString(@"Subscriptions")]];
+ [preferencesItem setTitle:[NSString stringWithFormat:@"%@...", TSLocalizeString(@"Preferences")]];
+ [feedbackItem setTitle:[NSString stringWithFormat:@"%@...", TSLocalizeString(@"Submit Feedback")]];
+ [aboutItem setTitle:[NSString stringWithFormat:@"%@ TVShows", TSLocalizeString(@"About")]];
+ [disableItem setTitle:TSLocalizeString(@"Disable TVShows")];
}
- (void) updateLastCheckedItem
@@ -266,11 +273,11 @@ - (void) updateLastCheckedItem
NSString *formattedDateString = [dateFormatter stringFromDate:[TSUserDefaults getDateFromKey:@"lastCheckedForEpisodes"]];
// Finally, update the string
- [lastUpdateItem setTitle:[TSLocalizeString(@"Last Checked:") stringByAppendingFormat:@" %@", formattedDateString]];
+ [lastUpdateItem setTitle:[NSString stringWithFormat:@"%@ %@", TSLocalizeString(@"Last Checked:"), formattedDateString]];
// Enable again the menubar option
[checkShowsItem setAction:@selector(checkNow:)];
- [checkShowsItem setTitle:@"Check for new episodes now"];
+ [checkShowsItem setTitle:TSLocalizeString(@"Check for new episodes now")];
}
- (IBAction) openApplication:(id)sender
@@ -390,7 +397,7 @@ - (void) startDownloadingURL:(NSString *)url withFileName:(NSString *)fileName s
if([TSUserDefaults getBoolFromKey:@"GrowlOnNewEpisode" withDefault:1]) {
// In the future this may display the show's poster instead of our app icon.
[GrowlApplicationBridge notifyWithTitle:[NSString stringWithFormat:@"%@", [show valueForKey:@"name"]]
- description:[NSString stringWithFormat:@"A new episode of %@ is being downloaded.", [show valueForKey:@"name"]]
+ description:[NSString stringWithFormat:TSLocalizeString(@"A new episode of %@ is being downloaded."), [show valueForKey:@"name"]]
notificationName:@"New Episode Downloaded"
iconData:TVShowsHelperIcon
priority:0
@@ -422,7 +429,7 @@ - (void) updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)update
if([TSUserDefaults getBoolFromKey:@"GrowlOnAppUpdate" withDefault:YES]) {
[GrowlApplicationBridge notifyWithTitle:@"TVShows Update Downloading"
- description:@"A new version of TVShows is being downloaded and installed."
+ description:TSLocalizeString(@"A new version of TVShows is being downloaded and installed.")
notificationName:@"TVShows Update Downloaded"
iconData:TVShowsHelperIcon
priority:0
@@ -431,7 +438,7 @@ - (void) updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)update
}
} else if([TSUserDefaults getBoolFromKey:@"GrowlOnAppUpdate" withDefault:YES]) {
[GrowlApplicationBridge notifyWithTitle:@"TVShows Update Available"
- description:@"A new version of TVShows is available for download."
+ description:TSLocalizeString(@"A new version of TVShows is available for download.")
notificationName:@"TVShows Update Available"
iconData:TVShowsHelperIcon
priority:0
@@ -15,6 +15,8 @@
"6 hours" = "6 hours";
+"A message is logged each time new episodes are checked for. Unless noted otherwise, no new episodes were found." = "A message is logged each time new episodes are checked for. Unless noted otherwise, no new episodes were found.";
+
/* The %@ will be replaced by the name of the show. */
"A new episode of %@ is being downloaded." = "A new episode of %@ is being downloaded.";
@@ -30,17 +32,13 @@
"Add a custom RSS source" = "Add a custom RSS source";
-/* Title of an error message or Growl notification. */
-"An Error Has Occurred" = "An Error Has Occurred";
-
-"Add a show from NZBs.org" = "Add a show from NZBs.org";
-
/* This string is on a button. */
"Add Show" = "Add Show";
-"An unknown error has occurred. Please try again later." = "An unknown error has occurred. Please try again later.";
+/* Title of an error message or Growl notification. */
+"An Error Has Occurred" = "An Error Has Occurred";
-"A message is logged each time new episodes are checked for. Unless noted otherwise, no new episodes were found." = "A message is logged each time new episodes are checked for. Unless noted otherwise, no new episodes were found.";
+"An unknown error has occurred. Please try again later." = "An unknown error has occurred. Please try again later.";
"An update for TVShows has been installed automatically. To disable this feature go to the Preferences tab and uncheck 'Automatically install new updates.'" = "An update for TVShows has been installed automatically. To disable this feature go to the Preferences tab and uncheck 'Automatically install new updates.'";
@@ -61,22 +59,27 @@
"Cannot connect. Using an old show list temporarily." = "Cannot connect. Using an old show list temporarily.";
+"Check for episodes every:" = "Check for episodes every:";
+
+/* This string is on a button. */
+"Check for new episodes now" = "Check for new episodes now";
+
/* This string is on a button. */
"Check Now" = "Check Now";
-"Check for episodes every:" = "Check for episodes every:";
+"Checking for new episodes..." = "Checking for new episodes...";
+
+"Checking now, please wait..." = "Checking now, please wait...";
+
+"Choose this to download torrent files from a list of preset shows." = "Choose this to download torrent files from a list of preset shows.";
/* This string is on a button. */
"Close" = "Close";
-"Download Preferences" = "Download Preferences";
-
-"Choose this to download torrent files from a list of preset shows." = "Choose this to download torrent files from a list of preset shows.";
+"Disable TVShows" = "Disable TVShows";
"Download beta versions when available" = "Download beta versions when available";
-"Choose this to download Usenet files using your NZBs.org account." = "Choose this to download Usenet files using your NZBs.org account.";
-
"Download in HD" = "Download in HD";
"Choose this to input your own RSS feed." = "Choose this to input your own RSS feed.";
@@ -121,7 +124,7 @@
"Name" = "Name";
-/* This string is on a button. */
+/* This string is on a very narrow button, max 3 charaters (use a dot after that like "Des." in Spanish instead of "Desactivado") */
"Off" = "Off";
/* This string refers to the default episode quality to download (Standard/High Definition). */
@@ -130,7 +133,7 @@
/* This string is on a button. */
"Ok" = "Ok";
-/* This string is on a button. */
+/* This string is on a very narrow button, max 3 charaters (use a dot after that like "Act." in Spanish instead of "Activado") */
"On" = "On";
"Only download items matching the following rules:" = "Only download items matching the following rules:";
@@ -99,7 +99,7 @@
</object>
<object class="NSMenuItem" id="966356482">
<reference key="NSMenu" ref="962946239"/>
- <string key="NSTitle">Send feedback...</string>
+ <string key="NSTitle">Send Feedback...</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="138414130"/>
@@ -227,6 +227,54 @@
</object>
<int key="connectionID">856</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">subscriptionsItem</string>
+ <reference key="source" ref="397300107"/>
+ <reference key="destination" ref="918719190"/>
+ </object>
+ <int key="connectionID">857</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">checkShowsItem</string>
+ <reference key="source" ref="397300107"/>
+ <reference key="destination" ref="429497406"/>
+ </object>
+ <int key="connectionID">858</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">preferencesItem</string>
+ <reference key="source" ref="397300107"/>
+ <reference key="destination" ref="742739034"/>
+ </object>
+ <int key="connectionID">859</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">feedbackItem</string>
+ <reference key="source" ref="397300107"/>
+ <reference key="destination" ref="966356482"/>
+ </object>
+ <int key="connectionID">860</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">aboutItem</string>
+ <reference key="source" ref="397300107"/>
+ <reference key="destination" ref="477587851"/>
+ </object>
+ <int key="connectionID">861</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">disableItem</string>
+ <reference key="source" ref="397300107"/>
+ <reference key="destination" ref="127761296"/>
+ </object>
+ <int key="connectionID">862</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -391,7 +439,7 @@
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
- <int key="maxID">856</int>
+ <int key="maxID">862</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -594,6 +642,10 @@
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+ <real value="1050" key="NS.object.0"/>
+ </object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1050" key="NS.object.0"/>
Oops, something went wrong.

0 comments on commit 27ab44b

Please sign in to comment.