[Super-tux-commit] supertux/src gameloop.cpp,1.144,1.145 menu.cpp,1.77,1.78 setup.cpp,1.94,1.95 titl
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-06-03 17:41:31
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25398/src Modified Files: gameloop.cpp menu.cpp setup.cpp title.cpp worldmap.cpp Log Message: Added more strings to be translated. In some places for doing the aligment spaces were used. I fixed a couple of places, but there are more there. This is a good time to remove this hacks. We have to define some policy about what should be translatable. IMO, error messages should not be translated. Only if they are telling the user what should he do. Warnings maybe should be translated. Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.77 retrieving revision 1.78 diff -u -d -r1.77 -r1.78 --- menu.cpp 2 Jun 2004 23:33:35 -0000 1.77 +++ menu.cpp 3 Jun 2004 17:41:22 -0000 1.78 @@ -40,6 +40,7 @@ #include "leveleditor.h" #include "timer.h" #include "high_scores.h" +#include "gettext.h" #define FLICK_CURSOR_TIME 500 @@ -72,8 +73,8 @@ Menu* dialog = new Menu; dialog->additem(MN_DEACTIVE, text,0,0); dialog->additem(MN_HL,"",0,0); - dialog->additem(MN_ACTION,"Yes",0,0,true); - dialog->additem(MN_ACTION,"No",0,0,false); + dialog->additem(MN_ACTION,_("Yes"),0,0,true); + dialog->additem(MN_ACTION,_("No"),0,0,false); dialog->additem(MN_HL,"",0,0); Menu::set_current(dialog); @@ -252,40 +253,40 @@ switch(*item->int_p) { case SDLK_UP: - item->change_input("Up cursor"); + item->change_input(_("Up cursor")); break; case SDLK_DOWN: - item->change_input("Down cursor"); + item->change_input(_("Down cursor")); break; case SDLK_LEFT: - item->change_input("Left cursor"); + item->change_input(_("Left cursor")); break; case SDLK_RIGHT: - item->change_input("Right cursor"); + item->change_input(_("Right cursor")); break; case SDLK_RETURN: - item->change_input("Return"); + item->change_input(_("Return")); break; case SDLK_SPACE: - item->change_input("Space"); + item->change_input(_("Space")); break; case SDLK_RSHIFT: - item->change_input("Right Shift"); + item->change_input(_("Right Shift")); break; case SDLK_LSHIFT: - item->change_input("Left Shift"); + item->change_input(_("Left Shift")); break; case SDLK_RCTRL: - item->change_input("Right Control"); + item->change_input(_("Right Control")); break; case SDLK_LCTRL: - item->change_input("Left Control"); + item->change_input(_("Left Control")); break; case SDLK_RALT: - item->change_input("Right Alt"); + item->change_input(_("Right Alt")); break; case SDLK_LALT: - item->change_input("Left Alt"); + item->change_input(_("Left Alt")); break; default: { Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- title.cpp 3 Jun 2004 11:26:12 -0000 1.94 +++ title.cpp 3 Jun 2004 17:41:22 -0000 1.95 @@ -52,6 +52,7 @@ #include "sector.h" #include "tilemap.h" #include "resources.h" +#include "gettext.h" static Surface* bkg_title; static Surface* logo; @@ -87,7 +88,7 @@ free_contrib_menu(); - contrib_menu->additem(MN_LABEL,"Contrib Levels",0,0); + contrib_menu->additem(MN_LABEL,_("Contrib Levels"),0,0); contrib_menu->additem(MN_HL,"",0,0); for (int i = 0; i < level_subsets.num_items; ++i) @@ -100,7 +101,7 @@ } contrib_menu->additem(MN_HL,"",0,0); - contrib_menu->additem(MN_BACK,"Back",0,0); + contrib_menu->additem(MN_BACK,_("Back"),0,0); string_list_free(&level_subsets); } @@ -137,7 +138,7 @@ } contrib_subset_menu->additem(MN_HL,"",0,0); - contrib_subset_menu->additem(MN_BACK, "Back", 0, 0); + contrib_subset_menu->additem(MN_BACK, _("Back"), 0, 0); titlesession->get_current_sector()->activate(); titlesession->set_current(); @@ -272,11 +273,11 @@ LAYER_FOREGROUND1+1); context.draw_text(white_small_text, - " SuperTux " VERSION "\n" + _(" SuperTux " VERSION "\n" "Copyright (c) 2003 SuperTux Devel Team\n" "This game comes with ABSOLUTELY NO WARRANTY. This is free software, and you\n" "are welcome to redistribute it under certain conditions; see the file COPYING\n" - "for details.\n", Vector(0, screen->h - 70), LAYER_FOREGROUND1); + "for details.\n"), Vector(0, screen->h - 70), LAYER_FOREGROUND1); /* Don't draw menu, if quit is true */ Menu* menu = Menu::current(); @@ -323,7 +324,7 @@ { int slot = menu->get_active_item_id(); char str[1024]; - sprintf(str,"Are you sure you want to delete slot %d?", slot); + sprintf(str,_("Are you sure you want to delete slot %d?"), slot); if(confirm_dialog(bkg_title, str)) { Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.81 retrieving revision 1.82 diff -u -d -r1.81 -r1.82 --- worldmap.cpp 2 Jun 2004 20:06:56 -0000 1.81 +++ worldmap.cpp 3 Jun 2004 17:41:22 -0000 1.82 @@ -33,6 +33,7 @@ #include "worldmap.h" #include "sound_manager.h" #include "resources.h" +#include "gettext.h" namespace WorldMapNS { @@ -720,14 +721,14 @@ context.draw_gradient(Color (0, 255, 0), Color (255, 0, 255), LAYER_BACKGROUND0); - context.draw_text_center(blue_text, "GAMEOVER", + context.draw_text_center(blue_text, _("GAMEOVER"), Vector(0, 200), LAYER_FOREGROUND1); - sprintf(str, "SCORE: %d", player_status.score); + sprintf(str, _("SCORE: %d"), player_status.score); context.draw_text_center(gold_text, str, Vector(0, 224), LAYER_FOREGROUND1); - sprintf(str, "COINS: %d", player_status.distros); + sprintf(str, _("COINS: %d"), player_status.distros); context.draw_text_center(gold_text, str, Vector(0, screen->w - 32), LAYER_FOREGROUND1); @@ -846,17 +847,17 @@ char str[80]; sprintf(str, "%d", player_status.score); - context.draw_text(white_text, "SCORE", Vector(0, 0), LAYER_FOREGROUND1); + context.draw_text(white_text, _("SCORE"), Vector(0, 0), LAYER_FOREGROUND1); context.draw_text(gold_text, str, Vector(96, 0), LAYER_FOREGROUND1); sprintf(str, "%d", player_status.distros); - context.draw_text(white_text, "COINS", Vector(screen->w/2 - 16*5, 0), + context.draw_text(white_text, _("COINS"), Vector(screen->w/2 - 16*5, 0), LAYER_FOREGROUND1); context.draw_text(gold_text, str, Vector(screen->w/2 + (16*5)/2, 0), LAYER_FOREGROUND1); - context.draw_text(white_text, "LIVES", - Vector(screen->w - white_text->get_text_width("LIVES")*2, 0), + context.draw_text(white_text, _("LIVES"), + Vector(screen->w - white_text->get_text_width(_("LIVES"))*2, 0), LAYER_FOREGROUND1); if (player_status.lives >= 5) { Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.144 retrieving revision 1.145 diff -u -d -r1.144 -r1.145 --- gameloop.cpp 2 Jun 2004 20:06:55 -0000 1.144 +++ gameloop.cpp 3 Jun 2004 17:41:22 -0000 1.145 @@ -55,6 +55,7 @@ #include "resources.h" #include "background.h" #include "tilemap.h" +#include "gettext.h" GameSession* GameSession::current_ = 0; @@ -159,7 +160,7 @@ LAYER_FOREGROUND1); context.draw_text_center(white_small_text, - std::string("by ") + level->get_author(), + std::string(_("by ")) + level->get_author(), Vector(0, 400), LAYER_FOREGROUND1); context.do_drawing(); @@ -519,7 +520,7 @@ context->draw_filled_rect( Vector(0,0), Vector(screen->w, screen->h), Color(rand() % 50, rand() % 50, rand() % 50, 128), LAYER_FOREGROUND1); - context->draw_text_center(blue_text, "PAUSE - Press 'P' To Play", + context->draw_text_center(blue_text, _("PAUSE - Press 'P' To Play"), Vector(0, 230), LAYER_FOREGROUND1+2); } @@ -698,35 +699,35 @@ char str[60]; snprintf(str, 60, "%d", player_status.score); - context.draw_text(white_text, "SCORE", Vector(0, 0), LAYER_FOREGROUND1); + context.draw_text(white_text, _("SCORE"), Vector(0, 0), LAYER_FOREGROUND1); context.draw_text(gold_text, str, Vector(96, 0), LAYER_FOREGROUND1); if(st_gl_mode == ST_GL_TEST) { - context.draw_text(white_text, "Press ESC To Return", Vector(0,20), + context.draw_text(white_text, _("Press ESC To Return"), Vector(0,20), LAYER_FOREGROUND1); } if(!time_left.check()) { - context.draw_text_center(white_text, "TIME's UP", Vector(0, 0), + context.draw_text_center(white_text, _("TIME's UP"), Vector(0, 0), LAYER_FOREGROUND1); } else if (time_left.get_left() > TIME_WARNING || (global_frame_counter % 10) < 5) { sprintf(str, "%d", time_left.get_left() / 1000 ); - context.draw_text_center(white_text, "TIME", + context.draw_text_center(white_text, _("TIME"), Vector(0, 0), LAYER_FOREGROUND1); context.draw_text_center(gold_text, str, Vector(4*16, 0), LAYER_FOREGROUND1); } sprintf(str, "%d", player_status.distros); - context.draw_text(white_text, "COINS", - Vector(screen->w - white_text->get_text_width("COINS "), 0), + context.draw_text(white_text, _("COINS"), + Vector(screen->w - white_text->get_text_width(_("COINS"))+white_text->get_text_width(str), 0), LAYER_FOREGROUND1); context.draw_text(gold_text, str, Vector(screen->w - gold_text->get_text_width("99"), 0),LAYER_FOREGROUND1); - context.draw_text(white_text, "LIVES", - Vector(screen->w - white_text->get_text_width("LIVES "), 20), + context.draw_text(white_text, _("LIVES"), + Vector(screen->w - white_text->get_text_width(_("LIVES"))+white_text->get_text_width(str), 20), LAYER_FOREGROUND1); if (player_status.lives >= 5) { @@ -763,13 +764,13 @@ DrawingContext context; currentsector->background->draw(context); - context.draw_text_center(blue_text, "Result:", Vector(0, 200), + context.draw_text_center(blue_text, _("Result:"), Vector(0, 200), LAYER_FOREGROUND1); - sprintf(str, "SCORE: %d", player_status.score); + sprintf(str, _("SCORE: %d"), player_status.score); context.draw_text_center(gold_text, str, Vector(0, 224), LAYER_FOREGROUND1); - sprintf(str, "COINS: %d", player_status.distros); + sprintf(str, _("COINS: %d"), player_status.distros); context.draw_text_center(gold_text, str, Vector(0, 256), LAYER_FOREGROUND1); context.do_drawing(); @@ -798,10 +799,10 @@ if (!title.empty()) snprintf(tmp,1024,"Slot %d - %s",slot, title.c_str()); else - snprintf(tmp, 1024,"Slot %d - Savegame",slot); + snprintf(tmp, 1024,_("Slot %d - Savegame"),slot); } else - sprintf(tmp,"Slot %d - Free",slot); + sprintf(tmp,_("Slot %d - Free"),slot); return tmp; } Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- setup.cpp 2 Jun 2004 23:00:26 -0000 1.94 +++ setup.cpp 3 Jun 2004 17:41:22 -0000 1.95 @@ -392,60 +392,60 @@ main_menu->additem(MN_ACTION, _("Credits"),0,0, MNID_CREDITS); main_menu->additem(MN_ACTION, _("Quit"),0,0, MNID_QUITMAINMENU); - options_menu->additem(MN_LABEL,"Options",0,0); + options_menu->additem(MN_LABEL,_("Options"),0,0); options_menu->additem(MN_HL,"",0,0); #ifndef NOOPENGL options_menu->additem(MN_TOGGLE,"OpenGL",use_gl,0, MNID_OPENGL); #else - options_menu->additem(MN_DEACTIVE,"OpenGL (not supported)",use_gl, 0, MNID_OPENGL); + options_menu->additem(MN_DEACTIVE,_("OpenGL (not supported)"),use_gl, 0, MNID_OPENGL); #endif - options_menu->additem(MN_TOGGLE,"Fullscreen",use_fullscreen,0, MNID_FULLSCREEN); + options_menu->additem(MN_TOGGLE,_("Fullscreen"),use_fullscreen,0, MNID_FULLSCREEN); if(audio_device) { - options_menu->additem(MN_TOGGLE,"Sound ", use_sound,0, MNID_SOUND); - options_menu->additem(MN_TOGGLE,"Music ", use_music,0, MNID_MUSIC); + options_menu->additem(MN_TOGGLE,_("Sound "), use_sound,0, MNID_SOUND); + options_menu->additem(MN_TOGGLE,_("Music "), use_music,0, MNID_MUSIC); } else { - options_menu->additem(MN_DEACTIVE,"Sound ", false,0, MNID_SOUND); - options_menu->additem(MN_DEACTIVE,"Music ", false,0, MNID_MUSIC); + options_menu->additem(MN_DEACTIVE,_("Sound "), false,0, MNID_SOUND); + options_menu->additem(MN_DEACTIVE,_("Music "), false,0, MNID_MUSIC); } - options_menu->additem(MN_TOGGLE,"Show FPS ",show_fps,0, MNID_SHOWFPS); - options_menu->additem(MN_GOTO,"Keyboard Setup",0,options_keys_menu); + options_menu->additem(MN_TOGGLE,_("Show FPS "),show_fps,0, MNID_SHOWFPS); + options_menu->additem(MN_GOTO,_("Keyboard Setup"),0,options_keys_menu); if(use_joystick) - options_menu->additem(MN_GOTO,"Joystick Setup",0,options_joystick_menu); + options_menu->additem(MN_GOTO,_("Joystick Setup"),0,options_joystick_menu); options_menu->additem(MN_HL,"",0,0); - options_menu->additem(MN_BACK,"Back",0,0); + options_menu->additem(MN_BACK,_("Back"),0,0); - options_keys_menu->additem(MN_LABEL,"Key Setup",0,0); + options_keys_menu->additem(MN_LABEL,_("Key Setup"),0,0); options_keys_menu->additem(MN_HL,"",0,0); - options_keys_menu->additem(MN_CONTROLFIELD_KB,"Left move", 0,0, 0,&keymap.left); - options_keys_menu->additem(MN_CONTROLFIELD_KB,"Right move", 0,0, 0,&keymap.right); - options_keys_menu->additem(MN_CONTROLFIELD_KB,"Jump", 0,0, 0,&keymap.jump); - options_keys_menu->additem(MN_CONTROLFIELD_KB,"Duck", 0,0, 0,&keymap.duck); - options_keys_menu->additem(MN_CONTROLFIELD_KB,"Activate", 0, 0, 0, + options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Left move"), 0,0, 0,&keymap.left); + options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Right move"), 0,0, 0,&keymap.right); + options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Jump"), 0,0, 0,&keymap.jump); + options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Duck"), 0,0, 0,&keymap.duck); + options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Activate"), 0, 0, 0, &keymap.activate); - options_keys_menu->additem(MN_CONTROLFIELD_KB,"Power/Run", 0,0, 0,&keymap.fire); + options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Power/Run"), 0,0, 0,&keymap.fire); options_keys_menu->additem(MN_HL,"",0,0); - options_keys_menu->additem(MN_BACK,"Back",0,0); + options_keys_menu->additem(MN_BACK,_("Back"),0,0); if(use_joystick) { - options_joystick_menu->additem(MN_LABEL,"Joystick Setup",0,0); + options_joystick_menu->additem(MN_LABEL,_("Joystick Setup"),0,0); options_joystick_menu->additem(MN_HL,"",0,0); //options_joystick_menu->additem(MN_CONTROLFIELD_JS,"X axis", 0,0, 0,&joystick_keymap.x_axis); //options_joystick_menu->additem(MN_CONTROLFIELD_JS,"Y axis", 0,0, 0,&joystick_keymap.y_axis); - options_joystick_menu->additem(MN_CONTROLFIELD_JS,"A button", 0,0, 0,&joystick_keymap.a_button); - options_joystick_menu->additem(MN_CONTROLFIELD_JS,"B button", 0,0, 0,&joystick_keymap.b_button); + options_joystick_menu->additem(MN_CONTROLFIELD_JS,_("A button"), 0,0, 0,&joystick_keymap.a_button); + options_joystick_menu->additem(MN_CONTROLFIELD_JS,_("B button"), 0,0, 0,&joystick_keymap.b_button); //options_joystick_menu->additem(MN_CONTROLFIELD_JS,"Start", 0,0, 0,&joystick_keymap.start_button); //options_joystick_menu->additem(MN_CONTROLFIELD_JS,"DeadZone", 0,0, 0,&joystick_keymap.dead_zone); options_joystick_menu->additem(MN_HL,"",0,0); - options_joystick_menu->additem(MN_BACK,"Back",0,0); + options_joystick_menu->additem(MN_BACK,_("Back"),0,0); } - load_game_menu->additem(MN_LABEL,"Start Game",0,0); + load_game_menu->additem(MN_LABEL,_("Start Game"),0,0); load_game_menu->additem(MN_HL,"",0,0); load_game_menu->additem(MN_DEACTIVE,"Slot 1",0,0, 1); load_game_menu->additem(MN_DEACTIVE,"Slot 2",0,0, 2); @@ -453,9 +453,9 @@ load_game_menu->additem(MN_DEACTIVE,"Slot 4",0,0, 4); load_game_menu->additem(MN_DEACTIVE,"Slot 5",0,0, 5); load_game_menu->additem(MN_HL,"",0,0); - load_game_menu->additem(MN_BACK,"Back",0,0); + load_game_menu->additem(MN_BACK,_("Back"),0,0); - save_game_menu->additem(MN_LABEL,"Save Game",0,0); + save_game_menu->additem(MN_LABEL,_("Save Game"),0,0); save_game_menu->additem(MN_HL,"",0,0); save_game_menu->additem(MN_DEACTIVE,"Slot 1",0,0, 1); save_game_menu->additem(MN_DEACTIVE,"Slot 2",0,0, 2); @@ -465,21 +465,21 @@ save_game_menu->additem(MN_HL,"",0,0); save_game_menu->additem(MN_BACK,"Back",0,0); - game_menu->additem(MN_LABEL,"Pause",0,0); + game_menu->additem(MN_LABEL,_("Pause"),0,0); game_menu->additem(MN_HL,"",0,0); - game_menu->additem(MN_ACTION,"Continue",0,0,MNID_CONTINUE); - game_menu->additem(MN_GOTO,"Options",0,options_menu); + game_menu->additem(MN_ACTION,_("Continue"),0,0,MNID_CONTINUE); + game_menu->additem(MN_GOTO,_("Options"),0,options_menu); game_menu->additem(MN_HL,"",0,0); - game_menu->additem(MN_ACTION,"Abort Level",0,0,MNID_ABORTLEVEL); + game_menu->additem(MN_ACTION,_("Abort Level"),0,0,MNID_ABORTLEVEL); - worldmap_menu->additem(MN_LABEL,"Pause",0,0); + worldmap_menu->additem(MN_LABEL,_("Pause"),0,0); worldmap_menu->additem(MN_HL,"",0,0); - worldmap_menu->additem(MN_ACTION,"Continue",0,0,MNID_RETURNWORLDMAP); - worldmap_menu->additem(MN_GOTO,"Options",0,options_menu); + worldmap_menu->additem(MN_ACTION,_("Continue"),0,0,MNID_RETURNWORLDMAP); + worldmap_menu->additem(MN_GOTO,_("Options"),0,options_menu); worldmap_menu->additem(MN_HL,"",0,0); - worldmap_menu->additem(MN_ACTION,"Quit Game",0,0,MNID_QUITWORLDMAP); + worldmap_menu->additem(MN_ACTION,_("Quit Game"),0,0,MNID_QUITWORLDMAP); - highscore_menu->additem(MN_TEXTFIELD,"Enter your name:",0,0); + highscore_menu->additem(MN_TEXTFIELD,_("Enter your name:"),0,0); } void update_load_save_game_menu(Menu* pmenu) |