adium 3328:158f4d2000b3: When performing further localization (t...
commits at adium.im
commits at adium.im
Mon Sep 20 03:45:20 UTC 2010
details: http://hg.adium.im/adium/rev/158f4d2000b3
revision: 3328:158f4d2000b3
author: Evan Schoenberg
date: Sun Sep 19 22:40:24 2010 -0500
When performing further localization (to add a contact's name to the contextual menu item, for example) we must be sure to compare with the libpurple-localized version of the string, or we will fail to provide the substitution when not running in English.
Many thanks to Yann ("YR") Ricquebourg for his detailed and patient reporting of this problem.
(transplanted from 4fc410bdfaf414281f750fe1f38f004b94139d72)
Subject: adium 3329:d1c7e2b6b9d3: Initiate Chat is a menu item on multiple prpls (notably MSN and Google Talk via XMPP, on first blush), so move its localization substitution to the superclass
details: http://hg.adium.im/adium/rev/d1c7e2b6b9d3
revision: 3329:d1c7e2b6b9d3
author: Evan Schoenberg
date: Sun Sep 19 22:44:41 2010 -0500
Initiate Chat is a menu item on multiple prpls (notably MSN and Google Talk via XMPP, on first blush), so move its localization substitution to the superclass
(transplanted from 9742c064d31e79dbe58ef18cc537ce1252fe5478)
diffs (104 lines):
diff -r 41ea66fe1dff -r d1c7e2b6b9d3 Plugins/Purple Service/CBPurpleAccount.m
--- a/Plugins/Purple Service/CBPurpleAccount.m Sun Sep 19 22:25:53 2010 -0500
+++ b/Plugins/Purple Service/CBPurpleAccount.m Sun Sep 19 22:44:41 2010 -0500
@@ -2880,12 +2880,17 @@
//Subclasses may override to provide a localized label and/or prevent a specified label from being shown
- (NSString *)titleForContactMenuLabel:(const char *)label forContact:(AIListContact *)inContact
{
- /* Remove the underscore 'hints' which libpurple includes for gtk usage */
- return [[NSString stringWithUTF8String:label] stringByReplacingOccurrencesOfString:@"_" withString:@""];
+ if ((strcmp(label, _("Initiate Chat")) == 0) || (strcmp(label, _("Initiate _Chat")) == 0)) {
+ return [NSString stringWithFormat:AILocalizedString(@"Initiate Multiuser Chat with %@",nil), inContact.formattedUID];
+
+ } else {
+ /* Remove the underscore 'hints' which libpurple includes for gtk usage */
+ return [[NSString stringWithUTF8String:label] stringByReplacingOccurrencesOfString:@"_" withString:@""];
+ }
}
/*!
-* @brief Menu items for the account's actions
+ * @brief Menu items for the account's actions
*
* Returns an array of menu items for account-specific actions. This is the best place to add protocol-specific
* actions that aren't otherwise supported by Adium. It will only be queried if the account is online.
diff -r 41ea66fe1dff -r d1c7e2b6b9d3 Plugins/Purple Service/ESPurpleJabberAccount.m
--- a/Plugins/Purple Service/ESPurpleJabberAccount.m Sun Sep 19 22:25:53 2010 -0500
+++ b/Plugins/Purple Service/ESPurpleJabberAccount.m Sun Sep 19 22:44:41 2010 -0500
@@ -513,19 +513,19 @@
#pragma mark Menu items
- (NSString *)titleForContactMenuLabel:(const char *)label forContact:(AIListContact *)inContact
{
- if (strcmp(label, "Un-hide From") == 0) {
+ if (strcmp(label, _("Un-hide From")) == 0) {
return [NSString stringWithFormat:AILocalizedString(@"Un-hide From %@",nil),inContact.formattedUID];
- } else if (strcmp(label, "Temporarily Hide From") == 0) {
+ } else if (strcmp(label, _("Temporarily Hide From")) == 0) {
return [NSString stringWithFormat:AILocalizedString(@"Temporarily Hide From %@",nil),inContact.formattedUID];
- } else if (strcmp(label, "Unsubscribe") == 0) {
+ } else if (strcmp(label, _("Unsubscribe")) == 0) {
return [NSString stringWithFormat:AILocalizedString(@"Unsubscribe %@",nil),inContact.formattedUID];
- } else if (strcmp(label, "(Re-)Request authorization") == 0) {
+ } else if (strcmp(label, _("(Re-)Request authorization")) == 0) {
return [NSString stringWithFormat:AILocalizedString(@"Re-request Authorization from %@",nil),inContact.formattedUID];
- } else if (strcmp(label, "Cancel Presence Notification") == 0) {
+ } else if (strcmp(label, _("Cancel Presence Notification")) == 0) {
return [NSString stringWithFormat:AILocalizedString(@"Cancel Presence Notification to %@",nil),inContact.formattedUID];
} else if (strcmp(label, _("Ping")) == 0) {
@@ -538,16 +538,16 @@
- (NSString *)titleForAccountActionMenuLabel:(const char *)label
{
- if (strcmp(label, "Set User Info...") == 0) {
+ if (strcmp(label, _("Set User Info...")) == 0) {
return [AILocalizedString(@"Set User Info", nil) stringByAppendingEllipsis];
- } else if (strcmp(label, "Search for Users...") == 0) {
+ } else if (strcmp(label, _("Search for Users...")) == 0) {
return [AILocalizedString(@"Search for Users", nil) stringByAppendingEllipsis];
- } else if (strcmp(label, "Set Mood...") == 0) {
+ } else if (strcmp(label, _("Set Mood...")) == 0) {
return [AILocalizedString(@"Set Mood", nil) stringByAppendingEllipsis];
- } else if (strcmp(label, "Set Nickname...") == 0) {
+ } else if (strcmp(label, _("Set Nickname...")) == 0) {
return [AILocalizedString(@"Set Nickname", nil) stringByAppendingEllipsis];
}
diff -r 41ea66fe1dff -r d1c7e2b6b9d3 Plugins/Purple Service/ESPurpleMSNAccount.m
--- a/Plugins/Purple Service/ESPurpleMSNAccount.m Sun Sep 19 22:25:53 2010 -0500
+++ b/Plugins/Purple Service/ESPurpleMSNAccount.m Sun Sep 19 22:44:41 2010 -0500
@@ -530,10 +530,7 @@
#pragma mark Contact List Menu Items
- (NSString *)titleForContactMenuLabel:(const char *)label forContact:(AIListContact *)inContact
{
- if ((strcmp(label, _("Initiate Chat")) == 0) || (strcmp(label, _("Initiate _Chat")) == 0)) {
- return [NSString stringWithFormat:AILocalizedString(@"Initiate Multiuser Chat with %@",nil),inContact.formattedUID];
-
- } else if (strcmp(label, _("Send to Mobile")) == 0) {
+ if (strcmp(label, _("Send to Mobile")) == 0) {
return [NSString stringWithFormat:AILocalizedString(@"Send to %@'s Mobile",nil),inContact.formattedUID];
}
diff -r 41ea66fe1dff -r d1c7e2b6b9d3 Plugins/Purple Service/ESPurpleMeanwhileAccount.m
--- a/Plugins/Purple Service/ESPurpleMeanwhileAccount.m Sun Sep 19 22:25:53 2010 -0500
+++ b/Plugins/Purple Service/ESPurpleMeanwhileAccount.m Sun Sep 19 22:44:41 2010 -0500
@@ -191,10 +191,10 @@
#pragma mark Account Action Menu Items
- (NSString *)titleForAccountActionMenuLabel:(const char *)label
{
- if (strcmp(label, "Import Sametime List...") == 0) {
+ if (strcmp(label, _("Import Sametime List...")) == 0) {
return AILocalizedString(@"Import Sametime List...",nil);
- } else if (strcmp(label, "Export Sametime List...") == 0) {
+ } else if (strcmp(label, _("Export Sametime List...")) == 0) {
return AILocalizedString(@"Export Sametime List...",nil);
}
More information about the commits
mailing list