]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
right before dialogs
authorRudolf Polzer <divverent@alientrap.org>
Sun, 16 Jan 2011 20:43:17 +0000 (21:43 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 16 Jan 2011 20:43:17 +0000 (21:43 +0100)
qcsrc/common/util.qc
qcsrc/menu/stringfilelist.txt
qcsrc/menu/xonotic/credits.c
qcsrc/menu/xonotic/cvarlist.c
qcsrc/menu/xonotic/dialog.c

index 1bfbca6ae107cf27eab18fe437035669cc140e02..dcdd74deef9523b7ce3ebd9fce53ac874f07db9b 100644 (file)
@@ -360,7 +360,10 @@ float buf_load(string pFilename)
                return -1;
        fh = fopen(pFilename, FILE_READ);
        if(fh < 0)
-               return buf;
+       {
+               buf_del(buf);
+               return -1;
+       }
        i = 0;
        while((l = fgets(fh)))
        {
index 6017305fdc10338b5032bd855a56396e30812f7f..6016b1ba5058e31f5c0b06ee3ccbd7b75f4d5d0a 100644 (file)
@@ -5,20 +5,16 @@ Guideline:
   unless in developer-only functions (e.g. *dumptree*)
 - mark translatable strings with _()
 - if a translatable string is a strcat monster, change it to sprintf
+- if code loads files with text, allow loading
+  <filename>.cvar_string("prvm_language") in preference
 - test by:
   find . -type f -not -name \*.po | xgettext -LC -k_ -f- gamecommand.qc
 - interesting vi macros:
   :map # /"<return>
   :map ' i_(<esc>2f"a)<esc>/"<return>
-  
 
 List of files to do:
 
-./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
@@ -79,3 +75,9 @@ List of files to do:
 ./xonotic/textslider.c
 ./xonotic/util.qc
 ./xonotic/weaponslist.c
+
+
+
+Unresolved TODO:
+
+- translated campaigns
index 86609a659865c963c6485813867eaa53e0dd33ed..d0131b3fa7fd9b5e0643bc9cfbc0d7aa8e7d6d18 100644 (file)
@@ -30,7 +30,9 @@ void XonoticCreditsList_configureXonoticCreditsList(entity me)
 {
        me.configureXonoticListBox(me);
        // load the file
-       me.bufferIndex = buf_load("xonotic-credits.txt");
+       me.bufferIndex = buf_load(strcat("xonotic-credits.txt.", cvar_string("prvm_language")));
+       if(me.bufferIndex < 0)
+               me.bufferIndex = buf_load("xonotic-credits.txt");
        me.nItems = buf_getsize(me.bufferIndex);
 }
 void XonoticCreditsList_destroy(entity me)
index 3eaf2677e9a4316231080e552e34ad0c7bf7365b..587c73b93cdacb481eb24f1f5237520372d1cbc6 100644 (file)
@@ -81,15 +81,15 @@ void XonoticCvarList_setSelected(entity me, float i)
        t = cvar_type(me.cvarName);
        me.cvarType = "";
        if(t & CVAR_TYPEFLAG_SAVED)
-               me.cvarType = strcat(me.cvarType, ", will be saved to config.cfg");
+               me.cvarType = strcat(me.cvarType, _(", will be saved to config.cfg"));
        else
-               me.cvarType = strcat(me.cvarType, ", will not be saved");
+               me.cvarType = strcat(me.cvarType, _(", will not be saved"));
        if(t & CVAR_TYPEFLAG_PRIVATE)
-               me.cvarType = strcat(me.cvarType, ", private");
+               me.cvarType = strcat(me.cvarType, _(", private"));
        if(t & CVAR_TYPEFLAG_ENGINE)
-               me.cvarType = strcat(me.cvarType, ", engine setting");
+               me.cvarType = strcat(me.cvarType, _(", engine setting"));
        if(t & CVAR_TYPEFLAG_READONLY)
-               me.cvarType = strcat(me.cvarType, ", read only");
+               me.cvarType = strcat(me.cvarType, _(", read only"));
        me.cvarType = strzone(substring(me.cvarType, 2, strlen(me.cvarType) - 2));
 
        me.cvarNameBox.setText(me.cvarNameBox, me.cvarName);
index 7087d83cb9707987437edd588a45f71119ec8b14..f18658c7154197e1f1f7d535d0e8801d619d6631 100644 (file)
@@ -3,7 +3,7 @@ CLASS(XonoticDialog) EXTENDS(Dialog)
        // still to be customized by user
        /*
        ATTRIB(XonoticDialog, closable, float, 1)
-       ATTRIB(XonoticDialog, title, string, "Form1") // ;)
+       ATTRIB(XonoticDialog, title, string, _("Form1")) // ;)
        ATTRIB(XonoticDialog, color, vector, '1 0.5 1')
        ATTRIB(XonoticDialog, intendedWidth, float, 0)
        ATTRIB(XonoticDialog, rows, float, 3)