]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
start of CSQC i18n-izing
authorRudolf Polzer <divverent@alientrap.org>
Tue, 18 Jan 2011 20:24:47 +0000 (21:24 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 18 Jan 2011 20:24:47 +0000 (21:24 +0100)
qcsrc/client/Main.qc
qcsrc/client/ctf.qc
qcsrc/client/damage.qc
qcsrc/client/effects.qc
qcsrc/client/hook.qc
qcsrc/client/mapvoting.qc
qcsrc/i18n-guide.txt

index 044569fb5c373b49011389d5daf6adf141791f40..75e7320c9e8d3eb90f0ff66388cda0685092cc69 100644 (file)
@@ -27,7 +27,7 @@ void cvar_clientsettemp_restore()
 
 void() menu_show_error =
 {
-       drawstring('0 200 0', "ERROR - MENU IS VISIBLE BUT NO MENU WAS DEFINED!", '8 8 0', '1 0 0', 1, 0);
+       drawstring('0 200 0', _("ERROR - MENU IS VISIBLE BUT NO MENU WAS DEFINED!"), '8 8 0', '1 0 0', 1, 0);
 };
 
 // CSQC_Init : Called every time the CSQC code is initialized (essentially at map load)
@@ -51,7 +51,7 @@ void CSQC_Init(void)
        __engine_check = checkextension("DP_SV_WRITEPICTURE");
        if(!__engine_check)
        {
-               print("^3Your engine build is outdated\n^3This Server uses a newer QC VM. Please update!\n");
+               print(_("^3Your engine build is outdated\n^3This Server uses a newer QC VM. Please update!\n"));
                localcmd("\ndisconnect\n");
                return;
        }
@@ -61,7 +61,7 @@ void CSQC_Init(void)
        check_unacceptable_compiler_bugs();
 
 #ifdef WATERMARK
-       print("^4CSQC Build information: ", WATERMARK(), "\n");
+       print(sprintf(_("^4CSQC Build information: %s\n"), WATERMARK()));
 #endif
 
        float i;
@@ -222,7 +222,7 @@ float SetTeam(entity o, float Team)
                        default:
                                if(GetTeam(Team, false) == NULL)
                                {
-                                       print("trying to switch to unsupported team ", ftos(Team), "\n");
+                                       print(sprintf(_("trying to switch to unsupported team %d\n"), Team));
                                        Team = COLOR_SPECTATOR;
                                }
                                break;
@@ -238,7 +238,7 @@ float SetTeam(entity o, float Team)
                        default:
                                if(GetTeam(Team, false) == NULL)
                                {
-                                       print("trying to switch to unsupported team ", ftos(Team), "\n");
+                                       print(sprintf(_("trying to switch to unsupported team %d\n"), Team));
                                        Team = COLOR_SPECTATOR;
                                }
                                break;
@@ -248,7 +248,6 @@ float SetTeam(entity o, float Team)
        {
                if(o.has_team)
                {
-                       //print("(DISCONNECT) leave team ", ftos(o.team), "\n");
                        tm = GetTeam(o.team, false);
                        tm.team_size -= 1;
                        o.has_team = 0;
@@ -259,7 +258,6 @@ float SetTeam(entity o, float Team)
        {
                if not(o.has_team)
                {
-                       //print("(CONNECT) enter team ", ftos(o.team), "\n");
                        o.team = Team;
                        tm = GetTeam(Team, true);
                        tm.team_size += 1;
@@ -268,11 +266,9 @@ float SetTeam(entity o, float Team)
                }
                else if(Team != o.team)
                {
-                       //print("(CHANGE) leave team ", ftos(o.team), "\n");
                        tm = GetTeam(o.team, false);
                        tm.team_size -= 1;
                        o.team = Team;
-                       //print("(CHANGE) enter team ", ftos(o.team), "\n");
                        tm = GetTeam(Team, true);
                        tm.team_size += 1;
                        return TRUE;
@@ -292,7 +288,6 @@ void Playerchecker_Think()
                {
                        if(e.sort_prev)
                        {
-                               //print("playerchecker: KILL KILL KILL\n");
                                // player disconnected
                                SetTeam(e, -1);
                                RemovePlayer(e);
@@ -304,7 +299,6 @@ void Playerchecker_Think()
                {
                        if not(e.sort_prev)
                        {
-                               //print("playerchecker: SPAWN SPAWN SPAWN\n");
                                // player connected
                                if not(e)
                                        playerslots[i] = e = spawn();
@@ -326,7 +320,6 @@ void Porto_Init();
 void TrueAim_Init();
 void PostInit(void)
 {
-       print(strcat("PostInit\n    maxclients = ", ftos(maxclients), "\n"));
        localcmd(strcat("\nscoreboard_columns_set ", autocvar_scoreboard_columns, ";\n"));
 
        entity playerchecker;
@@ -361,8 +354,8 @@ float CSQC_ConsoleCommand(string strMessage)
                return true;
        } else if(strCmd == "hud_save") { // save hud config
                if(argv(1) == "" || argv(2)) {
-                       print("Usage:\n");
-                       print("hud_save configname   (saves to hud_skinname_configname.cfg)\n");
+                       print(_("Usage:\n"));
+                       print(_("hud_save configname   (saves to hud_skinname_configname.cfg)\n"));
                }
                else
                        HUD_Panel_ExportCfg(argv(1));
@@ -509,10 +502,10 @@ void GameCommand(string msg)
 
        if(argv(0) == "help" || argc == 0)
        {
-               print("Usage: cl_cmd COMMAND..., where possible commands are:\n");
-               print("  settemp cvar value\n");
-               print("  scoreboard_columns_set ...\n");
-               print("  scoreboard_columns_help\n");
+               print(_("Usage: cl_cmd COMMAND..., where possible commands are:\n"));
+               print(_("  settemp cvar value\n"));
+               print(_("  scoreboard_columns_set ...\n"));
+               print(_("  scoreboard_columns_help\n"));
                GameCommand_Generic("help");
                return;
        }
@@ -717,7 +710,7 @@ void Ent_ReadPlayerScore()
 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
        if(!isNew && n != self.sv_entnum)
        {
-               print("A CSQC entity changed its owner!\n");
+               print(_("A CSQC entity changed its owner!\n"));
                isNew = true;
                Ent_Remove();
                self.enttype = ENT_CLIENT_SCORES;
@@ -931,7 +924,7 @@ void(float bIsNewEntity) CSQC_Ent_Update =
        if(self.enttype)
                if(t != self.enttype)
                {
-                       print("A CSQC entity changed its type!\n");
+                       print(_("A CSQC entity changed its type!\n"));
                        Ent_Remove();
                        bIsNewEntity = 1;
                }
@@ -968,7 +961,7 @@ void(float bIsNewEntity) CSQC_Ent_Update =
                case ENT_CLIENT_GAUNTLET: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_GAUNTLET); break;
                case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break;
                default:
-                       error(strcat("unknown entity type in CSQC_Ent_Update: ", ftos(self.enttype), "\n"));
+                       error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype));
                        break;
        }
 
@@ -1440,12 +1433,12 @@ string getcommandkey(string text, string command)
 
        if ("" == keys) {
                if (hud_showbinds > 1)
-                       return strcat(text, " (not bound)");
+                       return sprintf(_("%s (not bound)"), text);
                else
                        return text;
        }
        else if (hud_showbinds > 1)
-               return strcat(text, " (", keys, ")");
+               return sprintf(_("%s (%s)"), text, keys);
        else
                return keys;
 }
index 651a8e62bc8686cb862b1bbd9f821178a26381fc..0bd585f439a45aee43fc77280bc793098995fdaa 100644 (file)
@@ -32,10 +32,10 @@ void() order_menu_render =
        color = getplayerkey(player_localentnum-1, "topcolor");
        
        if(getstati(STAT_CTF_STATE) == CTF_STATE_COMMANDER) {
-               drawstring(ps, "\x1D\x1E\x1E\x1E\x1E Order Menu \x1E\x1E\x1E\x1E\x1F", '8 8 0', '1 1 0', 1, 0); ps += po;
-               drawstring(ps, strcat("Order: ", ctf_temp_1), '8 8 0', '1 1 0', 1, 0); ps += po;
-               drawcolorcodedstring(ps, "1) ^3previous page", '8 8 0', 1, 0); ps += po;
-               drawcolorcodedstring(ps, "2) ^3next page", '8 8 0', 1, 0); ps += po;
+               drawstring(ps, _("----- Order Menu -----"), '8 8 0', '1 1 0', 1, 0); ps += po;
+               drawstring(ps, sprintf(_("Order: %s"), ctf_temp_1), '8 8 0', '1 1 0', 1, 0); ps += po;
+               drawcolorcodedstring(ps, _("1) ^3previous page"), '8 8 0', 1, 0); ps += po;
+               drawcolorcodedstring(ps, _("2) ^3next page"), '8 8 0', 1, 0); ps += po;
                for((n = 2), (p = i = 0); i < maxclients && n > 0; ++i) {
                        frags = getplayerkey(i, "frags");
                        if(!frags || (i+1) == player_localentnum)
@@ -52,7 +52,7 @@ void() order_menu_render =
                                drawcolorcodedstring(ps, strcat(ftos(n), ") ", GetPlayerName(i), " : ", ftos(getstatf(STAT_CTF_STATE))), '8 8 0', 1, 0); ps += po;
                        }
                }
-               drawstring(ps, "ESC) Exit Menu", '8 8 0', '1 1 0', 1, 0); ps += po;
+               drawstring(ps, _("ESC) Exit Menu"), '8 8 0', '1 1 0', 1, 0); ps += po;
        } else {
                menu_close();
        }
@@ -119,18 +119,18 @@ float(float bInputType, float nPrimary, float nSecondary) order_menu_action =
                        }
                }
                if(n == 0) {
-                       //print(strcat("Issuing order to: ", ftos(i+1), "\n"));
+                       //print(sprintf(_("Issuing order to: %d\n"), i+1));
                        //print(strcat("cmd order #", ftos(i+1), " ", ctf_temp_1, ";\n"));
                        localcmd(strcat("\ncmd order #", ftos(i+1), " ", ctf_temp_1, ";"));
                } else {
-                       print(strcat("Couldn't find player ", ftos(chose), "\n"));
+                       print(sprintf(_("Couldn't find player %d\n"), chose));
                }
                return TRUE;
        } else if(nSecondary == K_ESCAPE) {
                strunzone(ctf_temp_1);
                menu_close();
        } else {
-               //print(strcat("Menu action ", arg, " does not exist.\n"));
+               //print(sprintf(_("Menu action %s does not exist.\n"), arg));
                return FALSE;
        }
        return TRUE;
@@ -151,14 +151,14 @@ void() ctf_menu_render =
        po = '0 8 0';
        
        if(getstati(STAT_CTF_STATE) == CTF_STATE_COMMANDER) {
-               drawstring(ps, "\x1D\x1E\x1E\x1E\x1E Command Menu \x1E\x1E\x1E\x1E\x1F", '8 8 0', '1 1 0', 1, 0); ps += po;
-               drawstring(ps, "Issue orders:", '8 8 0', '1 1 0', 1, 0); ps += po;
-               drawstring(ps, " 1) Attack ", '8 8 0', '1 1 0', 1, 0);
-               drawstring(ps + '80 0 0', " \x0F", '8 8 0', '1 1 1', 1, 0); ps += po;
-               drawstring(ps, " 2) Defend \x0E", '8 8 0', '1 1 0', 1, 0); ps += po;
+               drawstring(ps, _("----- Command Menu -----"), '8 8 0', '1 1 0', 1, 0); ps += po;
+               drawstring(ps, _("Issue orders:"), '8 8 0', '1 1 0', 1, 0); ps += po;
+               drawstring(ps, _(" 1) Attack "), '8 8 0', '1 1 0', 1, 0);
+               drawstring(ps + '80 0 0', _(" \x0F"), '8 8 0', '1 1 1', 1, 0); ps += po;
+               drawstring(ps, _(" 2) Defend \x0E"), '8 8 0', '1 1 0', 1, 0); ps += po;
                ps += po;
-               drawstring(ps, "3) Resign from command.", '8 8 0', '1 1 0', 1, 0); ps += po;
-               drawstring(ps, "ESC) Exit Menu", '8 8 0', '1 1 0', 1, 0); ps += po;
+               drawstring(ps, _("3) Resign from command."), '8 8 0', '1 1 0', 1, 0); ps += po;
+               drawstring(ps, _("ESC) Exit Menu"), '8 8 0', '1 1 0', 1, 0); ps += po;
        } else {
                menu_close();
        }
@@ -209,10 +209,10 @@ void() ctf_view =
        } else if(stat == CTF_STATE_DEFEND) {
                drawpic('0 0 0', "gfx/ctf_ic_def.tga", '64 64 0', '1 1 1', 1, 0);
        } else if(stat == CTF_STATE_COMMANDER) {
-               drawstring('0 0 0', "You're commander!", '8 8 0', '1 1 1', 1, 0);
+               drawstring('0 0 0', _("You're commander!"), '8 8 0', '1 1 1', 1, 0);
        } else if(stat < 0) {
        } else {
-               drawstring('0 0 0', "Awaiting orders...", '8 8 0', '1 1 1', 0.5, 0);
+               drawstring('0 0 0', _("Awaiting orders..."), '8 8 0', '1 1 1', 0.5, 0);
        }
 };
 
