Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added internationalization support to the installer and parts of the …

…plugin.

Signed-off-by: Jonathan 'Wolf' Rentzsch <jwr.git@redshed.net>
  • Loading branch information...
commit 2b9475719cb974292fa8dceb15414ab4a0966b98 1 parent 8fca71e
@eczarny eczarny authored committed
View
77 ClickToFlash.xcodeproj/project.pbxproj
@@ -23,16 +23,17 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
+ 072189AD0F30D853008C8944 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 072189AB0F30D853008C8944 /* Localizable.strings */; };
+ 072189B30F30D982008C8944 /* Installer.xib in Resources */ = {isa = PBXBuildFile; fileRef = 072189B10F30D982008C8944 /* Installer.xib */; };
+ 072189BE0F30D9C3008C8944 /* ContextualMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 072189BA0F30D9C3008C8944 /* ContextualMenu.xib */; };
+ 072189BF0F30D9C3008C8944 /* WhitelistPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = 072189BC0F30D9C3008C8944 /* WhitelistPanel.xib */; };
558405550E0F2C2B00EA991B /* CTFInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 558405540E0F2C2B00EA991B /* CTFInstaller.m */; };
558405690E0F2DFA00EA991B /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55EB70560E04A8B80016593D /* Cocoa.framework */; };
5584056B0E0F2DFE00EA991B /* CTFInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 558405540E0F2C2B00EA991B /* CTFInstaller.m */; };
- 5584056C0E0F2E0100EA991B /* Installer.xib in Resources */ = {isa = PBXBuildFile; fileRef = 558405560E0F2C4900EA991B /* Installer.xib */; };
5584064B0E0F35A000EA991B /* ClickToFlash.plugin in Resources */ = {isa = PBXBuildFile; fileRef = 55EB70420E04A8640016593D /* ClickToFlash.plugin */; };
55EB70480E04A8850016593D /* Plugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 55EB703D0E04A84F0016593D /* Plugin.m */; };
55EB70580E04A8B80016593D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55EB70560E04A8B80016593D /* Cocoa.framework */; };
55EB70590E04A8B80016593D /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55EB70570E04A8B80016593D /* WebKit.framework */; };
- 79A21C4B0F30B735009424B8 /* ContextualMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 79A21C470F30B735009424B8 /* ContextualMenu.xib */; };
- 79A21C4C0F30B735009424B8 /* WhitelistPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = 79A21C480F30B735009424B8 /* WhitelistPanel.xib */; };
79A21C4D0F30B735009424B8 /* CTFWhitelistWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 79A21C490F30B735009424B8 /* CTFWhitelistWindowController.m */; };
D0FB700F0F2FE35000DCB854 /* ContainerImage.png in Resources */ = {isa = PBXBuildFile; fileRef = D0FB700E0F2FE35000DCB854 /* ContainerImage.png */; };
D0FB70100F2FE35000DCB854 /* ContainerImage.png in Resources */ = {isa = PBXBuildFile; fileRef = D0FB700E0F2FE35000DCB854 /* ContainerImage.png */; };
@@ -63,9 +64,12 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
+ 072189AC0F30D853008C8944 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = Installer/English.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 072189B20F30D982008C8944 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Installer/English.lproj/Installer.xib; sourceTree = "<group>"; };
+ 072189BB0F30D9C3008C8944 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Plugin/English.lproj/ContextualMenu.xib; sourceTree = "<group>"; };
+ 072189BD0F30D9C3008C8944 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Plugin/English.lproj/WhitelistPanel.xib; sourceTree = "<group>"; };
558405530E0F2C2B00EA991B /* CTFInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTFInstaller.h; path = Installer/CTFInstaller.h; sourceTree = "<group>"; };
558405540E0F2C2B00EA991B /* CTFInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTFInstaller.m; path = Installer/CTFInstaller.m; sourceTree = "<group>"; };
- 558405560E0F2C4900EA991B /* Installer.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Installer.xib; path = Installer/Installer.xib; sourceTree = "<group>"; };
558405590E0F2D6700EA991B /* Info-Installer.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; name = "Info-Installer.plist"; path = "Installer/Info-Installer.plist"; sourceTree = "<group>"; };
558405610E0F2DE900EA991B /* Install ClickToFlash.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Install ClickToFlash.app"; sourceTree = BUILT_PRODUCTS_DIR; };
55EB703C0E04A84F0016593D /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = Plugin/Plugin.h; sourceTree = "<group>"; };
@@ -74,8 +78,6 @@
55EB70560E04A8B80016593D /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
55EB70570E04A8B80016593D /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = "<absolute>"; };
55EB70610E04A8D00016593D /* Info-Plugin.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "Info-Plugin.plist"; path = "Plugin/Info-Plugin.plist"; sourceTree = "<group>"; };
- 79A21C470F30B735009424B8 /* ContextualMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ContextualMenu.xib; path = Plugin/ContextualMenu.xib; sourceTree = "<group>"; };
- 79A21C480F30B735009424B8 /* WhitelistPanel.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = WhitelistPanel.xib; path = Plugin/WhitelistPanel.xib; sourceTree = "<group>"; };
79A21C490F30B735009424B8 /* CTFWhitelistWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTFWhitelistWindowController.m; path = Plugin/CTFWhitelistWindowController.m; sourceTree = "<group>"; };
79A21C4A0F30B735009424B8 /* CTFWhitelistWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTFWhitelistWindowController.h; path = Plugin/CTFWhitelistWindowController.h; sourceTree = "<group>"; };
D0FB700E0F2FE35000DCB854 /* ContainerImage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ContainerImage.png; path = Images/ContainerImage.png; sourceTree = "<group>"; };
@@ -108,8 +110,9 @@
D0FB700E0F2FE35000DCB854 /* ContainerImage.png */,
558405530E0F2C2B00EA991B /* CTFInstaller.h */,
558405540E0F2C2B00EA991B /* CTFInstaller.m */,
- 558405560E0F2C4900EA991B /* Installer.xib */,
558405590E0F2D6700EA991B /* Info-Installer.plist */,
+ 072189B10F30D982008C8944 /* Installer.xib */,
+ 072189AB0F30D853008C8944 /* Localizable.strings */,
);
name = Installer;
sourceTree = "<group>";
@@ -117,7 +120,7 @@
55EB70300E04A8410016593D = {
isa = PBXGroup;
children = (
- 55EB70540E04A89C0016593D /* Plug-in */,
+ 55EB70540E04A89C0016593D /* Plugin */,
558405520E0F2C2200EA991B /* Installer */,
55EB70550E04A8A40016593D /* Frameworks */,
55EB70430E04A8640016593D /* Products */,
@@ -133,18 +136,18 @@
name = Products;
sourceTree = "<group>";
};
- 55EB70540E04A89C0016593D /* Plug-in */ = {
+ 55EB70540E04A89C0016593D /* Plugin */ = {
isa = PBXGroup;
children = (
- 55EB703C0E04A84F0016593D /* Plugin.h */,
- 55EB703D0E04A84F0016593D /* Plugin.m */,
- 55EB70610E04A8D00016593D /* Info-Plugin.plist */,
- 79A21C470F30B735009424B8 /* ContextualMenu.xib */,
- 79A21C480F30B735009424B8 /* WhitelistPanel.xib */,
+ 072189BA0F30D9C3008C8944 /* ContextualMenu.xib */,
79A21C490F30B735009424B8 /* CTFWhitelistWindowController.m */,
79A21C4A0F30B735009424B8 /* CTFWhitelistWindowController.h */,
+ 55EB70610E04A8D00016593D /* Info-Plugin.plist */,
+ 55EB703C0E04A84F0016593D /* Plugin.h */,
+ 55EB703D0E04A84F0016593D /* Plugin.m */,
+ 072189BC0F30D9C3008C8944 /* WhitelistPanel.xib */,
);
- name = "Plug-in";
+ name = Plugin;
sourceTree = "<group>";
};
55EB70550E04A8A40016593D /* Frameworks */ = {
@@ -220,8 +223,9 @@
buildActionMask = 2147483647;
files = (
5584064B0E0F35A000EA991B /* ClickToFlash.plugin in Resources */,
- 5584056C0E0F2E0100EA991B /* Installer.xib in Resources */,
D0FB70100F2FE35000DCB854 /* ContainerImage.png in Resources */,
+ 072189B30F30D982008C8944 /* Installer.xib in Resources */,
+ 072189AD0F30D853008C8944 /* Localizable.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -230,8 +234,8 @@
buildActionMask = 2147483647;
files = (
D0FB700F0F2FE35000DCB854 /* ContainerImage.png in Resources */,
- 79A21C4B0F30B735009424B8 /* ContextualMenu.xib in Resources */,
- 79A21C4C0F30B735009424B8 /* WhitelistPanel.xib in Resources */,
+ 072189BE0F30D9C3008C8944 /* ContextualMenu.xib in Resources */,
+ 072189BF0F30D9C3008C8944 /* WhitelistPanel.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -266,9 +270,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 55EB70480E04A8850016593D /* Plugin.m in Sources */,
558405550E0F2C2B00EA991B /* CTFInstaller.m in Sources */,
79A21C4D0F30B735009424B8 /* CTFWhitelistWindowController.m in Sources */,
+ 55EB70480E04A8850016593D /* Plugin.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -292,6 +296,41 @@
};
/* End PBXTargetDependency section */
+/* Begin PBXVariantGroup section */
+ 072189AB0F30D853008C8944 /* Localizable.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 072189AC0F30D853008C8944 /* English */,
+ );
+ name = Localizable.strings;
+ sourceTree = "<group>";
+ };
+ 072189B10F30D982008C8944 /* Installer.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 072189B20F30D982008C8944 /* English */,
+ );
+ name = Installer.xib;
+ sourceTree = "<group>";
+ };
+ 072189BA0F30D9C3008C8944 /* ContextualMenu.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 072189BB0F30D9C3008C8944 /* English */,
+ );
+ name = ContextualMenu.xib;
+ sourceTree = "<group>";
+ };
+ 072189BC0F30D9C3008C8944 /* WhitelistPanel.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 072189BD0F30D9C3008C8944 /* English */,
+ );
+ name = WhitelistPanel.xib;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
/* Begin XCBuildConfiguration section */
558405640E0F2DE900EA991B /* Debug */ = {
isa = XCBuildConfiguration;
View
28 Installer/CTFInstaller.m
@@ -45,14 +45,20 @@ - (void)finishLaunching
NSString *pathToClickToFlash = [self pathToClickToFlash];
if (!pathToClickToFlash) {
- NSInteger result = NSRunAlertPanel(@"Install ClickToFlash", @"ClickToFlash is not installed. Would you like to install it for this user?", @"Install", @"Cancel", nil);
+ NSString *title = NSLocalizedString(@"Install ClickToFlash", @"Install ClickToFlash");
+ NSString *message = NSLocalizedString(@"ClickToFlash is not installed. Would you like to install it for this user?", @"ClickToFlash is not installed. Would you like to install it for this user?");
+
+ NSInteger result = NSRunAlertPanel(title, message, NSLocalizedString(@"Install", @"Install"), NSLocalizedString(@"Cancel", @"Cancel"), nil);
if (result == NSAlertDefaultReturn) {
[self installClickToFlash];
}
} else {
- NSInteger result = NSRunAlertPanel(@"Remove ClickToFlash", @"ClickToFlash is currently installed. Would you like to remove it?", @"Remove", @"Cancel", nil);
+ NSString *title = NSLocalizedString(@"Remove ClickToFlash", @"Remove ClickToFlash");
+ NSString *message = NSLocalizedString(@"ClickToFlash is currently installed. Would you like to remove it?", @"ClickToFlash is currently installed. Would you like to remove it?");
+
+ NSInteger result = NSRunAlertPanel(title, message, NSLocalizedString(@"Remove", @"Remove"), NSLocalizedString(@"Cancel", @"Cancel"), nil);
if (result == NSAlertDefaultReturn) {
[self removeClickToFlash];
@@ -92,11 +98,17 @@ - (id) installClickToFlash
}
toPath = [toPath stringByAppendingPathComponent:@"ClickToFlash.plugin"];
-
+
+ NSString *title = NSLocalizedString(@"Install ClickToFlash", @"Install ClickToFlash");
+
if ([[NSFileManager defaultManager] copyPath:fromPath toPath:toPath handler:nil]) {
- NSRunAlertPanel(@"Install ClickToFlash", @"ClickToFlash has been installed. Quit and relaunch Safari to activate ClickToFlash.", @"OK", nil, nil);
+ NSString *message = NSLocalizedString(@"ClickToFlash has been installed. Quit and relaunch Safari to activate ClickToFlash.", @"ClickToFlash has been installed. Quit and relaunch Safari to activate ClickToFlash.");
+
+ NSRunAlertPanel(title, message, NSLocalizedString(@"OK", @"OK"), nil, nil);
} else {
- NSRunAlertPanel(@"Install ClickToFlash", @"ClickToFlash could not be installed.", @"OK", nil, nil);
+ NSString *message = NSLocalizedString(@"ClickToFlash could not be installed.", @"ClickToFlash could not be installed.");
+
+ NSRunAlertPanel(title, message, NSLocalizedString(@"OK", @"OK"), nil, nil);
}
[self terminate:self];
@@ -108,7 +120,11 @@ - (id) removeClickToFlash
NSString *path = [self pathToClickToFlash];
if ([[NSFileManager defaultManager] removeFileAtPath:path handler:nil]) {
- NSRunAlertPanel(@"Remove ClickToFlash", @"ClickToFlash has been removed", @"OK", nil, nil);
+ NSString *title = NSLocalizedString(@"Remove ClickToFlash", @"Remove ClickToFlash");
+ NSString *message = NSLocalizedString(@"ClickToFlash has been removed.", @"ClickToFlash has been removed.");
+
+ NSRunAlertPanel(title, message, NSLocalizedString(@"OK", @"OK"), nil, nil);
+
[self terminate:self];
}
}
View
0  Installer/Installer.xib → Installer/English.lproj/Installer.xib
File renamed without changes
View
BIN  Installer/English.lproj/Localizable.strings
Binary file not shown
View
0  Plugin/ContextualMenu.xib → Plugin/English.lproj/ContextualMenu.xib
File renamed without changes
View
0  Plugin/WhitelistPanel.xib → Plugin/English.lproj/WhitelistPanel.xib
File renamed without changes
View
10 Plugin/Plugin.m
@@ -189,8 +189,8 @@ - (IBAction)addToWhitelist:(id)sender;
NSString *message = [NSString stringWithFormat:NSLocalizedString(@"Add %@ to the white list?", @"Add %@ to the white list?"), self.host];
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
- [alert addButtonWithTitle:@"Add to whitelist"];
- [alert addButtonWithTitle:@"Cancel"];
+ [alert addButtonWithTitle:NSLocalizedString(@"Add to white list", @"Add to white list")];
+ [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"Cancel")];
[alert setMessageText:title];
[alert setInformativeText:message];
[alert setAlertStyle:NSInformationalAlertStyle];
@@ -214,12 +214,12 @@ - (IBAction)removeFromWhitelist:(id)sender;
if (![self _isHostWhitelisted])
return;
- NSString *title = NSLocalizedString(@"Remove from whitelist?", @"Remove from whitelist?");
+ NSString *title = NSLocalizedString(@"Remove from white list?", @"Remove from white list?");
NSString *message = [NSString stringWithFormat:NSLocalizedString(@"Remove %@ from the white list?", @"Remove %@ from the white list?"), self.host];
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
- [alert addButtonWithTitle:@"Remove from whitelist"];
- [alert addButtonWithTitle:@"Cancel"];
+ [alert addButtonWithTitle:NSLocalizedString(@"Remove from white list", @"Remove from white list")];
+ [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"Cancel")];
[alert setMessageText:title];
[alert setInformativeText:message];
[alert setAlertStyle:NSInformationalAlertStyle];
Please sign in to comment.
Something went wrong with that request. Please try again.