return -1;
fh = fopen(pFilename, FILE_READ);
if(fh < 0)
- return buf;
+ {
+ buf_del(buf);
+ return -1;
+ }
i = 0;
while((l = fgets(fh)))
{
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
./xonotic/textslider.c
./xonotic/util.qc
./xonotic/weaponslist.c
+
+
+
+Unresolved TODO:
+
+- translated campaigns
{
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)
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);
// 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)