index 24c5f0153b35609fc3b455b3bc10013c53c8ac56..13c8e462e3d5d800cdafe161cca952e81bb246d2 100644 (file)
@@ -54,15 +54,11 @@ void Ent_DamageInfo(float isNew)
                        thisforce = forcemul * force;
                }
 
-               //print("check ", ftos(num_for_edict(self)), " ", self.classname, "\n");
-               //print(ftos(self.damageforcescale), "\n");
-               //print(vtos(thisforce), "\n");
                if(self.damageforcescale)
                        if(vlen(thisforce))
                        {
                                self.move_velocity = self.move_velocity + self.damageforcescale * thisforce;
                                self.move_flags &~= FL_ONGROUND;
-                               //print("pushed ", ftos(num_for_edict(self)), " loose\n");
                        }
 
                if(w_issilent)
index 5793ed88b2eccc01fbdab754992aed83fb9ca135..b695867ca361995522005d50a69a99ab482ec66a 100644 (file)
@@ -57,19 +57,16 @@ void cl_effetcs_lightningarc(vector from, vector to,float seglength,float drifts
             dirnew = normalize(direction * (1 - drift) + randomvec() * drift);
             pos = pos_l +  dirnew * steplength;
             te_lightning1(world,pos_l,pos);
-            //b_make(pos_l, pos,"particles/lightning2",0.25,64);
             if(random() < branchfactor)
                 cl_effetcs_lightningarc(pos, pos + (dirnew * length * 0.25),seglength,drifts,drifte,min(branchfactor + branchfactor_add,1),branchfactor_add);
 
             pos_l = pos;
         }
         te_lightning1(world,pos_l,to);
