From 2275fcea792c40e24651fdf2e4edc59c22ceed08 Mon Sep 17 00:00:00 2001 From: Mathijs Kadijk Date: Wed, 15 Aug 2012 22:18:28 +0200 Subject: [PATCH 1/4] Removed old startup code and ignore DS_Store files. --- .gitignore | 2 + .../project.pbxproj | 6 - Battery Time Remaining/AppDelegate.m | 14 -- Battery Time Remaining/StartAtLoginHelper.h | 17 --- Battery Time Remaining/StartAtLoginHelper.m | 138 ------------------ 5 files changed, 2 insertions(+), 175 deletions(-) delete mode 100644 Battery Time Remaining/StartAtLoginHelper.h delete mode 100644 Battery Time Remaining/StartAtLoginHelper.m diff --git a/.gitignore b/.gitignore index 2d5f62a..87f99c1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.xcworkspace !default.xcworkspace xcuserdata + +.DS_Store \ No newline at end of file diff --git a/Battery Time Remaining.xcodeproj/project.pbxproj b/Battery Time Remaining.xcodeproj/project.pbxproj index 8d4348b..bfbb759 100644 --- a/Battery Time Remaining.xcodeproj/project.pbxproj +++ b/Battery Time Remaining.xcodeproj/project.pbxproj @@ -20,7 +20,6 @@ 28FEDA5E15DA5C9D00320B72 /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FEDA5D15DA5C9D00320B72 /* ServiceManagement.framework */; }; 28FEDA6E15DA5ECA00320B72 /* LaunchAtLoginHelper.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = 28FEDA6B15DA5EB200320B72 /* LaunchAtLoginHelper.app */; }; 28FEDA6F15DA5F8C00320B72 /* LLManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 28FEDA6315DA5EB200320B72 /* LLManager.m */; }; - D58C7EF815CD7C6100C07E0C /* StartAtLoginHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = D58C7EF715CD7C6100C07E0C /* StartAtLoginHelper.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -78,8 +77,6 @@ 28FEDA6215DA5EB200320B72 /* LLManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LLManager.h; path = ../LaunchAtLoginHelper/LLManager.h; sourceTree = ""; }; 28FEDA6315DA5EB200320B72 /* LLManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = LLManager.m; path = ../LaunchAtLoginHelper/LLManager.m; sourceTree = ""; }; 28FEDA6415DA5EB200320B72 /* LLStrings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LLStrings.h; path = ../LaunchAtLoginHelper/LLStrings.h; sourceTree = ""; }; - D58C7EF615CD7C6100C07E0C /* StartAtLoginHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StartAtLoginHelper.h; sourceTree = ""; }; - D58C7EF715CD7C6100C07E0C /* StartAtLoginHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StartAtLoginHelper.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -145,8 +142,6 @@ 2841C7F315C91CC100F4F15F /* AppDelegate.m */, 28833BAC15D7B90B00741727 /* HttpGet.h */, 28833BAD15D7B90B00741727 /* HttpGet.m */, - D58C7EF615CD7C6100C07E0C /* StartAtLoginHelper.h */, - D58C7EF715CD7C6100C07E0C /* StartAtLoginHelper.m */, 2841C7E715C91CC100F4F15F /* Supporting Files */, ); path = "Battery Time Remaining"; @@ -263,7 +258,6 @@ 28FEDA6F15DA5F8C00320B72 /* LLManager.m in Sources */, 2841C7ED15C91CC100F4F15F /* main.m in Sources */, 2841C7F415C91CC100F4F15F /* AppDelegate.m in Sources */, - D58C7EF815CD7C6100C07E0C /* StartAtLoginHelper.m in Sources */, 28833BAE15D7B90B00741727 /* HttpGet.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Battery Time Remaining/AppDelegate.m b/Battery Time Remaining/AppDelegate.m index 32d4165..ab75711 100644 --- a/Battery Time Remaining/AppDelegate.m +++ b/Battery Time Remaining/AppDelegate.m @@ -9,7 +9,6 @@ #import "AppDelegate.h" #import "HttpGet.h" #import "LLManager.h" -#import "StartAtLoginHelper.h" #import #import @@ -55,7 +54,6 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification self.startupToggle = [[NSMenuItem alloc] initWithTitle:@"Start at login" action:@selector(toggleStartAtLogin:) keyEquivalent:@""]; self.startupToggle.target = self; self.startupToggle.state = ([LLManager launchAtLogin]) ? NSOnState : NSOffState; - //self.startupToggle.state = ([StartAtLoginHelper isInLoginItems]) ? NSOnState : NSOffState; #endif // Build the notification submenu @@ -273,18 +271,6 @@ - (void)toggleStartAtLogin:(id)sender [LLManager setLaunchAtLogin:YES]; self.startupToggle.state = NSOnState; } - /* - // Check the state of start at login - if ([StartAtLoginHelper isInLoginItems]) - { - [StartAtLoginHelper removeFromLoginItems]; - self.startupToggle.state = NSOffState; - } - else - { - [StartAtLoginHelper addToLoginItems]; - self.startupToggle.state = NSOnState; - }*/ } #endif diff --git a/Battery Time Remaining/StartAtLoginHelper.h b/Battery Time Remaining/StartAtLoginHelper.h deleted file mode 100644 index cd945f9..0000000 --- a/Battery Time Remaining/StartAtLoginHelper.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// StartAtLoginHelper.h -// Battery Time Remaining -// -// Created by Mathijs Kadijk on 04-08-12. -// Copyright (c) 2012 Wrep. All rights reserved. -// - -#import - -@interface StartAtLoginHelper : NSObject - -+ (BOOL)isInLoginItems; -+ (void)addToLoginItems; -+ (void)removeFromLoginItems; - -@end diff --git a/Battery Time Remaining/StartAtLoginHelper.m b/Battery Time Remaining/StartAtLoginHelper.m deleted file mode 100644 index bf35d7e..0000000 --- a/Battery Time Remaining/StartAtLoginHelper.m +++ /dev/null @@ -1,138 +0,0 @@ -// -// StartAtLoginHelper.m -// Battery Time Remaining -// -// Created by Mathijs Kadijk on 04-08-12. -// Copyright (c) 2012 Wrep. All rights reserved. -// - -#import "StartAtLoginHelper.h" - -@implementation StartAtLoginHelper - -+ (BOOL)isInLoginItems -{ - BOOL isInLoginItems = NO; - - // Get URL to the App - NSString *appPath = [[NSBundle mainBundle] bundlePath]; - CFURLRef url = (__bridge CFURLRef)[NSURL fileURLWithPath:appPath]; - - // Get the current users login items - LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL); - - if (loginItems) - { - // Get a array of the loginItems - UInt32 seedValue; - CFArrayRef loginItemsArrayRef = LSSharedFileListCopySnapshot(loginItems, &seedValue); - - // Cast to NSArray for ease of use - NSArray *loginItemsArray = (__bridge NSArray *)loginItemsArrayRef; - - // Loop through all loginitems - for (int i = 0; i < [loginItemsArray count]; i++) - { - // Get the current loginitem - LSSharedFileListItemRef itemRef = (__bridge LSSharedFileListItemRef)[loginItemsArray objectAtIndex:i]; - - // Resolve the loginitem - if (LSSharedFileListItemResolve(itemRef, 0, (CFURLRef *)&url, NULL) == noErr) - { - // Get the path from the URL - NSString *urlPath = [(__bridge NSURL *)url path]; - - // Check if this is us - if ([urlPath compare:appPath] == NSOrderedSame) - { - isInLoginItems = YES; - } - } - - CFRelease(url); - } - - CFRelease(loginItems); - } - - return isInLoginItems; -} - -+ (void)addToLoginItems -{ - // Get URL to the App - NSString *appPath = [[NSBundle mainBundle] bundlePath]; - CFURLRef url = (__bridge CFURLRef)[NSURL fileURLWithPath:appPath]; - - // Get the current users login items - LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL); - - if (loginItems) - { - // Insert ourself into the list of startup items - LSSharedFileListItemRef item = LSSharedFileListInsertItemURL(loginItems, kLSSharedFileListItemLast, NULL, NULL, url, NULL, NULL); - - // Check if the item is inserted, if so release it - if (item) - { - CFRelease(item); - } - else - { - NSLog(@"Failed to insert loginitem!"); - } - - CFRelease(loginItems); - } - else - { - NSLog(@"No loginitems list found!"); - } -} - -+ (void)removeFromLoginItems -{ - // Get URL to the App - NSString *appPath = [[NSBundle mainBundle] bundlePath]; - CFURLRef url = (__bridge CFURLRef)[NSURL fileURLWithPath:appPath]; - - // Get the current users login items - LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL); - - if (loginItems) - { - // Get a array of the loginItems - UInt32 seedValue; - CFArrayRef loginItemsArrayRef = LSSharedFileListCopySnapshot(loginItems, &seedValue); - - // Cast to NSArray for ease of use - NSArray *loginItemsArray = (__bridge NSArray *)loginItemsArrayRef; - - // Loop through all loginitems - for (int i = 0; i < [loginItemsArray count]; i++) - { - // Get the current loginitem - LSSharedFileListItemRef itemRef = (__bridge LSSharedFileListItemRef)[loginItemsArray objectAtIndex:i]; - - // Resolve the loginitem - if (LSSharedFileListItemResolve(itemRef, 0, (CFURLRef *)&url, NULL) == noErr) - { - // Get the path from the URL - NSString *urlPath = [(__bridge NSURL *)url path]; - - // Check if this is us - if ([urlPath compare:appPath] == NSOrderedSame) - { - // It is us, remove us from the list - LSSharedFileListItemRemove(loginItems, itemRef); - } - } - - CFRelease(url); - } - - CFRelease(loginItems); - } -} - -@end From 42395fccc99fa515d8b6512ea46d92d97b94dd89 Mon Sep 17 00:00:00 2001 From: Mathijs Kadijk Date: Wed, 15 Aug 2012 22:52:59 +0200 Subject: [PATCH 2/4] Changed credentials file to something more relevant --- Battery Time Remaining/en.lproj/Credits.rtf | 31 ++++----------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/Battery Time Remaining/en.lproj/Credits.rtf b/Battery Time Remaining/en.lproj/Credits.rtf index 46576ef..26acd64 100644 --- a/Battery Time Remaining/en.lproj/Credits.rtf +++ b/Battery Time Remaining/en.lproj/Credits.rtf @@ -1,29 +1,10 @@ -{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} +{\rtf1\ansi\ansicpg1252\cocoartf1187 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} -\paperw9840\paperh8400 -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural +\paperw11900\paperh16840\vieww9600\viewh8400\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 \f0\b\fs24 \cf0 Engineering: \b0 \ - Some people\ -\ - -\b Human Interface Design: -\b0 \ - Some other people\ -\ - -\b Testing: -\b0 \ - Hopefully not nobody\ -\ - -\b Documentation: -\b0 \ - Whoever\ -\ - -\b With special thanks to: -\b0 \ - Mom\ -} + Han Yin Lap\ + Mathijs Kadijk } \ No newline at end of file From c0436dc855f155696784c0e310a9e179f4ae114e Mon Sep 17 00:00:00 2001 From: Mathijs Kadijk Date: Wed, 15 Aug 2012 22:54:36 +0200 Subject: [PATCH 3/4] I18N-ed the App so people can start translating it! --- .../project.pbxproj | 12 ++++++ Battery Time Remaining/AppDelegate.m | 38 +++++++++--------- .../en.lproj/Localizable.strings | Bin 0 -> 2182 bytes 3 files changed, 31 insertions(+), 19 deletions(-) create mode 100644 Battery Time Remaining/en.lproj/Localizable.strings diff --git a/Battery Time Remaining.xcodeproj/project.pbxproj b/Battery Time Remaining.xcodeproj/project.pbxproj index bfbb759..9113d63 100644 --- a/Battery Time Remaining.xcodeproj/project.pbxproj +++ b/Battery Time Remaining.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 28FEDA5E15DA5C9D00320B72 /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FEDA5D15DA5C9D00320B72 /* ServiceManagement.framework */; }; 28FEDA6E15DA5ECA00320B72 /* LaunchAtLoginHelper.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = 28FEDA6B15DA5EB200320B72 /* LaunchAtLoginHelper.app */; }; 28FEDA6F15DA5F8C00320B72 /* LLManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 28FEDA6315DA5EB200320B72 /* LLManager.m */; }; + D53375E515DC43380077CEF6 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = D53375E315DC43380077CEF6 /* Localizable.strings */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -77,6 +78,7 @@ 28FEDA6215DA5EB200320B72 /* LLManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LLManager.h; path = ../LaunchAtLoginHelper/LLManager.h; sourceTree = ""; }; 28FEDA6315DA5EB200320B72 /* LLManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = LLManager.m; path = ../LaunchAtLoginHelper/LLManager.m; sourceTree = ""; }; 28FEDA6415DA5EB200320B72 /* LLStrings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LLStrings.h; path = ../LaunchAtLoginHelper/LLStrings.h; sourceTree = ""; }; + D53375E415DC43380077CEF6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -150,6 +152,7 @@ 2841C7E715C91CC100F4F15F /* Supporting Files */ = { isa = PBXGroup; children = ( + D53375E315DC43380077CEF6 /* Localizable.strings */, 28833BB315D7D61100741727 /* build_version */, 28833BB115D7D4FF00741727 /* Readme.md */, 28BA61A715D1B12500EDB674 /* icon.icns */, @@ -245,6 +248,7 @@ 28BA61A815D1B12500EDB674 /* icon.icns in Resources */, 28833BB215D7D4FF00741727 /* Readme.md in Resources */, 28833BB415D7D61100741727 /* build_version in Resources */, + D53375E515DC43380077CEF6 /* Localizable.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -289,6 +293,14 @@ name = Credits.rtf; sourceTree = ""; }; + D53375E315DC43380077CEF6 /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + D53375E415DC43380077CEF6 /* en */, + ); + name = Localizable.strings; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ diff --git a/Battery Time Remaining/AppDelegate.m b/Battery Time Remaining/AppDelegate.m index ab75711..f189cb8 100644 --- a/Battery Time Remaining/AppDelegate.m +++ b/Battery Time Remaining/AppDelegate.m @@ -43,15 +43,15 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification [self saveNotificationSettings]; // Power source menu - self.psTimeMenu = [[NSMenuItem alloc] initWithTitle:@"Loading…" action:nil keyEquivalent:@""]; + self.psTimeMenu = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Loading…", @"Remaining menuitem") action:nil keyEquivalent:@""]; [self.psTimeMenu setEnabled:NO]; - self.psStateMenu = [[NSMenuItem alloc] initWithTitle:@"Power source: Unknown" action:nil keyEquivalent:@""]; + self.psStateMenu = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Power source: Unknown", @"Powersource menuitem") action:nil keyEquivalent:@""]; [self.psStateMenu setEnabled:NO]; #ifndef SANDBOX // Create the startup at login toggle - self.startupToggle = [[NSMenuItem alloc] initWithTitle:@"Start at login" action:@selector(toggleStartAtLogin:) keyEquivalent:@""]; + self.startupToggle = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Start at login", @"Start at login setting") action:@selector(toggleStartAtLogin:) keyEquivalent:@""]; self.startupToggle.target = self; self.startupToggle.state = ([LLManager launchAtLogin]) ? NSOnState : NSOffState; #endif @@ -67,11 +67,11 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification [notificationSubmenu addItem:notificationSubmenuItem]; } - NSMenuItem *notificationMenu = [[NSMenuItem alloc] initWithTitle:@"Notifications" action:nil keyEquivalent:@""]; + NSMenuItem *notificationMenu = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Notifications", @"Notification menuitem") action:nil keyEquivalent:@""]; [notificationMenu setSubmenu:notificationSubmenu]; // Updater menu - self.updaterMenu = [[NSMenuItem alloc] initWithTitle:@"Checking for updates…" action:nil keyEquivalent:@""]; + self.updaterMenu = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Checking for updates…", @"Update menuitem") action:nil keyEquivalent:@""]; [self.updaterMenu setEnabled:NO]; // Build the status menu @@ -86,11 +86,11 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification [statusMenu addItem:notificationMenu]; [statusMenu addItem:[NSMenuItem separatorItem]]; - [statusMenu addItemWithTitle:@"Energy Saver Preferences…" action:@selector(openEnergySaverPreference:) keyEquivalent:@""]; + [statusMenu addItemWithTitle:NSLocalizedString(@"Energy Saver Preferences…", @"Open Energy Saver Preferences menuitem") action:@selector(openEnergySaverPreference:) keyEquivalent:@""]; [statusMenu addItem:[NSMenuItem separatorItem]]; [statusMenu addItem:self.updaterMenu]; [statusMenu addItem:[NSMenuItem separatorItem]]; - [statusMenu addItemWithTitle:@"Quit" action:@selector(terminate:) keyEquivalent:@""]; + [statusMenu addItemWithTitle:NSLocalizedString(@"Quit", @"Quit menuitem") action:@selector(terminate:) keyEquivalent:@""]; // Create the status item and set initial text statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength]; @@ -133,8 +133,8 @@ - (void)updateStatusItem NSInteger percent = (int)[currentBatteryCapacity doubleValue] / [maxBatteryCapacity doubleValue] * 100; // Update menu title - self.psTimeMenu.title = [NSString stringWithFormat:@"%ld %% left", percent]; - self.psStateMenu.title = [NSString stringWithFormat:@"Power source: %@", CFDictionaryGetValue(description, CFSTR(kIOPSPowerSourceStateKey))]; + self.psTimeMenu.title = [NSString stringWithFormat:NSLocalizedString(@"%ld %% left", @"Percentage left menuitem"), percent]; + self.psStateMenu.title = [NSString stringWithFormat:NSLocalizedString(@"Power source: %@", @"Powersource menuitem"), CFDictionaryGetValue(description, CFSTR(kIOPSPowerSourceStateKey))]; // We're connected to an unlimited power source (AC adapter probably) if (kIOPSTimeRemainingUnlimited == timeRemaining) @@ -158,7 +158,7 @@ - (void)updateStatusItem else { self.statusItem.image = [self getBatteryIconNamed:@"BatteryCharging"]; - self.statusItem.title = @" Calculating…"; + self.statusItem.title = NSLocalizedString(@" Calculating…", @"Calculating sidetext"); } } else @@ -184,7 +184,7 @@ - (void)updateStatusItem else if (kIOPSTimeRemainingUnknown == timeRemaining) { self.statusItem.image = [self getBatteryIconPercent:percent]; - self.statusItem.title = @" Calculating…"; + self.statusItem.title = NSLocalizedString(@" Calculating…", @"Calculating sidetext"); } // Time is known! else @@ -201,7 +201,7 @@ - (void)updateStatusItem if ([[self.notifications valueForKey:key] boolValue] && [key intValue] == percent) { // Send notification once if (self.previousPercent != percent) { - [self notify:[NSString stringWithFormat:@"%ld:%02ld left (%ld%%)", hour, minute, percent]]; + [self notify:[NSString stringWithFormat:NSLocalizedString(@"%ld:%02ld left (%ld%%)", @"Percentage left menuitem"), hour, minute, percent]]; } break; } @@ -277,7 +277,7 @@ - (void)toggleStartAtLogin:(id)sender - (void)notify:(NSString *)message { NSUserNotification *notification = [[NSUserNotification alloc] init]; - [notification setTitle:@"Battery Time Remaining"]; + [notification setTitle:NSLocalizedString(@"Battery Time Remaining", @"Notification title")]; [notification setInformativeText:message]; [notification setSoundName:NSUserNotificationDefaultSoundName]; NSUserNotificationCenter *center = [NSUserNotificationCenter defaultUserNotificationCenter]; @@ -327,7 +327,7 @@ - (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentN - (void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification { - if ([[notification informativeText] isEqualToString:@"A newer version is available"]) { + if ([[notification informativeText] isEqualToString:NSLocalizedString(@"A newer version is available", @"Update menuitem")]) { [self openHomeUrl:nil]; } } @@ -347,21 +347,21 @@ - (void)menuWillOpen:(NSMenu *)menu NSInteger currentBuildVersion = [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] integerValue]; if (!latestBuildVersion) { - self.updaterMenu.title = @"Could not check for updates"; + self.updaterMenu.title = NSLocalizedString(@"Could not check for updates", @"Update menuitem"); return; } // Newer version available if (latestBuildVersion > currentBuildVersion) { - self.updaterMenu.title = @"A newer version is available"; + self.updaterMenu.title = NSLocalizedString(@"A newer version is available", @"Update menuitem"); [self.updaterMenu setAction:@selector(openHomeUrl:)]; [self.updaterMenu setEnabled:YES]; - [self notify:@"A newer version is available"]; + [self notify:NSLocalizedString(@"A newer version is available", @"Update notification")]; } else { - self.updaterMenu.title = @"Up to date"; + self.updaterMenu.title = NSLocalizedString(@"Up to date", @"Update menuitem"); } } error:^(NSError *error) { - self.updaterMenu.title = @"Could not check for updates"; + self.updaterMenu.title = NSLocalizedString(@"Could not check for updates", @"Update menuitem"); }]; } diff --git a/Battery Time Remaining/en.lproj/Localizable.strings b/Battery Time Remaining/en.lproj/Localizable.strings new file mode 100644 index 0000000000000000000000000000000000000000..4f7c8abaa2a889de4d1815964c8de81cf06bd5c6 GIT binary patch literal 2182 zcmcIl+fKqj5S?efVq>gPUr>C*n5e`zqj=#1Dimyx*0g~7^XfUfG&_K;lxWCqm)*IX zIXg4^_1Tm|G18GxUZgKG%%MyrmPAI_&#@Xvgq=vLR%y5$t&#gp2*WGI}Pmdw=9)N3i%j} z#$ejraSFaYmls$ku=s|NVLi8BW`L86kqri#bBq}HLwUj+smQjsprgAfMN0fr>(isY zw6TzhOg@0`5i(@N$UWwX#hPG``Rwzeo|ZM7qQ_Jg2-Ci!b zUh3#}l+IyZ7HIM zG5AevXJGD?vt8GgW_=r79npH8RUy3whanhr8L4rspJ*@TRZ-4LnNF@Mp-M*k?*g~$ z47tq$*RQK0^%{Ifm^n_TjhhVQTw(ZK^8b+ZkY8gAMwe`eX;nv~yF;ApQdP_pGQP6> zj<)pxJ0V!3HFj*i5h?10xkFC*F8jB-coVC%yvJ%OjbhV|M>zvLDdysJ^8S84b$-49 Dsh3)w literal 0 HcmV?d00001 From 9be6feece891df7b50f122578fcf9eefff010d5f Mon Sep 17 00:00:00 2001 From: Mathijs Kadijk Date: Wed, 15 Aug 2012 23:28:57 +0200 Subject: [PATCH 4/4] Localized the App so it's available in Dutch. --- .../project.pbxproj | 7 ++- .../Battery Time Remaining-Info.plist | 2 + .../en.lproj/InfoPlist.strings | 3 +- .../en.lproj/Localizable.strings | Bin 2182 -> 1107 bytes .../nl.lproj/InfoPlist.strings | 3 ++ .../nl.lproj/Localizable.strings | 46 ++++++++++++++++++ 6 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 Battery Time Remaining/nl.lproj/InfoPlist.strings create mode 100644 Battery Time Remaining/nl.lproj/Localizable.strings diff --git a/Battery Time Remaining.xcodeproj/project.pbxproj b/Battery Time Remaining.xcodeproj/project.pbxproj index 9113d63..92cbee8 100644 --- a/Battery Time Remaining.xcodeproj/project.pbxproj +++ b/Battery Time Remaining.xcodeproj/project.pbxproj @@ -78,7 +78,9 @@ 28FEDA6215DA5EB200320B72 /* LLManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LLManager.h; path = ../LaunchAtLoginHelper/LLManager.h; sourceTree = ""; }; 28FEDA6315DA5EB200320B72 /* LLManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = LLManager.m; path = ../LaunchAtLoginHelper/LLManager.m; sourceTree = ""; }; 28FEDA6415DA5EB200320B72 /* LLStrings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LLStrings.h; path = ../LaunchAtLoginHelper/LLStrings.h; sourceTree = ""; }; - D53375E415DC43380077CEF6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; + D53375E415DC43380077CEF6 /* en */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; + D53375FC15DC44620077CEF6 /* nl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; + D53375FD15DC47700077CEF6 /* nl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/InfoPlist.strings; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -211,6 +213,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + nl, ); mainGroup = 2841C7D115C91CC100F4F15F; productRefGroup = 2841C7DD15C91CC100F4F15F /* Products */; @@ -281,6 +284,7 @@ isa = PBXVariantGroup; children = ( 2841C7EA15C91CC100F4F15F /* en */, + D53375FD15DC47700077CEF6 /* nl */, ); name = InfoPlist.strings; sourceTree = ""; @@ -297,6 +301,7 @@ isa = PBXVariantGroup; children = ( D53375E415DC43380077CEF6 /* en */, + D53375FC15DC44620077CEF6 /* nl */, ); name = Localizable.strings; sourceTree = ""; diff --git a/Battery Time Remaining/Battery Time Remaining-Info.plist b/Battery Time Remaining/Battery Time Remaining-Info.plist index ae913c3..165d249 100644 --- a/Battery Time Remaining/Battery Time Remaining-Info.plist +++ b/Battery Time Remaining/Battery Time Remaining-Info.plist @@ -14,6 +14,8 @@ 6.0 CFBundleName ${PRODUCT_NAME} + LSHasLocalizedDisplayName + CFBundlePackageType APPL CFBundleShortVersionString diff --git a/Battery Time Remaining/en.lproj/InfoPlist.strings b/Battery Time Remaining/en.lproj/InfoPlist.strings index 477b28f..c7697a2 100644 --- a/Battery Time Remaining/en.lproj/InfoPlist.strings +++ b/Battery Time Remaining/en.lproj/InfoPlist.strings @@ -1,2 +1,3 @@ /* Localized versions of Info.plist keys */ - +CFBundleDisplayName = "Battery Time Remaining"; +CFBundleName = "Battery Time Remaining"; diff --git a/Battery Time Remaining/en.lproj/Localizable.strings b/Battery Time Remaining/en.lproj/Localizable.strings index 4f7c8abaa2a889de4d1815964c8de81cf06bd5c6..cf5bada6978c36d49c043d37721a6202250e0630 100644 GIT binary patch literal 1107 zcmb7@T~5O=49DMh3Tq+~>}4?CHX#8MZwLls2MDcOqNT}{x*L1rG+crQ?!pDQ0;xl% zb{`eIM2Y|L&yF2`e|+|PFqS$hv?OIx$W@GluLQk*r(0LP-rl=#0Xw!)r{fV5bP*bo zDT2m?AVX6q!i+IO#~=g?jHsXg<~|gs0}o;Jv3D2ZB#_RIbUYLTzgFV8-=Wo zX$k%l>pw j+f*6Ik$B3>;ciOoxMd26tr6l*&K5ux%F$xK+Hv#)=2K|~ literal 2182 zcmcIl+fKqj5S?efVq>gPUr>C*n5e`zqj=#1Dimyx*0g~7^XfUfG&_K;lxWCqm)*IX zIXg4^_1Tm|G18GxUZgKG%%MyrmPAI_&#@Xvgq=vLR%y5$t&#gp2*WGI}Pmdw=9)N3i%j} z#$ejraSFaYmls$ku=s|NVLi8BW`L86kqri#bBq}HLwUj+smQjsprgAfMN0fr>(isY zw6TzhOg@0`5i(@N$UWwX#hPG``Rwzeo|ZM7qQ_Jg2-Ci!b zUh3#}l+IyZ7HIM zG5AevXJGD?vt8GgW_=r79npH8RUy3whanhr8L4rspJ*@TRZ-4LnNF@Mp-M*k?*g~$ z47tq$*RQK0^%{Ifm^n_TjhhVQTw(ZK^8b+ZkY8gAMwe`eX;nv~yF;ApQdP_pGQP6> zj<)pxJ0V!3HFj*i5h?10xkFC*F8jB-coVC%yvJ%OjbhV|M>zvLDdysJ^8S84b$-49 Dsh3)w diff --git a/Battery Time Remaining/nl.lproj/InfoPlist.strings b/Battery Time Remaining/nl.lproj/InfoPlist.strings new file mode 100644 index 0000000..d37c94d --- /dev/null +++ b/Battery Time Remaining/nl.lproj/InfoPlist.strings @@ -0,0 +1,3 @@ +/* Localized versions of Info.plist keys */ +CFBundleDisplayName = "Resterende Batterij Tijd"; +CFBundleName = "Resterende Batterij Tijd"; diff --git a/Battery Time Remaining/nl.lproj/Localizable.strings b/Battery Time Remaining/nl.lproj/Localizable.strings new file mode 100644 index 0000000..3781b25 --- /dev/null +++ b/Battery Time Remaining/nl.lproj/Localizable.strings @@ -0,0 +1,46 @@ +/* Calculating sidetext */ +" Calculating…" = " Berekenen…"; + +/* Percentage left menuitem */ +"%ld %% left" = "%ld %% resterend"; + +/* Percentage left menuitem */ +"%ld:%02ld left (%ld%%)" = "%1$ld:%2$ld resterend (%3$ld%%)"; + +/* Update menuitem + Update notification */ +"A newer version is available" = "Een nieuwere versie is beschikbaar"; + +/* Notification title */ +"Battery Time Remaining" = "Resterende Batterij Tijd"; + +/* Update menuitem */ +"Checking for updates…" = "Controleren op updates…"; + +/* Update menuitem */ +"Could not check for updates" = "Kon niet controleren op updates"; + +/* Open Energy Saver Preferences menuitem */ +"Energy Saver Preferences…" = "Open 'Energiestand'…"; + +/* Remaining menuitem */ +"Loading…" = "Laden…"; + +/* Notification menuitem */ +"Notifications" = "Notificatie bij"; + +/* Powersource menuitem */ +"Power source: %@" = "Stroombron: %@"; + +/* Powersource menuitem */ +"Power source: Unknown" = "Stroombron: Onbekend"; + +/* Quit menuitem */ +"Quit" = "Stop"; + +/* Start at login setting */ +"Start at login" = "Start bij inloggen"; + +/* Update menuitem */ +"Up to date" = "Up to date"; +