# HG changeset patch # User Mark Doliner # Date 1258917680 0 # Node ID 5f80ab7ac18341609103b1845f2d02cb28ec177e # Parent 8a90bd0a3b792605da55467a254efe0bba86a622 Mark a bunch of mxit strings for translation diff -r 8a90bd0a3b79 -r 5f80ab7ac183 libpurple/protocols/mxit/actions.c --- a/libpurple/protocols/mxit/actions.c Sun Nov 22 18:56:06 2009 +0000 +++ b/libpurple/protocols/mxit/actions.c Sun Nov 22 19:21:20 2009 +0000 @@ -150,37 +150,37 @@ /* validate pin */ pin = purple_request_fields_get_string( fields, "pin" ); if ( !pin ) { - err = "The PIN you entered is invalid."; + err = _("The PIN you entered is invalid."); goto out; } len = strlen( pin ); if ( ( len < 4 ) || ( len > 10 ) ) { - err = "The PIN you entered has an invalid length [4-10]."; + err = _("The PIN you entered has an invalid length [4-10]."); goto out; } for ( i = 0; i < len; i++ ) { if ( !g_ascii_isdigit( pin[i] ) ) { - err = "The PIN is invalid. It should only consist of digits [0-9]."; + err = _("The PIN is invalid. It should only consist of digits [0-9]."); goto out; } } pin2 = purple_request_fields_get_string( fields, "pin2" ); if ( ( !pin2 ) || ( strcmp( pin, pin2 ) != 0 ) ) { - err = "The two PINs you entered does not match."; + err = _("The two PINs you entered do not match."); goto out; } /* validate name */ name = purple_request_fields_get_string( fields, "name" ); if ( ( !name ) || ( strlen( name ) < 3 ) ) { - err = "The name you entered is invalid."; + err = _("The name you entered is invalid."); goto out; } /* validate birthdate */ bday = purple_request_fields_get_string( fields, "bday" ); if ( ( !bday ) || ( strlen( bday ) < 10 ) || ( !validateDate( bday ) ) ) { - err = "The birthday you entered is invalid. The correct format is: 'YYYY-MM-DD'."; + err = _("The birthday you entered is invalid. The correct format is: 'YYYY-MM-DD'."); goto out; } @@ -218,10 +218,7 @@ acount++; /* update gender */ - if ( purple_request_fields_get_choice( fields, "male" ) == 0 ) - profile->male = FALSE; - else - profile->male = TRUE; + profile->male = ( purple_request_fields_get_choice( fields, "male" ) == 0 ); g_snprintf( attrib, sizeof( attrib ), "\01%s\01%i\01%s", CP_PROFILE_GENDER, CP_PROF_TYPE_BOOL, ( profile->male ) ? "1" : "0" ); g_string_append( attributes, attrib ); acount++; diff -r 8a90bd0a3b79 -r 5f80ab7ac183 libpurple/protocols/mxit/formcmds.c --- a/libpurple/protocols/mxit/formcmds.c Sun Nov 22 18:56:06 2009 +0000 +++ b/libpurple/protocols/mxit/formcmds.c Sun Nov 22 19:21:20 2009 +0000 @@ -216,7 +216,7 @@ conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, from, session->acc); if (conv == NULL) { - purple_debug_error(MXIT_PLUGIN_ID, "Conversation with '%s' not found\n", from); + purple_debug_error(MXIT_PLUGIN_ID, _( "Conversation with '%s' not found\n" ), from); return; } @@ -268,7 +268,7 @@ dest = g_hash_table_lookup(hash, "dest"); /* find the destination */ if (dest) { - g_string_append_printf(msg, "%s", purple_url_decode(dest), (text) ? text : "Download"); /* add link to display message */ + g_string_append_printf(msg, "%s", purple_url_decode(dest), (text) ? text : _( "Download" )); /* add link to display message */ } if (text) @@ -333,7 +333,7 @@ reply = g_hash_table_lookup(hash, "replymsg"); if (reply) { g_string_append_printf(msg, "\n"); - mxit_add_html_link(mx, reply, "click here"); + mxit_add_html_link(mx, reply, _( "click here" )); } } diff -r 8a90bd0a3b79 -r 5f80ab7ac183 libpurple/protocols/mxit/login.c --- a/libpurple/protocols/mxit/login.c Sun Nov 22 18:56:06 2009 +0000 +++ b/libpurple/protocols/mxit/login.c Sun Nov 22 19:21:20 2009 +0000 @@ -226,7 +226,7 @@ struct MXitProfile* profile = session->profile; const char* str; const char* pin; - char* err = NULL; + const char* err = NULL; int len; int i; @@ -240,7 +240,7 @@ /* nickname */ str = purple_request_fields_get_string( fields, "nickname" ); if ( ( !str ) || ( strlen( str ) < 3 ) ) { - err = "The nick name you entered is invalid."; + err = _( "The nick name you entered is invalid." ); goto out; } g_strlcpy( profile->nickname, str, sizeof( profile->nickname ) ); @@ -248,37 +248,34 @@ /* birthdate */ str = purple_request_fields_get_string( fields, "bday" ); if ( ( !str ) || ( strlen( str ) < 10 ) || ( !validateDate( str ) ) ) { - err = "The birthday you entered is invalid. The correct format is: 'YYYY-MM-DD'."; + err = _( "The birthday you entered is invalid. The correct format is: 'YYYY-MM-DD'." ); goto out; } g_strlcpy( profile->birthday, str, sizeof( profile->birthday ) ); /* gender */ - if ( purple_request_fields_get_choice( fields, "male" ) == 0 ) - profile->male = FALSE; - else - profile->male = TRUE; + profile->male = ( purple_request_fields_get_choice( fields, "male" ) == 0 ); /* pin */ pin = purple_request_fields_get_string( fields, "pin" ); if ( !pin ) { - err = "The PIN you entered is invalid."; + err = _( "The PIN you entered is invalid." ); goto out; } len = strlen( pin ); if ( ( len < 7 ) || ( len > 10 ) ) { - err = "The PIN you entered has an invalid length [7-10]."; + err = _( "The PIN you entered has an invalid length [7-10]." ); goto out; } for ( i = 0; i < len; i++ ) { if ( !g_ascii_isdigit( pin[i] ) ) { - err = "The PIN is invalid. It should only consist of digits [0-9]."; + err = _( "The PIN is invalid. It should only consist of digits [0-9]." ); goto out; } } str = purple_request_fields_get_string( fields, "pin2" ); if ( ( !str ) || ( strcmp( pin, str ) != 0 ) ) { - err = "The two PINs you entered does not match."; + err = _( "The two PINs you entered do not match." ); goto out; } g_strlcpy( profile->pin, pin, sizeof( profile->pin ) ); diff -r 8a90bd0a3b79 -r 5f80ab7ac183 libpurple/protocols/mxit/markup.c --- a/libpurple/protocols/mxit/markup.c Sun Nov 22 18:56:06 2009 +0000 +++ b/libpurple/protocols/mxit/markup.c Sun Nov 22 19:21:20 2009 +0000 @@ -66,16 +66,16 @@ /* vibes */ static const char* vibes[] = { - /* 0 */ "Cool Vibrations", - /* 1 */ "Purple Rain", - /* 2 */ "Polite", - /* 3 */ "Rock n Roll", - /* 4 */ "Summer Slumber", - /* 5 */ "Electric Razor", - /* 6 */ "S.O.S", - /* 7 */ "Jack Hammer", - /* 8 */ "Bumble Bee", - /* 9 */ "Ripple" + /* 0 */ N_( "Cool Vibrations" ), + /* 1 */ N_( "Purple Rain" ), + /* 2 */ N_( "Polite" ), + /* 3 */ N_( "Rock n Roll" ), + /* 4 */ N_( "Summer Slumber" ), + /* 5 */ N_( "Electric Razor" ), + /* 6 */ N_( "S.O.S" ), + /* 7 */ N_( "Jack Hammer" ), + /* 8 */ N_( "Bumble Bee" ), + /* 9 */ N_( "Ripple" ) }; @@ -653,7 +653,7 @@ return 0; } - g_string_append_printf( mx->msg, "%s Vibe...", MXIT_VIBE_MSG_COLOR, vibes[vibeid] ); + g_string_append_printf( mx->msg, "%s Vibe...", MXIT_VIBE_MSG_COLOR, _( vibes[vibeid] ) ); return 2; } diff -r 8a90bd0a3b79 -r 5f80ab7ac183 libpurple/protocols/mxit/multimx.c --- a/libpurple/protocols/mxit/multimx.c Sun Nov 22 18:56:06 2009 +0000 +++ b/libpurple/protocols/mxit/multimx.c Sun Nov 22 19:21:20 2009 +0000 @@ -408,7 +408,7 @@ /* Configuration option: Room Name */ pce = g_new0(struct proto_chat_entry, 1); - pce->label = "_Room Name:"; + pce->label = _( "_Room Name:" ); pce->identifier = "room"; pce->required = TRUE; m = g_list_append(m, pce); diff -r 8a90bd0a3b79 -r 5f80ab7ac183 libpurple/protocols/mxit/mxit.c --- a/libpurple/protocols/mxit/mxit.c Sun Nov 22 18:56:06 2009 +0000 +++ b/libpurple/protocols/mxit/mxit.c Sun Nov 22 19:21:20 2009 +0000 @@ -63,7 +63,7 @@ PurpleConnection* con; gchar** parts = NULL; gchar* link = NULL; - unsigned int len; + gsize len; purple_debug_info( MXIT_PLUGIN_ID, "mxit_link_click (%s)\n", link64 ); @@ -170,6 +170,7 @@ struct contact* contact; PurpleBuddy* buddy; const char* who; + const char* tmp; gc = purple_conversation_get_gc( conv ); if ( session->con != gc ) { @@ -204,6 +205,8 @@ case MXIT_TYPE_CHATROOM : case MXIT_TYPE_GALLERY : case MXIT_TYPE_INFO : + /* TODO: Allow "Loading menu..." to be localized (but not the HTML markup) */ + tmp = _("Loading menu..."); serv_got_im( session->con, who, "Loading menu...\n", PURPLE_MESSAGE_NOTIFY, time( NULL ) ); mxit_send_message( session, who, " ", FALSE ); default : @@ -343,7 +346,7 @@ /* hidden number */ if ( contact->flags & MXIT_CFLAG_HIDDEN ) - purple_notify_user_info_add_pair( info, _( "Hidden Number" ), "Yes" ); + purple_notify_user_info_add_pair( info, _( "Hidden Number" ), _( "Yes" ) ); } diff -r 8a90bd0a3b79 -r 5f80ab7ac183 libpurple/protocols/mxit/protocol.c --- a/libpurple/protocols/mxit/protocol.c Sun Nov 22 18:56:06 2009 +0000 +++ b/libpurple/protocols/mxit/protocol.c Sun Nov 22 19:21:20 2009 +0000 @@ -1345,8 +1345,8 @@ name = purple_buddy_get_alias( buddy ); else name = records[0]->fields[0]->data; - g_snprintf( msg, sizeof( msg ), "%s sent you an encrypted message, but it is not supported on this client.", name ); - mxit_popup( PURPLE_NOTIFY_MSG_WARNING, _( "Message Error" ), _( msg ) ); + g_snprintf( msg, sizeof( msg ), _( "%s sent you an encrypted message, but it is not supported on this client." ), name ); + mxit_popup( PURPLE_NOTIFY_MSG_WARNING, _( "Message Error" ), msg ); return; } @@ -1938,7 +1938,7 @@ if ( packet->errmsg ) errdesc = packet->errmsg; else - errdesc = "An internal MXit server error occurred."; + errdesc = _( "An internal MXit server error occurred." ); purple_debug_info( MXIT_PLUGIN_ID, "Error Reply %i:%s\n", packet->errcode, errdesc ); @@ -1957,12 +1957,12 @@ return 0; } else { - sprintf( errmsg, "Login error: %s (%i)", errdesc, packet->errcode ); + sprintf( errmsg, _( "Login error: %s (%i)" ), errdesc, packet->errcode ); purple_connection_error( session->con, _( errmsg ) ); return -1; } case CP_CMD_LOGOUT : - sprintf( errmsg, "Logout error: %s (%i)", errdesc, packet->errcode ); + sprintf( errmsg, _( "Logout error: %s (%i)" ), errdesc, packet->errcode ); purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NAME_IN_USE, _( errmsg ) ); return -1; case CP_CMD_CONTACT : diff -r 8a90bd0a3b79 -r 5f80ab7ac183 libpurple/protocols/mxit/roster.c --- a/libpurple/protocols/mxit/roster.c Sun Nov 22 18:56:06 2009 +0000 +++ b/libpurple/protocols/mxit/roster.c Sun Nov 22 19:21:20 2009 +0000 @@ -53,11 +53,11 @@ const char* name; } const mxit_statuses[] = { /* primative, no, id, name */ - { PURPLE_STATUS_OFFLINE, MXIT_PRESENCE_OFFLINE, "offline", "Offline" }, /* 0 */ - { PURPLE_STATUS_AVAILABLE, MXIT_PRESENCE_ONLINE, "online", "Available" }, /* 1 */ - { PURPLE_STATUS_AWAY, MXIT_PRESENCE_AWAY, "away", "Away" }, /* 2 */ - { PURPLE_STATUS_AVAILABLE, MXIT_PRESENCE_AVAILABLE, "chat", "Chatty" }, /* 3 */ - { PURPLE_STATUS_UNAVAILABLE, MXIT_PRESENCE_DND, "dnd", "Do Not Disturb" } /* 4 */ + { PURPLE_STATUS_OFFLINE, MXIT_PRESENCE_OFFLINE, "offline", NULL }, /* 0 */ + { PURPLE_STATUS_AVAILABLE, MXIT_PRESENCE_ONLINE, "online", NULL }, /* 1 */ + { PURPLE_STATUS_AWAY, MXIT_PRESENCE_AWAY, "away", NULL }, /* 2 */ + { PURPLE_STATUS_AVAILABLE, MXIT_PRESENCE_AVAILABLE, "chat", N_( "Chatty" ) }, /* 3 */ + { PURPLE_STATUS_UNAVAILABLE, MXIT_PRESENCE_DND, "dnd", NULL } /* 4 */ }; @@ -77,7 +77,7 @@ const struct status* status = &mxit_statuses[i]; /* add mxit status (reference: "libpurple/status.h") */ - type = purple_status_type_new_with_attrs( status->primative, status->id, status->name, TRUE, TRUE, FALSE, + type = purple_status_type_new_with_attrs( status->primative, status->id, _( status->name ), TRUE, TRUE, FALSE, "message", _( "Message" ), purple_value_new( PURPLE_TYPE_STRING ), NULL );