Mercurial > pidgin.yaz
changeset 6573:cc41123c684a
[gaim-migrate @ 7095]
Bjoern Voigt writes:
"As far as I can see, you commited a patch, which adds support for "Get
User Info" on Yahoo and MSN. It's not my small Yahoo Get Info patch,
it's the bigger one, which parses Yahoo and MSN profile pages.
I prepared a patch for it, which adds i18n macros to this patch.
Please commit the attached patch i18n21.patch.
The patch works fine for Yahoo contacts with English language
preference. Unfortunately the patch doesn't work with contacts with
other language preferences. The problem is, that in Yahoo every user
can set up a language for his/her profile. So
http://profiles.yahoo.com/CONTACT can deliver English, German, French,
... pages, depending on CONTACT's preference. The yahoo_get_info()
functions doesn't handle this and it's not easy to handle this.
I have some ideas, how to fix this issue. I like to discuss this with
the author of the patch or in gaim-devel."
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Fri, 22 Aug 2003 20:06:18 +0000 |
parents | 4f097c1069b0 |
children | 6256c2903d56 |
files | src/protocols/msn/msn.c src/protocols/yahoo/yahoo.c |
diffstat | 2 files changed, 46 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/msn/msn.c Fri Aug 22 12:09:46 2003 +0000 +++ b/src/protocols/msn/msn.c Fri Aug 22 20:06:18 2003 +0000 @@ -1167,7 +1167,7 @@ if (!url_text || !strcmp(url_text,"")) { g_show_info_text(NULL, NULL, 2, - "<html><body><b>Error retrieving profile</b></body></html>", NULL); + _("<html><body><b>Error retrieving profile</b></body></html>"), NULL); return; } @@ -1211,27 +1211,27 @@ /* extract their Name and put it in */ info_extract_field(stripped, url_text, "\tName", 0, "\t", '\n', - "Undisclosed", "Name", 0, NULL); + _("Undisclosed"), _("Name"), 0, NULL); /* extract their Age and put it in */ info_extract_field(stripped, url_text, "\tAge", 0, "\t", '\n', - "Undisclosed", "Age", 0, NULL); + _("Undisclosed"), _("Age"), 0, NULL); /* extract their Gender and put it in */ info_extract_field(stripped, url_text, "\tGender", 6, "\t", '\n', - "Undisclosed", "Gender", 0, NULL); + _("Undisclosed"), _("Gender"), 0, NULL); /* extract their MaritalStatus and put it in */ info_extract_field(stripped, url_text, "\tMaritalStatus", 0, "\t", '\n', - "Undisclosed", "Marital Status", 0, NULL); + _("Undisclosed"), _("Marital Status"), 0, NULL); /* extract their Location and put it in */ info_extract_field(stripped, url_text, "\tLocation", 0, "\t", '\n', - "Undisclosed", "Location", 0, NULL); + _("Undisclosed"), _("Location"), 0, NULL); /* extract their Occupation and put it in */ info_extract_field(stripped, url_text, "\t Occupation", 6, "\t", '\n', - "Undisclosed", "Occupation", 0, NULL); + _("Undisclosed"), _("Occupation"), 0, NULL); /* the fields, 'A Little About Me', 'Favorite Things', 'Hobbies and Interests', * 'Favorite Quote', and 'My Homepage' may or may not appear, in any combination. @@ -1241,48 +1241,48 @@ /* check if they have A Little About Me */ if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "Favorite Things", '\n', - NULL, "A Little About Me", 0, NULL)) + NULL, _("A Little About Me"), 0, NULL)) if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "Hobbies and Interests", '\n', - NULL, "A Little About Me", 0, NULL)) + NULL, _("A Little About Me"), 0, NULL)) if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "Favorite Quote", '\n', - NULL, "A Little About Me", 0, NULL)) + NULL, _("A Little About Me"), 0, NULL)) if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "My Homepage\tTake a look", '\n', - NULL, "A Little About Me", 0, NULL)) + NULL, _("A Little About Me"), 0, NULL)) info_extract_field(stripped, url_text, "\tA Little About Me", 1, "last updated", '\n', - NULL, "A Little About Me", 0, NULL); + NULL, _("A Little About Me"), 0, NULL); /* check if they have Favorite Things */ if(!info_extract_field(stripped, url_text, "Favorite Things", 1, "Hobbies and Interests", '\n', - NULL, "Favorite Things", 0, NULL)) + NULL, _("Favorite Things"), 0, NULL)) if(!info_extract_field(stripped, url_text, "Favorite Things", 1, "Favorite Quote", '\n', NULL, "Favorite Things", 0, NULL)) if(info_extract_field(stripped, url_text, "Favorite Things", 1, "My Homepage\tTake a look", '\n', - NULL, "Favorite Things", 0, NULL)) + NULL, _("Favorite Things"), 0, NULL)) info_extract_field(stripped, url_text, "Favorite Things", 1, "last updated", '\n', - NULL, "Favorite Things", 0, NULL); + NULL, _("Favorite Things"), 0, NULL); /* check if they have Hobbies and Interests */ if(!info_extract_field(stripped, url_text, "Hobbies and Interests", 1, "Favorite Quote", '\n', - NULL, "Hobbies and Interests", 0, NULL)) + NULL, _("Hobbies and Interests"), 0, NULL)) if(info_extract_field(stripped, url_text, "Hobbies and Interests", 1, "My Homepage\tTake a look", '\n', - NULL, "Hobbies and Interests", 0, NULL)) + NULL, _("Hobbies and Interests"), 0, NULL)) info_extract_field(stripped, url_text, "Hobbies and Interests", 1, "last updated", '\n', - NULL, "Hobbies and Interests", 0, NULL); + NULL, _("Hobbies and Interests"), 0, NULL); /* check if they have Favorite Quote */ if(!info_extract_field(stripped, url_text, "Favorite Quote", 1, "My Homepage\tTake a look", '\n', - NULL, "Favorite Quote", 0, NULL)) + NULL, _("Favorite Quote"), 0, NULL)) info_extract_field(stripped, url_text, "Favorite Quote", 1, "last updated", '\n', - NULL, "Favorite Quote", 0, NULL); + NULL, _("Favorite Quote"), 0, NULL); /* extract the last updated date and put it in */ info_extract_field(stripped, url_text, "\tlast updated:", 1, "\n", '\n', - NULL, "Last Updated", 0, NULL); + NULL, _("Last Updated"), 0, NULL); /* if we were able to fetch a homepage url earlier, stick it in there */ if(user_url) { - g_snprintf(buf,sizeof(buf),"<b>Home Page:</b><br><a href=\"%s\">%s</a><br>\n",user_url,user_url); + g_snprintf(buf,sizeof(buf),"<b>%s:</b><br><a href=\"%s\">%s</a><br>\n",_("Home Page"),user_url,user_url); strcat(url_text,buf); }
--- a/src/protocols/yahoo/yahoo.c Fri Aug 22 12:09:46 2003 +0000 +++ b/src/protocols/yahoo/yahoo.c Fri Aug 22 20:06:18 2003 +0000 @@ -1399,7 +1399,7 @@ /* we failed to grab the profile URL */ if (!url_text) { g_show_info_text(NULL, NULL, 2, - "<html><body><b>Error retrieving profile</b></body></html>", NULL); + _("<html><body><b>Error retrieving profile</b></body></html>"), NULL); return; } @@ -1411,10 +1411,9 @@ */ p = strstr(url_text, "Adult Profiles Warning Message"); if (p) { - strcpy(buf, "<b>Sorry, profiles marked as containing adult content are "); - strcat(buf, "not supported at this time.</b><br><br>\n"); + strcpy(buf, _("<b>Sorry, profiles marked as containing adult content are not supported at this time.</b><br><br>\n")); info_extract_field(url_text, buf, ".idname=", 0, "%26", 0, NULL, - "If you wish to view this profile, you will need to visit this link in your web browser", + _("If you wish to view this profile, you will need to visit this link in your web browser"), 1, YAHOO_PROFILE_URL); strcat(buf, "</body></html>\n"); g_show_info_text(NULL, NULL, 2, buf, NULL); @@ -1446,39 +1445,39 @@ /* extract their Yahoo! ID and put it in */ info_extract_field(stripped, url_text, "Yahoo! ID:", 2, "\n", 0, - NULL, "Yahoo! ID", 0, NULL); + NULL, _("Yahoo! ID"), 0, NULL); /* extract their Email address and put it in */ info_extract_field(stripped, url_text, "My Email", 5, "\n", 0, - "Private", "Email", 0, NULL); + _("Private"), _("Email"), 0, NULL); /* extract the Nickname if it exists */ info_extract_field(stripped, url_text, "Nickname:", 1, "\n", '\n', - NULL, "Nickname", 0, NULL); + NULL, _("Nickname"), 0, NULL); /* extract their RealName and put it in */ info_extract_field(stripped, url_text, "RealName:", 1, "\n", '\n', - NULL, "Real Name", 0, NULL); + NULL, _("Real Name"), 0, NULL); /* extract their Location and put it in */ info_extract_field(stripped, url_text, "Location:", 2, "\n", '\n', - NULL, "Location", 0, NULL); + NULL, _("Location"), 0, NULL); /* extract their Age and put it in */ info_extract_field(stripped, url_text, "Age:", 3, "\n", '\n', - NULL, "Age", 0, NULL); + NULL, _("Age"), 0, NULL); /* extract their MaritalStatus and put it in */ info_extract_field(stripped, url_text, "MaritalStatus:", 3, "\n", '\n', - "No Answer", "Marital Status", 0, NULL); + _("No Answer"), _("Marital Status"), 0, NULL); /* extract their Gender and put it in */ info_extract_field(stripped, url_text, "Gender:", 3, "\n", '\n', - "No Answer", "Gender", 0, NULL); + _("No Answer"), _("Gender"), 0, NULL); /* extract their Occupation and put it in */ info_extract_field(stripped, url_text, "Occupation:", 2, "\n", '\n', - NULL, "Occupation", 0, NULL); + NULL, _("Occupation"), 0, NULL); /* Hobbies, Latest News, and Favorite Quote are a bit different, since the * values can contain embedded newlines... but any or all of them can also @@ -1488,24 +1487,24 @@ * bunch. */ if (!info_extract_field(stripped, url_text, "Hobbies:", 1, "Latest News", - '\n', NULL, "Hobbies", 0, NULL)) + '\n', NULL, _("Hobbies"), 0, NULL)) if (!info_extract_field(stripped, url_text, "Hobbies:", 1, "Favorite Quote", - '\n', NULL, "Hobbies", 0, NULL)) + '\n', NULL, _("Hobbies"), 0, NULL)) info_extract_field(stripped, url_text, "Hobbies:", 1, "Links", - '\n', NULL, "Hobbies", 0, NULL); + '\n', NULL, _("Hobbies"), 0, NULL); if (!info_extract_field(stripped, url_text, "Latest News:", 1, "Favorite Quote", - '\n', NULL, "Latest News", 0, NULL)) + '\n', NULL, _("Latest News"), 0, NULL)) info_extract_field(stripped, url_text, "Latest News:", 1, "Links", - '\n', NULL, "Latest News", 0, NULL); + '\n', NULL, _("Latest News"), 0, NULL); info_extract_field(stripped, url_text, "Favorite Quote:", 0, "Links", - '\n', NULL, "Favorite Quote", 0, NULL); + '\n', NULL, _("Favorite Quote"), 0, NULL); /* Home Page will either be "No home page specified", * or "Home Page: " and a link. */ p = strstr(stripped, "No home page specified"); if (!p) info_extract_field(stripped, url_text, "Home Page:", 1, " ", 0, NULL, - "Home Page", 1, NULL); + _("Home Page"), 1, NULL); /* Cool Link {1,2,3} is also different. If "No cool link specified" exists, * then we have none. If we have one however, we'll need to check and see if @@ -1515,19 +1514,19 @@ p = strstr(stripped,"No cool link specified"); if (!p) if (info_extract_field(stripped, url_text, "Cool Link 1:", 1, " ", 0, NULL, - "Cool Link 1", 1, NULL)) + _("Cool Link 1"), 1, NULL)) if (info_extract_field(stripped, url_text, "Cool Link 2:", 1, " ", 0, NULL, - "Cool Link 2", 1, NULL)) + _("Cool Link 2"), 1, NULL)) info_extract_field(stripped, url_text, "Cool Link 3:", 1, " ", 0, NULL, - "Cool Link 3", 1, NULL); + _("Cool Link 3"), 1, NULL); /* see if Member Since is there, and if so, extract it. */ info_extract_field(stripped, url_text, "Member Since:", 1, "Last Updated:", - '\n', NULL, "Member Since", 0, NULL); + '\n', NULL, _("Member Since"), 0, NULL); /* extract the Last Updated date and put it in */ info_extract_field(stripped, url_text, "Last Updated:", 1, "\n", '\n', NULL, - "Last Updated", 0, NULL); + _("Last Updated"), 0, NULL); /* finish off the html */ strcat(url_text, "</body></html>\n");