From: Rudolf Polzer Date: Sun, 16 Jan 2011 18:30:28 +0000 (+0100) Subject: begin of gettextizing the source X-Git-Tag: xonotic-v0.5.0~318^2~106 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e994ef46bb5df2af3f016b8baaa95f7bd5357dd8;p=xonotic%2Fxonotic-data.pk3dir.git begin of gettextizing the source --- diff --git a/qcsrc/menu/draw.qc b/qcsrc/menu/draw.qc index a33cac916..12b56d8da 100644 --- a/qcsrc/menu/draw.qc +++ b/qcsrc/menu/draw.qc @@ -282,14 +282,14 @@ void draw_Text(vector theOrigin, string theText, vector theSize, vector theColor } void draw_CenterText(vector theOrigin, string theText, vector theSize, vector theColor, float theAlpha, float ICanHasKallerz) { - //print(strcat("orig = ", vtos(theOrigin) ," tx = ", ftos(draw_TextWidth(theText, ICanHasKallerz, theSize)), "\n")); + //dprint(strcat("orig = ", vtos(theOrigin) ," tx = ", ftos(draw_TextWidth(theText, ICanHasKallerz, theSize)), "\n")); draw_Text(theOrigin - eX * 0.5 * draw_TextWidth(theText, ICanHasKallerz, theSize), theText, theSize, theColor, theAlpha, ICanHasKallerz); } float draw_TextWidth(string theText, float ICanHasKallerz, vector SizeThxBye) { //return strlen(theText); - //print("draw_TextWidth \"", theText, "\"\n"); + //dprint("draw_TextWidth \"", theText, "\"\n"); vector v; v = '0 0 0'; //float r; diff --git a/qcsrc/menu/gamecommand.qc b/qcsrc/menu/gamecommand.qc index 439a1b5c9..761cd9dca 100644 --- a/qcsrc/menu/gamecommand.qc +++ b/qcsrc/menu/gamecommand.qc @@ -44,7 +44,7 @@ void Curl_URI_Get_Callback(float id, float status, string data) do_cvar = curl_uri_get_cvar[i]; if(status != 0) { - print("error: status is ", ftos(status), "\n"); + print(sprintf(_("error: status is %d\n"), status)); return; } if(do_exec) @@ -62,9 +62,9 @@ void GameCommand(string theCommand) if(argv(0) == "help" || argc == 0) { - print("Usage: menu_cmd theCommand..., where possible theCommands are:\n"); - print(" sync - reloads all cvars on the current menu page\n"); - print(" directmenu ITEM - select a menu item as main item\n"); + print(_("Usage: menu_cmd theCommand..., where possible theCommands are:\n")); + print(_(" sync - reloads all cvars on the current menu page\n")); + print(_(" directmenu ITEM - select a menu item as main item\n")); GameCommand_Generic("help"); return; } @@ -184,7 +184,7 @@ void GameCommand(string theCommand) curl_uri_get_pos = mod(curl_uri_get_pos + 1, URI_GET_CURL_END - URI_GET_CURL + 1); } else - print("error creating curl handle\n"); + print(_("error creating curl handle\n")); buf_del(buf); @@ -230,5 +230,5 @@ void GameCommand(string theCommand) } #endif - print("Invalid theCommand. For a list of supported theCommands, try menu_cmd help.\n"); + print(_("Invalid command. For a list of supported commands, try menu_cmd help.\n")); } diff --git a/qcsrc/menu/stringfilelist.txt b/qcsrc/menu/stringfilelist.txt new file mode 100644 index 000000000..0edf372a0 --- /dev/null +++ b/qcsrc/menu/stringfilelist.txt @@ -0,0 +1,99 @@ +Guideline: +- do NOT translate strings in error() messages, or in dprint()! +- change obvious developer prints from print to dprint (even in comments), + unless in developer-only functions (e.g. *dumptree*) +- mark translatable strings with _() +- if a translatable string is a strcat monster, change it to sprintf + +List of files to do: + +./item/borderimage.c +./item/button.c +./item.c +./item/checkbox.c +./item/container.c +./item/dialog.c +./item/gecko.c +./item/inputbox.c +./item/label.c +./item/listbox.c +./item/nexposee.c +./item/slider.c +./item/textslider.c +./mbuiltin.qh +./menu.qc +./menu.qh +./oo/base.h +./skin-customizables.inc +./skin.qh +./xonotic/button.c +./xonotic/campaign.c +./xonotic/charmap.c +./xonotic/colorbutton.c +./xonotic/colorpicker.c +./xonotic/colorpicker_string.c +./xonotic/commandbutton.c +./xonotic/credits.c +./xonotic/crosshairbutton.c +./xonotic/cvarlist.c +./xonotic/demolist.c +./xonotic/dialog.c +./xonotic/dialog_credits.c +./xonotic/dialog_hudpanel_ammo.c +./xonotic/dialog_hudpanel_chat.c +./xonotic/dialog_hudpanel_engineinfo.c +./xonotic/dialog_hudpanel_healtharmor.c +./xonotic/dialog_hudpanel_infomessages.c +./xonotic/dialog_hudpanel_modicons.c +./xonotic/dialog_hudpanel_notification.c +./xonotic/dialog_hudpanel_powerups.c +./xonotic/dialog_hudpanel_pressedkeys.c +./xonotic/dialog_hudpanel_racetimer.c +./xonotic/dialog_hudpanel_radar.c +./xonotic/dialog_hudpanel_score.c +./xonotic/dialog_hudpanel_timer.c +./xonotic/dialog_hudpanel_vote.c +./xonotic/dialog_hudpanel_weapons.c +./xonotic/dialog_hudsetup_exit.c +./xonotic/dialog_multiplayer.c +./xonotic/dialog_multiplayer_create_advanced.c +./xonotic/dialog_multiplayer_create.c +./xonotic/dialog_multiplayer_create_mapinfo.c +./xonotic/dialog_multiplayer_create_mutators.c +./xonotic/dialog_multiplayer_demo.c +./xonotic/dialog_multiplayer_join.c +./xonotic/dialog_multiplayer_join_serverinfo.c +./xonotic/dialog_multiplayer_playersetup.c +./xonotic/dialog_multiplayer_playersetup_waypoint.c +./xonotic/dialog_multiplayer_playersetup_weapons.c +./xonotic/dialog_news.c +./xonotic/dialog_quit.c +./xonotic/dialog_settings_audio.c +./xonotic/dialog_settings.c +./xonotic/dialog_settings_effects.c +./xonotic/dialog_settings_input.c +./xonotic/dialog_settings_input_userbind.c +./xonotic/dialog_settings_misc.c +./xonotic/dialog_settings_misc_cvars.c +./xonotic/dialog_settings_network.c +./xonotic/dialog_settings_video.c +./xonotic/dialog_singleplayer.c +./xonotic/dialog_singleplayer_winner.c +./xonotic/dialog_teamselect.c +./xonotic/inputbox.c +./xonotic/keybinder.c +./xonotic/mainwindow.c +./xonotic/maplist.c +./xonotic/playerlist.c +./xonotic/playermodel.c +./xonotic/radiobutton.c +./xonotic/rootdialog.c +./xonotic/serverlist.c +./xonotic/skinlist.c +./xonotic/slider_decibels.c +./xonotic/slider_picmip.c +./xonotic/slider_resolution.c +./xonotic/tabcontroller.c +./xonotic/textslider.c +./xonotic/util.qc +./xonotic/weaponslist.c