Mercurial > pidgin
comparison src/oscar.c @ 350:fd3cc0a28d5d
[gaim-migrate @ 360]
Some locale stuff
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 07 Jun 2000 18:33:21 +0000 |
parents | b402a23f35df |
children | cf895313fc50 |
comparison
equal
deleted
inserted
replaced
349:b402a23f35df | 350:fd3cc0a28d5d |
---|---|
88 GdkInputCondition condition) { | 88 GdkInputCondition condition) { |
89 struct aim_conn_t *conn = (struct aim_conn_t *)data; | 89 struct aim_conn_t *conn = (struct aim_conn_t *)data; |
90 | 90 |
91 if (condition & GDK_INPUT_EXCEPTION) { | 91 if (condition & GDK_INPUT_EXCEPTION) { |
92 signoff(); | 92 signoff(); |
93 hide_login_progress("Disconnected."); | 93 hide_login_progress(_("Disconnected.")); |
94 aim_logoff(gaim_sess); | 94 aim_logoff(gaim_sess); |
95 gdk_input_remove(inpa); | 95 gdk_input_remove(inpa); |
96 auth_failed(); | 96 auth_failed(); |
97 return; | 97 return; |
98 } | 98 } |
99 if (condition & GDK_INPUT_READ) { | 99 if (condition & GDK_INPUT_READ) { |
100 if (aim_get_command(gaim_sess, conn) < 0) { | 100 if (aim_get_command(gaim_sess, conn) < 0) { |
101 debug_print("connection error!\n"); | 101 debug_print(_("connection error!\n")); |
102 signoff(); | 102 signoff(); |
103 hide_login_progress("Disconnected."); | 103 hide_login_progress(_("Disconnected.")); |
104 aim_logoff(gaim_sess); | 104 aim_logoff(gaim_sess); |
105 auth_failed(); | 105 auth_failed(); |
106 gdk_input_remove(inpa); | 106 gdk_input_remove(inpa); |
107 } else { | 107 } else { |
108 aim_rxdispatch(gaim_sess); | 108 aim_rxdispatch(gaim_sess); |
115 struct aim_conn_t *conn; | 115 struct aim_conn_t *conn; |
116 struct client_info_s info = {"Gaim/Faim", 4, 30, 3141, "us", "en"}; | 116 struct client_info_s info = {"Gaim/Faim", 4, 30, 3141, "us", "en"}; |
117 struct aim_user *u; | 117 struct aim_user *u; |
118 char buf[256]; | 118 char buf[256]; |
119 | 119 |
120 sprintf(debug_buff, "Logging in %s\n", username); | 120 sprintf(debug_buff, _("Logging in %s\n"), username); |
121 debug_print(debug_buff); | 121 debug_print(debug_buff); |
122 | 122 |
123 sess = g_new0(struct aim_session_t, 1); | 123 sess = g_new0(struct aim_session_t, 1); |
124 aim_session_init(sess); | 124 aim_session_init(sess); |
125 /* we need an immediate queue because we don't use a while-loop to | 125 /* we need an immediate queue because we don't use a while-loop to |
126 * see if things need to be sent. */ | 126 * see if things need to be sent. */ |
127 sess->tx_enqueue = &aim_tx_enqueue__immediate; | 127 sess->tx_enqueue = &aim_tx_enqueue__immediate; |
128 gaim_sess = sess; | 128 gaim_sess = sess; |
129 | 129 |
130 sprintf(buf, "Looking up %s", FAIM_LOGIN_SERVER); | 130 sprintf(buf, _("Looking up %s"), FAIM_LOGIN_SERVER); |
131 set_login_progress(1, buf); | 131 set_login_progress(1, buf); |
132 conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, FAIM_LOGIN_SERVER); | 132 conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, FAIM_LOGIN_SERVER); |
133 | 133 |
134 if (conn == NULL) { | 134 if (conn == NULL) { |
135 debug_print("internal connection error\n"); | 135 debug_print(_("internal connection error\n")); |
136 #ifdef USE_APPLET | 136 #ifdef USE_APPLET |
137 setUserState(offline); | 137 setUserState(offline); |
138 #endif | 138 #endif |
139 set_state(STATE_OFFLINE); | 139 set_state(STATE_OFFLINE); |
140 hide_login_progress("Unable to login to AIM"); | 140 hide_login_progress(_("Unable to login to AIM")); |
141 return -1; | 141 return -1; |
142 } else if (conn->fd == -1) { | 142 } else if (conn->fd == -1) { |
143 #ifdef USE_APPLET | 143 #ifdef USE_APPLET |
144 setUserState(offline); | 144 setUserState(offline); |
145 #endif | 145 #endif |
146 set_state(STATE_OFFLINE); | 146 set_state(STATE_OFFLINE); |
147 if (conn->status & AIM_CONN_STATUS_RESOLVERR) { | 147 if (conn->status & AIM_CONN_STATUS_RESOLVERR) { |
148 sprintf(debug_buff, "couldn't resolve host\n"); | 148 sprintf(debug_buff, _("couldn't resolve host\n")); |
149 debug_print(debug_buff); | 149 debug_print(debug_buff); |
150 hide_login_progress(debug_buff); | 150 hide_login_progress(debug_buff); |
151 } else if (conn->status & AIM_CONN_STATUS_CONNERR) { | 151 } else if (conn->status & AIM_CONN_STATUS_CONNERR) { |
152 sprintf(debug_buff, "couldn't connect to host\n"); | 152 sprintf(debug_buff, _("couldn't connect to host\n")); |
153 debug_print(debug_buff); | 153 debug_print(debug_buff); |
154 hide_login_progress(debug_buff); | 154 hide_login_progress(debug_buff); |
155 } | 155 } |
156 return -1; | 156 return -1; |
157 } | 157 } |
158 g_snprintf(buf, sizeof(buf), "Signon: %s", username); | 158 g_snprintf(buf, sizeof(buf), _("Signon: %s"), username); |
159 set_login_progress(2, buf); | 159 set_login_progress(2, buf); |
160 | 160 |
161 aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL, | 161 aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL, |
162 AIM_CB_SPECIAL_AUTHSUCCESS, | 162 AIM_CB_SPECIAL_AUTHSUCCESS, |
163 gaim_parse_auth_resp, 0); | 163 gaim_parse_auth_resp, 0); |
181 "%s", username); | 181 "%s", username); |
182 g_snprintf(current_user->password, sizeof(current_user->password), | 182 g_snprintf(current_user->password, sizeof(current_user->password), |
183 "%s", password); | 183 "%s", password); |
184 save_prefs(); | 184 save_prefs(); |
185 | 185 |
186 debug_print("Password sent, waiting for response\n"); | 186 debug_print(_("Password sent, waiting for response\n")); |
187 | 187 |
188 return 0; | 188 return 0; |
189 } | 189 } |
190 | 190 |
191 void oscar_close() { | 191 void oscar_close() { |
195 set_state(STATE_OFFLINE); | 195 set_state(STATE_OFFLINE); |
196 if (inpa > 0) | 196 if (inpa > 0) |
197 gdk_input_remove(inpa); | 197 gdk_input_remove(inpa); |
198 inpa = -1; | 198 inpa = -1; |
199 aim_logoff(gaim_sess); | 199 aim_logoff(gaim_sess); |
200 debug_print("Signed off.\n"); | 200 debug_print(_("Signed off.\n")); |
201 } | 201 } |
202 | 202 |
203 int gaim_parse_auth_resp(struct aim_session_t *sess, | 203 int gaim_parse_auth_resp(struct aim_session_t *sess, |
204 struct command_rx_struct *command, ...) { | 204 struct command_rx_struct *command, ...) { |
205 struct aim_conn_t *bosconn = NULL; | 205 struct aim_conn_t *bosconn = NULL; |
208 debug_print(debug_buff); | 208 debug_print(debug_buff); |
209 | 209 |
210 if (sess->logininfo.errorcode) { | 210 if (sess->logininfo.errorcode) { |
211 switch (sess->logininfo.errorcode) { | 211 switch (sess->logininfo.errorcode) { |
212 case 0x18: | 212 case 0x18: |
213 do_error_dialog("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer.", "Gaim - Error"); | 213 do_error_dialog(_("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."), _("Gaim - Error")); |
214 break; | 214 break; |
215 case 0x05: | 215 case 0x05: |
216 do_error_dialog("Incorrect nickname or password.", "Gaim - Error"); | 216 do_error_dialog(_("Incorrect nickname or password."), _("Gaim - Error")); |
217 break; | 217 break; |
218 case 0x1c: | 218 case 0x1c: |
219 do_error_dialog("AOL has decided your client is too old. Please download a newer version from http://www.marko.net/gaim/", "Gaim - Error"); | 219 do_error_dialog(_("AOL has decided your client is too old. Please download a newer version from http://www.marko.net/gaim/"), _("Gaim - Error")); |
220 break; | 220 break; |
221 } | 221 } |
222 sprintf(debug_buff, "Login Error Code 0x%04x\n", | 222 sprintf(debug_buff, "Login Error Code 0x%04x\n", |
223 sess->logininfo.errorcode); | 223 sess->logininfo.errorcode); |
224 debug_print(debug_buff); | 224 debug_print(debug_buff); |
227 debug_print(debug_buff); | 227 debug_print(debug_buff); |
228 #ifdef USE_APPLET | 228 #ifdef USE_APPLET |
229 setUserState(offline); | 229 setUserState(offline); |
230 #endif | 230 #endif |
231 set_state(STATE_OFFLINE); | 231 set_state(STATE_OFFLINE); |
232 hide_login_progress("Authentication Failed"); | 232 hide_login_progress(_("Authentication Failed")); |
233 gdk_input_remove(inpa); | 233 gdk_input_remove(inpa); |
234 aim_conn_kill(sess, &command->conn); | 234 aim_conn_kill(sess, &command->conn); |
235 auth_failed(); | 235 auth_failed(); |
236 return 0; | 236 return 0; |
237 } | 237 } |
248 if (bosconn == NULL) { | 248 if (bosconn == NULL) { |
249 #ifdef USE_APPLET | 249 #ifdef USE_APPLET |
250 setUserState(offline); | 250 setUserState(offline); |
251 #endif | 251 #endif |
252 set_state(STATE_OFFLINE); | 252 set_state(STATE_OFFLINE); |
253 hide_login_progress("Internal Error"); | 253 hide_login_progress(_("Internal Error")); |
254 auth_failed(); | 254 auth_failed(); |
255 return -1; | 255 return -1; |
256 } else if (bosconn->status != 0) { | 256 } else if (bosconn->status != 0) { |
257 #ifdef USE_APPLET | 257 #ifdef USE_APPLET |
258 setUserState(offline); | 258 setUserState(offline); |
259 #endif | 259 #endif |
260 set_state(STATE_OFFLINE); | 260 set_state(STATE_OFFLINE); |
261 hide_login_progress("Could Not Connect"); | 261 hide_login_progress(_("Could Not Connect")); |
262 auth_failed(); | 262 auth_failed(); |
263 return -1; | 263 return -1; |
264 } | 264 } |
265 | 265 |
266 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_ACK, AIM_CB_ACK_ACK, NULL, 0); | 266 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_ACK, AIM_CB_ACK_ACK, NULL, 0); |
282 | 282 |
283 aim_auth_sendcookie(sess, bosconn, sess->logininfo.cookie); | 283 aim_auth_sendcookie(sess, bosconn, sess->logininfo.cookie); |
284 gaim_conn = bosconn; | 284 gaim_conn = bosconn; |
285 inpa = gdk_input_add(bosconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, | 285 inpa = gdk_input_add(bosconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
286 oscar_callback, bosconn); | 286 oscar_callback, bosconn); |
287 set_login_progress(4, "Connection established, cookie sent"); | 287 set_login_progress(4, _("Connection established, cookie sent")); |
288 return 1; | 288 return 1; |
289 } | 289 } |
290 | 290 |
291 gboolean change_password = FALSE; | 291 gboolean change_password = FALSE; |
292 char *old_password; | 292 char *old_password; |
575 struct command_rx_struct *command, ...) { | 575 struct command_rx_struct *command, ...) { |
576 u_short family; | 576 u_short family; |
577 u_short subtype; | 577 u_short subtype; |
578 | 578 |
579 char buf[2048], buf2[256]; | 579 char buf[2048], buf2[256]; |
580 sprintf(buf2, "Gaim - Error"); | 580 sprintf(buf2, _("Gaim - Error")); |
581 buf[0] = 0; | 581 buf[0] = 0; |
582 | 582 |
583 family = aimutil_get16(command->data+0); | 583 family = aimutil_get16(command->data+0); |
584 subtype = aimutil_get16(command->data+2); | 584 subtype = aimutil_get16(command->data+2); |
585 | 585 |
586 switch (family) { | 586 switch (family) { |
587 case 0x0001: | 587 case 0x0001: |
588 if (subtype == 0x000a) | 588 if (subtype == 0x000a) |
589 sprintf(buf, "You are sending messages too fast."); | 589 sprintf(buf, _("You are sending messages too fast.")); |
590 break; | 590 break; |
591 case 0x0002: | 591 case 0x0002: |
592 if (subtype == 0x0001) | 592 if (subtype == 0x0001) |
593 sprintf(buf, "Unknown SNAC error (I'm hungry)"); | 593 sprintf(buf, _("Unknown SNAC error (I'm hungry)")); |
594 break; | 594 break; |
595 case 0x0004: | 595 case 0x0004: |
596 if (subtype == 0x0001) | 596 if (subtype == 0x0001) |
597 sprintf(buf, "User is not online."); | 597 sprintf(buf, _("User is not online.")); |
598 else if (subtype == 0x000a) | 598 else if (subtype == 0x000a) |
599 sprintf(buf, "A message has been dropped."); | 599 sprintf(buf, _("A message has been dropped.")); |
600 break; | 600 break; |
601 } | 601 } |
602 | 602 |
603 if (buf[0] != 0) | 603 if (buf[0] != 0) |
604 do_error_dialog(buf, buf2); | 604 do_error_dialog(buf, buf2); |
620 prof = va_arg(ap, char *); | 620 prof = va_arg(ap, char *); |
621 infotype = va_arg(ap, u_short); | 621 infotype = va_arg(ap, u_short); |
622 va_end(ap); | 622 va_end(ap); |
623 | 623 |
624 if (prof == NULL || !strlen(prof)) { | 624 if (prof == NULL || !strlen(prof)) { |
625 do_error_dialog("User has no info/away message.", | 625 do_error_dialog(_("User has no info/away message."), |
626 "Gaim - User Info"); | 626 _("Gaim - User Info")); |
627 return 1; | 627 return 1; |
628 } | 628 } |
629 | 629 |
630 snprintf(buf, sizeof buf, "Username : <B>%s</B>\n<BR>" | 630 snprintf(buf, sizeof buf, _("Username : <B>%s</B>\n<BR>" |
631 "Warning Level : <B>%d %%</B>\n<BR>" | 631 "Warning Level : <B>%d %%</B>\n<BR>" |
632 "Online Since : <B>%s</B><BR>" | 632 "Online Since : <B>%s</B><BR>" |
633 "Idle Minutes : <B>%d</B>\n<BR><HR><BR>" | 633 "Idle Minutes : <B>%d</B>\n<BR><HR><BR>" |
634 "%s\n", | 634 "%s\n"), |
635 info->sn, | 635 info->sn, |
636 info->warnlevel, | 636 info->warnlevel, |
637 asctime(localtime(&info->onlinesince)), | 637 asctime(localtime(&info->onlinesince)), |
638 info->idletime, | 638 info->idletime, |
639 prof); | 639 prof); |