-        //b_make(pos_l, to,"particles/lightning2",0.25,64);
 
     }
     else
         te_lightning1(world,from,to);
-        //b_make(from, to,"particles/lightning2",0.25,64);
 
 }
 
index 09327e30aa89098acbaac9208f6ee7a82ffee225..7ff5adeca46204beaf8e37d040341b84c3ee6854 100644 (file)
@@ -18,13 +18,6 @@ void Draw_CylindricLine(vector from, vector to, float thickness, string texture,
        // direction is perpendicular to the view normal, and perpendicular to the axis
        thickdir = normalize(cross(axis, vieworg - from));
 
-/*
-       print("from ", vtos(from), "\n");
-       print("to ", vtos(to), "\n");
-       print("org ", vtos(view_origin), "\n");
-       print("dir ", vtos(thickdir), "\n");
-*/
-
        A = from - thickdir * (thickness / 2);
        B = from + thickdir * (thickness / 2);
        C = to + thickdir * (thickness / 2);
index 5baa268fcfffba7616ab3957b9d62fee7e5ff974..e94d6a68aa786786f9babdf009e71deeb5b64259 100644 (file)
@@ -21,13 +21,13 @@ float mv_selection;
 string MapVote_FormatMapItem(float id, string map, float count, float maxwidth, vector fontsize)
 {
        string pre, post;
-       pre = strcat(ftos(id+1), ". ");
+       pre = sprintf("%d. ", id+1);
        if(mv_detail)
        {
                if(count == 1)
-                       post = strcat(" (1 vote)");
+                       post = _(" (1 vote)");
                else
-                       post = strcat(" (", ftos(count), " votes)");
+                       post = sprintf(_(" (%d votes)"), count);
        }
        else
                post = "";
@@ -110,7 +110,7 @@ void MapVote_DrawAbstain(vector pos, float isize, float tsize, float count, floa
 
        pos_y = pos_y + hud_fontsize_y;
        
-       label = MapVote_FormatMapItem(id, "Don't care", count, tsize, hud_fontsize);
+       label = MapVote_FormatMapItem(id, _("Don't care"), count, tsize, hud_fontsize);
 
        text_size = stringwidth(label, false, hud_fontsize);
        
@@ -191,12 +191,12 @@ void MapVote_Draw()
        pos_y = ymin;
        pos_z = 0;
        //pos_x = center - stringwidth("Vote for a map", false) * 0.5 * 24;
-       pos_x = center - stringwidth("Vote for a map", false, '12 0 0');
+       pos_x = center - stringwidth(_("Vote for a map"), false, '12 0 0');
        drawstring(pos, "Vote for a map", '24 24 0', '1 1 1', 1, DRAWFLAG_NORMAL);
        pos_y += 26;
 
        i = ceil(max(0, mv_timeout - time));
-       map = strcat(ftos(i), " seconds left");
+       map = sprintf(_("%d seconds left"), i);
        //pos_x = center - stringwidth(map, false) * 0.5 * 16;
        pos_x = center - stringwidth(map, false, '8 0 0');
        drawstring(pos, map, '16 16 0', '0 1 0', 1, DRAWFLAG_NORMAL);
@@ -260,7 +260,7 @@ void Cmd_MapVote_MapDownload(float argc)
 
        if(argc != 2 || !mv_pk3list)
        {
-               print("mv_mapdownload: ^3You're not supposed to use this command on your own!\n");
+               print(_("mv_mapdownload: ^3You're not supposed to use this command on your own!\n"));
                return;
        }
        
@@ -270,19 +270,16 @@ void Cmd_MapVote_MapDownload(float argc)
                        break;
        
        if(!pak || pak.sv_entnum != id) {
-               print("^1Error:^7 Couldn't find pak index.\n");
+               print(_("^1Error:^7 Couldn't find pak index.\n"));
                return;
        }
 
-       //print(strcat("^3Adding: ", ftos(id), " - ", pak.message, " - "));
-       
        if(PreviewExists(pak.message))
        {
                mv_preview[id] = true;
-               //print("^2Found...\n");
                return;
        } else {
-               print("Requesting preview...\n");
+               print(_("Requesting preview...\n"));
                localcmd(strcat("\ncmd mv_getpic ", ftos(id), "\n"));
        }
 }
@@ -381,7 +378,6 @@ void MapVote_Init()
 
                        mv_preview[i] = false;
 
-                       //print(strcat("RECV: ", map, " in ", pk3, "\n"));
                        MapVote_CheckPic(map, pk3, i);
                }
                else
index 87d4ff5186059b8807ff18b626dd10a38eae0c53..9374c7e60c0b6a7c9f59bce6a33801e9c04b7768 100644 (file)
@@ -29,18 +29,6 @@ Unresolved TODO:
 
 - translated campaigns
 
-client/casings.qc
-client/ctf.qc
-client/damage.qc
-client/effects.qc
-client/gibs.qc
-client/hook.qc
-client/hud.qc
-client/hud.qh
-client/laser.qc
-client/Main.qc
-client/main.qh
-client/mapvoting.qc
 client/miscfunctions.qc
 client/modeleffects.qc
 client/movetypes.qc
@@ -56,3 +44,4 @@ client/tuba.qc
 client/View.qc
 client/wall.qc
 client/waypointsprites.qc
+client/hud.qc