diff --git a/xqf/ChangeLog b/xqf/ChangeLog index 94337dd..3e0944b 100644 --- a/xqf/ChangeLog +++ b/xqf/ChangeLog @@ -1,3 +1,16 @@ +June 8, 2001, Jordi Mallach +- Big internationalization patch for XQF. + Adds intl/ and po/ subdirs, and adds the gettext marks + to every .c that needs it. Modified configure.in and + the Makefile.am's to support gettext. From now on, + every string in the code should be wrapped inside + gettext() calls, and .c's should add a + if they don't have it already. + Some issues with the current code remain (untranslatable + strings), thats a work in progress. +- Initial, incomplete Spanish translation (po/es.po). +- changed configure.in so it barfs about qstat << 2.4c. + June 5, 2001: Alex Burger -Tribes 2 games can now be launched. Created a t2_exec function. If a name is specified in Player Profile, it diff --git a/xqf/Makefile.am b/xqf/Makefile.am index cc89e5b..995e91c 100644 --- a/xqf/Makefile.am +++ b/xqf/Makefile.am @@ -1,6 +1,6 @@ -SUBDIRS = src -EXTRA_DIST = \ +EXTRA_DIST = ABOUT-NLS AUTHORS BUGS COPYING ChangeLog CVS INSTALL \ + README TODO install-sh missing mkinstalldirs \ src/xpm/ \ src/xpm/q.xpm \ src/xpm/q2.xpm \ @@ -72,4 +72,6 @@ src/utils.h \ src/xqf-ui.h \ src/xutils.h \ src/zipped.h \ -src/gnuconfig.h \ +src/gnuconfig.h + +SUBDIRS = intl po src diff --git a/xqf/configure.in b/xqf/configure.in index 37b6fae..ad5e2ee 100644 --- a/xqf/configure.in +++ b/xqf/configure.in @@ -3,19 +3,28 @@ # Initially written by Markus Fischer # -AC_INIT( src/xqf.c) +AC_INIT(src/xqf.c) -AM_INIT_AUTOMAKE( xqf, 0.9.6g) +AM_INIT_AUTOMAKE(xqf, 0.9.6g) +dnl AM_CONFIG_HEADER(src/gnuconfig.h:src/gnuconfig.h.in) +AM_CONFIG_HEADER(src/gnuconfig.h) +ALL_LINGUAS="es" + +dnl Checks for programs. AC_PROG_CC AC_ISC_POSIX + +dnl Checks for header files. AC_HEADER_STDC AM_SANITY_CHECK +dnl Pick up the gettext, etc macros +dnl AM_ACLOCAL_INCLUDE(macros) +dnl AM_GNU_GETTEXT dnl check for qstat - AC_ARG_WITH(qstat,[ --with-qstat=CMD use CMD to run qstat]) AC_MSG_CHECKING(qstat version) @@ -36,7 +45,7 @@ if test "x$qstat_version" = "x" ; then AC_MSG_RESULT(qstat not found) echo echo "*** QStat is *required* to run XQF" - echo "*** Get it from http://www.activesw.com/people/steve/qstat.html" + echo "*** Get it from http://qstat.org/" echo "*** and put it in your path" echo exit 1 @@ -47,11 +56,11 @@ fi AC_SUBST(QSTATEXEC) case "$qstat_version" in - 2.0*|2.1y|2.1z|2.3a|2.3b) + 2.0*|2.1*|2.3*|2.4a|2.4b) echo echo "*** You have obsolete QStat beta version installed" - echo "*** QStat 2.3f is *required* to run XQF" - echo "*** Get it from http://www.activesw.com/people/steve/qstat.html" + echo "*** QStat 2.4c is *required* to run XQF" + echo "*** Get it from http://qstat.org/" echo exit 1 ;; @@ -79,7 +88,14 @@ AC_SUBST(DEBUG) AM_PATH_GTK(1.2.0,,exit 1) -AC_SUBST( VERSION) -AC_SUBST( QSTATEXEC) +AC_SUBST(VERSION) +AC_SUBST(QSTATEXEC) -AC_OUTPUT( Makefile src/gnuconfig.h src/Makefile) +dnl Pick up the gettext, etc macros +dnl AM_ACLOCAL_INCLUDE(macros) +AM_GNU_GETTEXT + +AC_DEFINE_UNQUOTED(XQF_VERSION, "$VERSION", XQF Version number) +AC_DEFINE_UNQUOTED(QSTAT_EXEC, "$QSTATEXEC", QSTAT executable path) + +AC_OUTPUT([Makefile intl/Makefile po/Makefile.in src/Makefile]) diff --git a/xqf/po/ChangeLog b/xqf/po/ChangeLog new file mode 100644 index 0000000..c651cba --- /dev/null +++ b/xqf/po/ChangeLog @@ -0,0 +1,8 @@ +2001-06-08 Jordi Mallach + + * Initial es.po, very incomplete. + +2001-06-02 gettextize + + * Initial gettextization. + diff --git a/xqf/po/POTFILES.in b/xqf/po/POTFILES.in new file mode 100644 index 0000000..616879a --- /dev/null +++ b/xqf/po/POTFILES.in @@ -0,0 +1,36 @@ +# List of source files containing translatable strings. + +# Package source files +src/addmaster.c +src/addserver.c +#src/config.c +#src/debug.c +src/dialogs.c +#src/dns.c +src/filter.c +src/flt-player.c +#src/game.c +#src/history.c +#src/host.c +src/launch.c +#src/menus.c +#src/pixmaps.c +src/pref.c +src/psearch.c +#src/rc.c +src/rcon.c +#src/server.c +#src/skin.c +#src/skin_pcx.c +#src/sort.c +src/source.c +#src/srv-info.c +#src/srv-list.c +src/srv-prop.c +src/stat.c +src/statistics.c +#src/utils.c +#src/xqf-ui.c +src/xqf.c +#src/xutils.c +#src/zipped.c diff --git a/xqf/po/es.po b/xqf/po/es.po new file mode 100644 index 0000000..9368fde --- /dev/null +++ b/xqf/po/es.po @@ -0,0 +1,1096 @@ +# Spanish catalogs for XQF. +# Copyright (C) 2001 Free Software Foundation, Inc. +# Jordi Mallach , 2001. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.9.6g\n" +"POT-Creation-Date: 2001-06-09 23:25+0200\n" +"PO-Revision-Date: 2001-06-08 02:20+0200\n" +"Last-Translator: Jordi Mallach \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/addmaster.c:143 +msgid "Add Master" +msgstr "Añadir Maestro" + +#. Master Name (Description) +#: src/addmaster.c:156 +msgid "Master Name" +msgstr "Nombre del Maestro" + +#. Master Address +#: src/addmaster.c:201 +msgid "Master Address" +msgstr "Dirección del Maestro" + +#. Cancel Button +#: src/addmaster.c:244 src/addserver.c:165 src/dialogs.c:318 src/filter.c:628 +#: src/launch.c:333 src/pref.c:2189 src/psearch.c:228 src/psearch.c:401 +#: src/srv-prop.c:595 src/xqf.c:618 src/xqf.c:630 src/xqf.c:1235 +msgid "Cancel" +msgstr "Cancelar" + +#: src/addserver.c:103 src/addserver.c:201 +msgid "Add Server" +msgstr "Añadir Servidor" + +#. Server Entry +#: src/addserver.c:114 +msgid "Server:" +msgstr "Servidor:" + +#: src/dialogs.c:117 src/dialogs.c:188 +msgid "XQF: Warning!" +msgstr "XQF: Atención!" + +#. OK Button +#: src/dialogs.c:142 src/dialogs.c:307 src/filter.c:636 src/pref.c:2197 +#: src/psearch.c:217 src/psearch.c:401 src/srv-prop.c:603 +msgid "OK" +msgstr "Aceptar" + +#: src/dialogs.c:213 +msgid "Yes" +msgstr "Sí" + +#: src/dialogs.c:225 +msgid "No" +msgstr "No" + +#: src/filter.c:429 +msgid "Server Filter" +msgstr "Filtro de Servidor" + +#: src/filter.c:434 +msgid "Server would pass filter if" +msgstr "El servidor pasaría el filtro si" + +#. max ping +#: src/filter.c:449 +msgid "ping is less than" +msgstr "el ping es menor que" + +#. max timeouts +#: src/filter.c:466 +msgid "the number of retires is fewer than" +msgstr "el número de retiros es menor que" + +#: src/filter.c:486 +msgid "Filter Name (For Menu):" +msgstr "Nombre del filtro (para el menú):" + +#. GAMETYPE Filter -- baa +#. http://developer.gnome.org/doc/API/gtk/gtktable.html +#: src/filter.c:504 +msgid "the game contains the string" +msgstr "el juego contiene la cadena" + +#. Version Filter -- baa +#: src/filter.c:522 +msgid "the version contains the string" +msgstr "la versión contiene la cadena" + +#: src/filter.c:541 +msgid "it is not full" +msgstr "no está lleno" + +#: src/filter.c:551 +msgid "it is not empty" +msgstr "no está vacío" + +#: src/filter.c:561 +msgid "cheats are not allowed" +msgstr "no se admiten trampas" + +#: src/filter.c:572 +msgid "no password required" +msgstr "no se requiere contraseña" + +#: src/filter.c:600 +msgid "XQF: Filters" +msgstr "XQF: Filtros" + +#: src/flt-player.c:73 src/flt-player.c:79 +msgid "string" +msgstr "cadena" + +#: src/flt-player.c:74 +msgid "substr" +msgstr "subcad" + +#: src/flt-player.c:75 +msgid "regexp" +msgstr "expreg" + +#: src/flt-player.c:80 +msgid "substring" +msgstr "subcadena" + +#: src/flt-player.c:81 +msgid "regular expression" +msgstr "expresión regular" + +#: src/flt-player.c:452 src/psearch.c:120 +msgid "XQF: Error" +msgstr "XQF: Error" + +#: src/flt-player.c:452 src/psearch.c:121 +#, c-format +msgid "" +"Regular Expression Error!\n" +"\n" +"%s\n" +"\n" +"%s." +msgstr "" +"Error en expresión regular!\n" +"\n" +"%s\n" +"\n" +"%s." + +#. Pattern Entry +#: src/flt-player.c:655 src/flt-player.c:743 +msgid "Pattern" +msgstr "Patrón" + +#. Comment +#: src/flt-player.c:690 +msgid "Pattern Comment" +msgstr "Comentario de patrón" + +#: src/flt-player.c:743 +msgid "Mode" +msgstr "Modo" + +#: src/flt-player.c:749 +msgid "Player Filter" +msgstr "Filtro de Jugadores" + +#: src/flt-player.c:806 +msgid "New" +msgstr "Nuevo" + +#: src/flt-player.c:812 src/xqf.c:1235 src/xqf.c:1678 src/xqf.c:1877 +msgid "Delete" +msgstr "Borrar" + +#: src/flt-player.c:824 src/statistics.c:75 +msgid "Up" +msgstr "Arriba" + +#: src/flt-player.c:830 src/statistics.c:75 +msgid "Down" +msgstr "Abajo" + +#: src/launch.c:72 src/launch.c:191 +msgid "XQF: ERROR!" +msgstr "XQF: ERROR!" + +#: src/launch.c:72 +#, c-format +msgid "" +"ERROR!\n" +"\n" +"%s(%s) failed: %s" +msgstr "" +"ERROR!\n" +"\n" +"%s(%s) ha fallado: %s" + +#: src/launch.c:191 +#, c-format +msgid "" +"ERROR!\n" +"\n" +"%s" +msgstr "" +"ERROR!\n" +"\n" +"%s" + +#: src/launch.c:333 src/xqf.c:618 src/xqf.c:630 +msgid "Launch" +msgstr "Lanzar" + +#: src/launch.c:334 +#, c-format +msgid "" +"There is %s client running.\n" +"\n" +"Launch %s client?" +msgstr "" +"Hay un cliente de %s corriendo.\n" +"\n" +"¿Lanzar cliente de %s?" + +#. Top (Shirt) Color +#: src/pref.c:767 src/pref.c:866 +msgid "Top" +msgstr "Superior" + +#. Bottom (Pants) Color +#: src/pref.c:783 src/pref.c:882 +msgid "Bottom" +msgstr "Inferior" + +#: src/pref.c:1023 +msgid "Colors" +msgstr "Colores" + +#: src/pref.c:1055 +msgid "Skin/Colors" +msgstr "Piel/Colores" + +#: src/pref.c:1070 +msgid "Team" +msgstr "Equipo" + +#: src/pref.c:1103 +msgid "Model/Skin" +msgstr "Modelo/Piel" + +#. Player Name +#: src/pref.c:1136 +msgid "Name" +msgstr "Nombre" + +#: src/pref.c:1189 +msgid "--- Anything ---" +msgstr "--- Cualquiera ---" + +#: src/pref.c:1190 +msgid "Axe" +msgstr "Hacha" + +#: src/pref.c:1191 +msgid "Shotgun" +msgstr "Escopeta" + +#: src/pref.c:1192 +msgid "Super Shotgun" +msgstr "Súper Escopeta" + +#: src/pref.c:1193 +msgid "Nailgun" +msgstr "Pistola de Clavos" + +#: src/pref.c:1194 +msgid "Super Nailgun" +msgstr "Súper Pistola de Clavos" + +#: src/pref.c:1195 +msgid "Grenade Launcher" +msgstr "Lanza Granadas" + +#: src/pref.c:1196 +msgid "Rocket Launcher" +msgstr "Lanza Cohetes" + +#: src/pref.c:1197 +msgid "ThunderBolt" +msgstr "Lanza Descargas" + +#: src/pref.c:1241 +msgid "Use skins" +msgstr "Usar pieles" + +#: src/pref.c:1247 +msgid "Don't use skins" +msgstr "No usar pieles" + +#: src/pref.c:1253 +msgid "Don't download new skins" +msgstr "No descargar nuevas pieles" + +#: src/pref.c:1293 +msgid "Command Line" +msgstr "Línea de comando" + +#: src/pref.c:1308 +msgid "Working Directory" +msgstr "Directorio de trabajo" + +#: src/pref.c:1337 +msgid "Custom CFG" +msgstr "CFG propia" + +#. Common Options +#: src/pref.c:1443 +msgid "Common Options" +msgstr "Opciones comunes" + +#: src/pref.c:1454 +msgid "Disable CD Audio" +msgstr "Deshabilitar audio CD" + +#. Disable Sound +#: src/pref.c:1462 +msgid "Disable Sound" +msgstr "Deshabilitar sonido" + +#: src/pref.c:1484 +msgid "Do not set (use game default)" +msgstr "No establecer (usar el valor por defecto)" + +#: src/pref.c:1485 +msgid "Automatically calculate from server ping time" +msgstr "Calcular automáticamente por el tiempo de ping del servidor" + +#: src/pref.c:1486 +msgid "Fixed value" +msgstr "Valor fijo" + +#. 'w_switch' & 'b_switch' control +#: src/pref.c:1548 +msgid "The highest weapon that Quake should switch to..." +msgstr "El arma más alta a la que Quake debería cambiar..." + +#: src/pref.c:1561 +msgid "upon a weapon pickup" +msgstr "al coger un arma" + +#: src/pref.c:1579 +msgid "upon a backpack pickup" +msgstr "al coger una mochila" + +#. 'pushlatency' +#: src/pref.c:1596 +msgid "pushlatency" +msgstr "pushlatency" + +#: src/pref.c:1614 +msgid "Disable auto-aiming" +msgstr "Deshabilitar autoapuntar" + +#: src/pref.c:1645 +msgid "Skins" +msgstr "Pieles" + +#: src/pref.c:1664 +msgid "Rate" +msgstr "Valor" + +#. Troubleshooting +#: src/pref.c:1684 +msgid "Troubleshooting" +msgstr "Solución de problemas" + +#: src/pref.c:1697 +msgid "Disable delta-compression (cl_nodelta)" +msgstr "Deshabilitar compresión-delta (cl_nodelta)" + +#: src/pref.c:1711 +msgid "Disable player/entity prediction (cl_predict_players)" +msgstr "Deshabilitar predicción de jugadores/objetos (cl_predict_players)" + +#: src/pref.c:1765 +msgid "Icons" +msgstr "Iconos" + +#: src/pref.c:1765 +msgid "Text" +msgstr "Texto" + +#: src/pref.c:1765 +msgid "Both" +msgstr "Ambos" + +#: src/pref.c:1784 +msgid "Show host names" +msgstr "Mostrar nombres de servidores" + +#: src/pref.c:1799 +msgid "Show default port" +msgstr "Mostrar puerto predeterminado" + +#: src/pref.c:1814 +msgid "Sort servers real-time during refresh" +msgstr "Ordenar servidores durante refrescos" + +#: src/pref.c:1829 +msgid "Refresh on update" +msgstr "Refrescar al actualizar" + +#. On Startup +#: src/pref.c:1844 +msgid "On Startup" +msgstr "Al iniciar" + +#: src/pref.c:1854 +msgid "Refresh Favorites" +msgstr "Refrescar favoritos" + +#. On Exit +#: src/pref.c:1867 +msgid "On Exit" +msgstr "Al salir" + +#: src/pref.c:1880 +msgid "Save server lists" +msgstr "Guardar listas de servidores" + +#: src/pref.c:1895 +msgid "Save server information" +msgstr "Guardar información sobre servidores" + +#: src/pref.c:1912 +msgid "Save player information" +msgstr "Guardar información sobre jugadores" + +#. On Quake Launch +#: src/pref.c:1928 +msgid "When launching a game..." +msgstr "Al iniciar un juego..." + +#: src/pref.c:1941 +msgid "Terminate XQF" +msgstr "Cerrar XQF" + +#: src/pref.c:1954 +msgid "Iconify XQF window" +msgstr "Iconificar la ventana de XQF" + +#: src/pref.c:1969 +msgid "Create LaunchInfo.txt" +msgstr "Crear LaunchInfo.txt" + +#: src/pref.c:1983 +msgid "Execute prelaunch" +msgstr "Ejecutar prelaunch" + +#. Toolbar +#: src/pref.c:1998 +msgid "Toolbar" +msgstr "Barra de herramientas" + +#. Toolbar Tips +#: src/pref.c:2023 +msgid "Tooltips" +msgstr "Pistas" + +#. QStat preferences -- maxsimultaneous & maxretries +#: src/pref.c:2051 +msgid "QStat Options" +msgstr "Opciones de QStat" + +#. maxsimultaneous +#: src/pref.c:2062 +msgid "Number of simultaneous servers to query" +msgstr "Número de servidores a consultar simultáneamente" + +#. maxretries +#: src/pref.c:2079 +msgid "Number of retries" +msgstr "Número de reintentos" + +#: src/pref.c:2120 +msgid "XQF: Preferences" +msgstr "XQF: Preferencias" + +#: src/pref.c:2140 +msgid "Player Profile" +msgstr "Ficha de jugador" + +#: src/pref.c:2145 +msgid "Games" +msgstr "Juegos" + +#: src/pref.c:2150 +msgid "Appearance" +msgstr "Apariencia" + +#: src/pref.c:2155 +msgid "QStat" +msgstr "QStat" + +#: src/pref.c:2160 +msgid "QW/Q2" +msgstr "QW/Q2" + +#: src/pref.c:2262 +msgid "Unable to get user name/home/tmpdir\n" +msgstr "No se ha podido obtener el nombre/home/dirtmp del usuario\n" + +#: src/psearch.c:55 +msgid "Exact Match" +msgstr "Coincidencia Exacta" + +#: src/psearch.c:56 +msgid "Substring" +msgstr "Subcadena" + +#: src/psearch.c:57 +msgid "Regular Expression" +msgstr "Expresión Regular" + +#: src/psearch.c:178 +msgid "Find Player" +msgstr "Buscar Jugador" + +#. Pattern Entry +#: src/psearch.c:189 +msgid "Find Player:" +msgstr "Buscar Jugador:" + +#: src/psearch.c:398 +msgid "Player not found." +msgstr "Jugador no encontrado." + +#: src/psearch.c:402 +msgid "End of server list reached. Continue from beginning?" +msgstr "" +"Alcanzado el final de la lista de servidores. ¿Continuar desde el principio?" + +#. Message +#: src/rcon.c:351 +msgid "Cmd:" +msgstr "Cmdo:" + +#. Send Button +#: src/rcon.c:378 +msgid "Send" +msgstr "Enviar" + +#. Status Button +#: src/rcon.c:387 +msgid "Status" +msgstr "Estado" + +#. Clear Button +#: src/rcon.c:396 +msgid "Clear" +msgstr "Limpiar" + +#: src/rcon.c:418 src/statistics.c:549 +msgid "Close" +msgstr "Cerrar" + +#: src/source.c:115 +msgid "Retry" +msgstr "Reintentar" + +#: src/source.c:115 +msgid "Skip" +msgstr "Ignorar" + +#: src/source.c:116 +#, c-format +msgid "" +"Cannot write to file %s\n" +"System Error: %s\n" +msgstr "" +"No se puede escribir el fichero %s\n" +"Error del sistema: %s\n" + +#: src/srv-prop.c:332 +msgid "IP Address:" +msgstr "Dirección IP:" + +#: src/srv-prop.c:342 +msgid "Port:" +msgstr "Puerto:" + +#: src/srv-prop.c:354 +msgid "Host Name:" +msgstr "Nombre del servidor:" + +#: src/srv-prop.c:366 +msgid "Refreshed:" +msgstr "Refrescado:" + +#. Sources +#: src/srv-prop.c:388 +msgid "Sources" +msgstr "Fuentes" + +#: src/srv-prop.c:440 +msgid "Custom CFG:" +msgstr "CFG propia:" + +#: src/srv-prop.c:489 +msgid "Server Password" +msgstr "Contraseña del servidor" + +#: src/srv-prop.c:496 +msgid "Spectator Password" +msgstr "Contraseña de espectador" + +#: src/srv-prop.c:503 +msgid "RCon Password" +msgstr "Password de RCon" + +#: src/srv-prop.c:530 +msgid "Properties" +msgstr "Propiedades" + +#: src/srv-prop.c:575 +msgid "Info" +msgstr "Info" + +#: src/srv-prop.c:580 +msgid "Passwords" +msgstr "Contraseñas" + +#: src/stat.c:862 +#, c-format +msgid "Failed to create a temporary file %s" +msgstr "No se ha podido crear un fichero temporal %s" + +#: src/statistics.c:75 src/statistics.c:86 +msgid "Servers" +msgstr "Servidores" + +#: src/statistics.c:75 +msgid "T/O" +msgstr "T/O" + +#: src/statistics.c:75 +msgid "Info n/a" +msgstr "Info n/d" + +#: src/statistics.c:75 +msgid "Players" +msgstr "Jugadores" + +#: src/statistics.c:79 src/statistics.c:83 +msgid "unknown" +msgstr "desconocido" + +#: src/statistics.c:87 +msgid "OS/CPU" +msgstr "SO/CPU" + +#: src/statistics.c:360 src/statistics.c:408 src/statistics.c:413 +msgid "Total" +msgstr "Total" + +#: src/statistics.c:403 +msgid "CPU \\ OS" +msgstr "CPU \\ SO" + +#: src/statistics.c:509 src/statistics.c:515 +msgid "Statistics" +msgstr "Estadísticas" + +#: src/xqf.c:488 +msgid "Updating lists..." +msgstr "Actualizando listas..." + +#: src/xqf.c:492 +#, c-format +msgid "Resolving host names: %d/%d" +msgstr "Resolviendo nombres de servidores: %d/%d" + +#: src/xqf.c:496 +#, c-format +msgid "Refreshing: %d/%d" +msgstr "Refrescando: %d/%d" + +#: src/xqf.c:500 +#, c-format +msgid "Resolving host addresses: %d/%d" +msgstr "Resolviendo direcciones de servidores: %d/%d" + +#: src/xqf.c:525 +msgid "Done." +msgstr "Hecho." + +#: src/xqf.c:619 +#, c-format +msgid "" +"Server %s:%d is %s.\n" +"\n" +"Launch client anyway?" +msgstr "" +"El servidor %s:%d está %s.\n" +"\n" +"¿Lanzar cliente igualmente?" + +#: src/xqf.c:631 +#, c-format +msgid "" +"Server %s:%d is full.\n" +"\n" +"Launch client anyway?" +msgstr "" +"El servidor %s:%d está lleno.\n" +"\n" +"¿Lanzar cliente igualmente?" + +#: src/xqf.c:650 src/xqf.c:670 src/xqf.c:1359 +msgid "Save Password" +msgstr "Guardar contraseña" + +#: src/xqf.c:650 +msgid "Spectator Password:" +msgstr "Contraseña de espectador:" + +#: src/xqf.c:670 src/xqf.c:1359 +msgid "Server Password:" +msgstr "Contraseña del servidor:" + +#: src/xqf.c:803 +msgid "Spectator" +msgstr "Espectador" + +#: src/xqf.c:804 src/xqf.c:807 +msgid "Demo name:" +msgstr "Nombre de demo" + +#: src/xqf.c:1007 +#, c-format +msgid "Host %s not found" +msgstr "Servidor %s no encontrado" + +#: src/xqf.c:1031 +#, c-format +msgid "\"%s\" is not valid host[:port] combination." +msgstr "\"%s\" no es una combinación máquina[:puerto] válida." + +#: src/xqf.c:1192 +#, c-format +msgid "Master address \"%s\" is not valid." +msgstr "La dirección de maestro \"%s\" no es válida." + +#: src/xqf.c:1236 +#, c-format +msgid "" +"Master%s to delete:\n" +"\n" +"%s" +msgstr "" +"Maestro%s a borrar:\n" +"\n" +"%s" + +#: src/xqf.c:1259 +#, c-format +msgid "Find Player: %s" +msgstr "Buscar Jugador: %s" + +#: src/xqf.c:1482 +#, c-format +msgid "%d server" +msgstr "%d servidor" + +#: src/xqf.c:1482 +#, c-format +msgid "%d servers" +msgstr "%d servidores" + +#: src/xqf.c:1625 +msgid "About XQF" +msgstr "Acerca de XQF" + +#: src/xqf.c:1626 +#, c-format +msgid "" +"X11 Quake/QuakeWorld/Quake2/Quake3 Front-End\n" +"Version %s\n" +"\n" +"Copyright (C) 1998-2001 Roman Pozlevich \n" +"\n" +"Mod & server version filter: Bill Adams \n" +"SoF & GameSpy master support: Alex Burger \n" +"Internationalization (i18n): Jordi Mallach \n" +"\n" +"http://www.linuxgames.com/xqf/" +msgstr "" +"Front-End X11 para Quake/QuakeWorld/Quake2/Quake3\n" +"Versión %s\n" +"Copyright (C) 1998-2001 Roman Pozlevich \n" +"\n" +"Mod y filtro de versiones de servidores: Bill Adams \n" +"Soporte para SoF y maestros de GameSpy: Alex Burger \n" +"Internacionalización (i18n): Jordi Mallach \n" +"\n" +"http://www.linuxgames.com/xqf/" + +#: src/xqf.c:1650 src/xqf.c:2109 +msgid "Connect" +msgstr "Conectar" + +#: src/xqf.c:1655 src/xqf.c:2117 +msgid "Observe" +msgstr "Observar" + +#: src/xqf.c:1660 src/xqf.c:2125 +msgid "Record Demo" +msgstr "Grabar demo" + +#: src/xqf.c:1668 +msgid "Add to Favorites" +msgstr "Añadir a Favoritos" + +#: src/xqf.c:1673 +msgid "Add..." +msgstr "Añadir..." + +#: src/xqf.c:1683 +msgid "Copy" +msgstr "Copiar" + +#: src/xqf.c:1688 +msgid "Copy+" +msgstr "Copiar+" + +#: src/xqf.c:1696 src/xqf.c:2083 +msgid "Refresh" +msgstr "Refrescar" + +#: src/xqf.c:1701 +msgid "Refresh Selected" +msgstr "Refrescar Seleccionados" + +#: src/xqf.c:1709 +msgid "DNS Lookup" +msgstr "Búsqueda DNS" + +#: src/xqf.c:1717 +msgid "RCon..." +msgstr "RCon..." + +#: src/xqf.c:1722 +msgid "Properties..." +msgstr "Propiedades..." + +#: src/xqf.c:1732 +msgid "_Statistics..." +msgstr "_Estadísticas..." + +#: src/xqf.c:1740 +msgid "_Exit" +msgstr "_Salir" + +#: src/xqf.c:1750 +msgid "_Add Server..." +msgstr "_Añadir Servidor..." + +#: src/xqf.c:1755 +msgid "_Delete" +msgstr "_Borrar" + +#: src/xqf.c:1760 +msgid "_Copy" +msgstr "_Copiar" + +#: src/xqf.c:1765 +msgid "_Copy+" +msgstr "_Copiar+" + +#: src/xqf.c:1773 +msgid "Add _Master..." +msgstr "Añadir _Maestro..." + +#: src/xqf.c:1778 +msgid "D_elete Master" +msgstr "_Borrar Maestro" + +#: src/xqf.c:1786 +msgid "_Find Player..." +msgstr "B_uscar Jugador..." + +#: src/xqf.c:1791 +msgid "Find A_gain" +msgstr "Buscar _Otra Vez" + +#: src/xqf.c:1801 +msgid "_Refresh" +msgstr "_Refrescar" + +#: src/xqf.c:1806 +msgid "Refresh _Selected" +msgstr "Refrescar _Seleccionados" + +#: src/xqf.c:1811 +msgid "_Update From Master" +msgstr "Act_ualizar Desde Master" + +#: src/xqf.c:1819 +msgid "Show _Host Names" +msgstr "Mostrar _Nombres de Servidores" + +#: src/xqf.c:1824 +msgid "Show Default _Port" +msgstr "Mostrar _Puerto por Defecto" + +#: src/xqf.c:1846 +msgid "_Server Filters" +msgstr "Filtros de _Servidores" + +#: src/xqf.c:1854 +msgid "_Connect" +msgstr "_Conectar" + +#: src/xqf.c:1859 +msgid "_Observe" +msgstr "_Observar" + +#: src/xqf.c:1864 +msgid "Record _Demo" +msgstr "Grabar _Demo" + +#: src/xqf.c:1872 +msgid "Add to _Favorites" +msgstr "Añadir a _Favoritos" + +#: src/xqf.c:1883 +msgid "DNS _Lookup" +msgstr "Búsqueda D_NS" + +#: src/xqf.c:1891 +msgid "_RCon..." +msgstr "_RCon..." + +#: src/xqf.c:1896 +msgid "_Properties..." +msgstr "_Propiedades..." + +#: src/xqf.c:1906 +msgid "_Player Profile..." +msgstr "_Ficha de Jugador..." + +#: src/xqf.c:1912 +msgid "_Games..." +msgstr "_Juegos" + +#: src/xqf.c:1918 +msgid "_Appearance..." +msgstr "_Apariencia..." + +#: src/xqf.c:1924 +msgid "_QStat Options..." +msgstr "Opciones de _QStat..." + +#: src/xqf.c:1930 +msgid "_QW/Q2 Options..." +msgstr "Opciones de _QW/Q2..." + +#: src/xqf.c:1939 +msgid "_Server Filter..." +msgstr "Filtro de _Servidores..." + +#: src/xqf.c:1944 +msgid "Player _Filter..." +msgstr "_Filtro de Jugadores..." + +#: src/xqf.c:1954 +msgid "_About..." +msgstr "_Acerca de..." + +#: src/xqf.c:1965 +msgid "_File" +msgstr "_Fichero" + +#: src/xqf.c:1970 +msgid "_Edit" +msgstr "_Editar" + +#: src/xqf.c:1975 +msgid "_View" +msgstr "_Ver" + +#: src/xqf.c:1980 +msgid "_Server" +msgstr "_Servidor" + +#: src/xqf.c:1985 +msgid "_Preferences" +msgstr "_Preferencias" + +#: src/xqf.c:1990 +msgid "_Help" +msgstr "_Ayuda" + +#: src/xqf.c:2033 +msgid "Mark as Red" +msgstr "Marcar en rojo" + +#: src/xqf.c:2040 +msgid "Mark as Green" +msgstr "Marcar en verde" + +#: src/xqf.c:2047 +msgid "Mark as Blue" +msgstr "Marcar en azul" + +#: src/xqf.c:2054 +msgid "Add to Player Filter" +msgstr "Añadir al filtro de jugadores" + +#: src/xqf.c:2075 +msgid "Update" +msgstr "Actualizar" + +#: src/xqf.c:2075 +msgid "Update from master" +msgstr "Actualizar desde master" + +#: src/xqf.c:2083 +msgid "Refresh current list" +msgstr "Refrescar lista actual" + +#: src/xqf.c:2091 +msgid "Ref.Sel." +msgstr "Ref.Sel." + +#: src/xqf.c:2091 +msgid "Refresh selected servers" +msgstr "Refrescar servidores seleccionados" + +#: src/xqf.c:2099 +msgid "Stop" +msgstr "Parar" + +#: src/xqf.c:2125 +msgid "Record" +msgstr "Grabar" + +#: src/xqf.c:2220 +msgid "Filters" +msgstr "Filtros" + +#: src/xqf.c:2240 +msgid "None" +msgstr "Ninguno" + +#~ msgid "" +#~ "X11 Quake/QuakeWorld/Quake2/Quake3 Front-End\n" +#~ "Version " +#~ msgstr "" +#~ "Frontend X11 para Quake/QuakeWorld/Quake2/Quake3\n" +#~ "Versión " + +#~ msgid "build_filtered_list() -- Server %lx added to list" +#~ msgstr "build_filtered_list() -- Servidor %lx añadido a la lista" + +#~ msgid "Unexpected character: " +#~ msgstr "Carácter inesperado: " + +#, fuzzy +#~ msgid "server_clist_build_filtered() -- add server %lx to row %d" +#~ msgstr "build_filtered_list() -- Servidor %lx añadido a la lista" + +#~ msgid "Host name is not valid: %s\n" +#~ msgstr "Nombre de servidor inválido: %s\n" + +#~ msgid "Status: %s\n" +#~ msgstr "Estado: %s\n" + +#~ msgid "No Server Filter Active" +#~ msgstr "No hay filtros de servidor activos" + +#~ msgid "Server Filter: %s" +#~ msgstr "Filtro de servidor: %s" + +#~ msgid "Server Filter: %d" +#~ msgstr "Filtro de servidor: %d" + +#~ msgid "Unable to start DNS helper\n" +#~ msgstr "No se ha podido iniciar el ayudante de DNS\n" diff --git a/xqf/src/Makefile.am b/xqf/src/Makefile.am index 35ef8b1..991e7ca 100644 --- a/xqf/src/Makefile.am +++ b/xqf/src/Makefile.am @@ -1,9 +1,10 @@ -INCLUDES = @GTK_CFLAGS@ +localedir = $(datadir)/locale +INCLUDES = -Iintl -DLOCALEDIR=\"$(localedir)\" -I@includedir@ @GTK_CFLAGS@ CFLAGS = @CFLAGS@ @QSTAT23@ @DEBUG@ @COMPRESSION@ bin_PROGRAMS = xqf -xqf_LDADD = @GTK_LIBS@ +xqf_LDADD = @INTLLIBS@ @GTK_LIBS@ xqf_SOURCES = \ addmaster.c \ diff --git a/xqf/src/addmaster.c b/xqf/src/addmaster.c index 0326cca..f2ec48b 100644 --- a/xqf/src/addmaster.c +++ b/xqf/src/addmaster.c @@ -29,6 +29,12 @@ #include "source.h" #include "addmaster.h" +#ifdef ENABLE_NLS +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif static struct history *master_history_addr = NULL; static struct history *master_history_name = NULL; @@ -134,7 +140,7 @@ char *add_master_dialog (enum server_type *type, char **desc) { *type = QW_SERVER; } - window = dialog_create_modal_transient_window ("Add Master", + window = dialog_create_modal_transient_window (_("Add Master"), TRUE, FALSE, NULL); main_vbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), main_vbox); @@ -147,7 +153,7 @@ char *add_master_dialog (enum server_type *type, char **desc) { /* Master Name (Description) */ - label = gtk_label_new ("Master Name"); + label = gtk_label_new (_("Master Name")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0); @@ -192,7 +198,7 @@ char *add_master_dialog (enum server_type *type, char **desc) { /* Master Address */ - label = gtk_label_new ("Master Address"); + label = gtk_label_new (_("Master Address")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0); @@ -235,7 +241,7 @@ char *add_master_dialog (enum server_type *type, char **desc) { /* Cancel Button */ - button = gtk_button_new_with_label ("Cancel"); + button = gtk_button_new_with_label (_("Cancel")); gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_widget_set_usize (button, 80, -1); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", diff --git a/xqf/src/addserver.c b/xqf/src/addserver.c index bb7dc69..cbf5b8e 100644 --- a/xqf/src/addserver.c +++ b/xqf/src/addserver.c @@ -25,6 +25,13 @@ #include "config.h" #include "addserver.h" +#ifdef ENABLE_NLS +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + static struct history *server_history = NULL; @@ -93,7 +100,7 @@ char *add_server_dialog (enum server_type *type) { *type = QW_SERVER; } - window = dialog_create_modal_transient_window ("Add Server", + window = dialog_create_modal_transient_window (_("Add Server"), TRUE, FALSE, NULL); main_vbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), main_vbox); @@ -104,7 +111,7 @@ char *add_server_dialog (enum server_type *type) { /* Server Entry */ - label = gtk_label_new ("Server:"); + label = gtk_label_new (_("Server:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); @@ -155,7 +162,7 @@ char *add_server_dialog (enum server_type *type) { /* Cancel Button */ - button = gtk_button_new_with_label ("Cancel"); + button = gtk_button_new_with_label (_("Cancel")); gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_widget_set_usize (button, 80, -1); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", @@ -191,7 +198,7 @@ char *add_server_dialog (enum server_type *type) { void add_server_init (void) { - server_history = history_new ("Add Server"); + server_history = history_new (_("Add Server")); } diff --git a/xqf/src/dialogs.c b/xqf/src/dialogs.c index 352e746..611d8e2 100644 --- a/xqf/src/dialogs.c +++ b/xqf/src/dialogs.c @@ -28,6 +28,13 @@ #include "xutils.h" #include "dialogs.h" +#ifdef ENABLE_NLS +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + static int destroy_on_escape (GtkWidget *widget, GdkEventKey *event) { @@ -107,7 +114,8 @@ void dialog_ok (char *title, char *fmt, ...) { va_end (ap); window = dialog_create_modal_transient_window ( - (title)? title : "XQF: Warning!", TRUE, FALSE, NULL); + (title)? title : _("XQF: Warning!"), + TRUE, FALSE, NULL); main_vbox = gtk_vbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 8); @@ -131,7 +139,7 @@ void dialog_ok (char *title, char *fmt, ...) { gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, TRUE, 0); - button = gtk_button_new_with_label ("OK"); + button = gtk_button_new_with_label (_("OK")); gtk_widget_set_usize (button, 96, -1); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, FALSE, 0); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", @@ -177,7 +185,8 @@ int dialog_yesno (char *title, int defbutton, char *yes, char *no, va_end (ap); window = dialog_create_modal_transient_window ( - (title)? title : "XQF: Warning!", TRUE, FALSE, NULL); + (title)? title : _("XQF: Warning!"), + TRUE, FALSE, NULL); main_vbox = gtk_vbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 8); @@ -201,7 +210,7 @@ int dialog_yesno (char *title, int defbutton, char *yes, char *no, gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, TRUE, 0); - button = gtk_button_new_with_label ((yes)? yes : "Yes"); + button = gtk_button_new_with_label ((yes)? yes : _("Yes")); gtk_widget_set_usize (button, 96, -1); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "clicked", @@ -213,7 +222,7 @@ int dialog_yesno (char *title, int defbutton, char *yes, char *no, gtk_widget_grab_default (button); gtk_widget_show (button); - button = gtk_button_new_with_label ((no)? no : "No"); + button = gtk_button_new_with_label ((no)? no : _("No")); gtk_widget_set_usize (button, 96, -1); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, FALSE, 0); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", @@ -295,7 +304,7 @@ static char *va_enter_string_dialog (int visible, char *optstr, int *optval, /* OK Button */ - button = gtk_button_new_with_label (" OK "); + button = gtk_button_new_with_label (_("OK")); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (enter_string_activate_callback), GTK_OBJECT (enter_string_entry)); @@ -306,7 +315,7 @@ static char *va_enter_string_dialog (int visible, char *optstr, int *optval, /* Cancel Button */ - button = gtk_button_new_with_label (" Cancel "); + button = gtk_button_new_with_label (_("Cancel")); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); diff --git a/xqf/src/dns.c b/xqf/src/dns.c index 08a142b..614a4aa 100644 --- a/xqf/src/dns.c +++ b/xqf/src/dns.c @@ -43,7 +43,6 @@ extern int h_errno; /* h_errno */ #include "host.h" #include "utils.h" - #ifndef MAXHOSTNAMELEN # define MAXHOSTNAMELEN 64 #endif @@ -505,7 +504,8 @@ static void dns_resolve (char *str) { if (dns_workers_num >= DNS_MAX_CHILDREN || !dns_dispatch_to_worker (str)) { #ifdef DEBUG - fprintf (stderr, "DNS Master> \"%s\" is put to the waiting queue\n", str); + fprintf (stderr, "DNS Master> \"%s\" is put to the waiting queue\n", + str); #endif dns_queue_add (strdup (str)); } @@ -652,7 +652,8 @@ static void dns_master_mainloop (void) { #ifdef DEBUG fprintf (stderr, "DNS Master> %d workers, queue is %s\n", - dns_workers_num, (q_head)? "not empty" : "empty"); + dns_workers_num, + (q_head)? "not empty" : "empty"); #endif FD_ZERO (&readfds); diff --git a/xqf/src/filter.c b/xqf/src/filter.c index 8636a4e..1850301 100644 --- a/xqf/src/filter.c +++ b/xqf/src/filter.c @@ -28,6 +28,13 @@ #include "filter.h" #include "flt-player.h" +#ifdef ENABLE_NLS +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + static int server_pass_filter (struct server *s, struct server_filter_vars *vars); static void server_filter_init (void); @@ -419,12 +426,12 @@ static void server_filter_page (GtkWidget *notebook) { page_hbox = gtk_hbox_new (TRUE, 8); gtk_container_set_border_width (GTK_CONTAINER (page_hbox), 8); - label = gtk_label_new ("Server Filter"); + label = gtk_label_new (_("Server Filter")); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page_hbox, label); - frame = gtk_frame_new ("Server would pass filter if"); + frame = gtk_frame_new (_("Server would pass filter if")); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN); gtk_box_pack_start (GTK_BOX (page_hbox), frame, FALSE, FALSE, 0); @@ -439,7 +446,7 @@ static void server_filter_page (GtkWidget *notebook) { /* max ping */ - label = gtk_label_new ("ping is less than"); + label = gtk_label_new (_("ping is less than")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0); @@ -456,7 +463,7 @@ static void server_filter_page (GtkWidget *notebook) { /* max timeouts */ - label = gtk_label_new ("the number of retires is fewer than"); + label = gtk_label_new (_("the number of retires is fewer than")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0); @@ -476,7 +483,7 @@ static void server_filter_page (GtkWidget *notebook) { row = 0; sprintf( label_buf, "Filter %d", current_server_filter + 1 ); - label = gtk_label_new ("Filter Name (For Menu):"); + label = gtk_label_new (_("Filter Name (For Menu):")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 3, 4, row, row+1, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (label); @@ -494,7 +501,7 @@ static void server_filter_page (GtkWidget *notebook) { /* GAMETYPE Filter -- baa */ /* http://developer.gnome.org/doc/API/gtk/gtktable.html */ - label = gtk_label_new ("the game contains the string"); + label = gtk_label_new (_("the game contains the string")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 3, 4, row, row+1, GTK_FILL, GTK_FILL, 0, 0); @@ -512,7 +519,7 @@ static void server_filter_page (GtkWidget *notebook) { /* Version Filter -- baa */ - label = gtk_label_new ("the version contains the string"); + label = gtk_label_new (_("the version contains the string")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 3, 4, row, row+1, GTK_FILL, GTK_FILL, 0, 0); @@ -531,7 +538,7 @@ static void server_filter_page (GtkWidget *notebook) { /* not full */ filter_not_full_check_button = - gtk_check_button_new_with_label ("it is not full"); + gtk_check_button_new_with_label (_("it is not full")); gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (filter_not_full_check_button), server_filters[current_server_filter].filter_not_full); gtk_table_attach_defaults (GTK_TABLE (table), filter_not_full_check_button, @@ -541,7 +548,7 @@ static void server_filter_page (GtkWidget *notebook) { /* not empty */ filter_not_empty_check_button = - gtk_check_button_new_with_label ("it is not empty"); + gtk_check_button_new_with_label (_("it is not empty")); gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (filter_not_empty_check_button), server_filters[current_server_filter].filter_not_empty); gtk_table_attach_defaults (GTK_TABLE (table), filter_not_empty_check_button, @@ -551,7 +558,7 @@ static void server_filter_page (GtkWidget *notebook) { /* no cheats */ filter_no_cheats_check_button = - gtk_check_button_new_with_label ("cheats are not allowed"); + gtk_check_button_new_with_label (_("cheats are not allowed")); gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (filter_no_cheats_check_button), server_filters[current_server_filter].filter_no_cheats); @@ -562,7 +569,7 @@ static void server_filter_page (GtkWidget *notebook) { /* no password */ filter_no_password_check_button = - gtk_check_button_new_with_label ("no password required"); + gtk_check_button_new_with_label (_("no password required")); gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (filter_no_password_check_button), server_filters[current_server_filter].filter_no_password); @@ -590,7 +597,7 @@ int filters_cfg_dialog (int page_num) { const char *flt_status[3] = { "not changed", "changed", "data changed" }; #endif - window = dialog_create_modal_transient_window ("XQF: Filters", + window = dialog_create_modal_transient_window (_("XQF: Filters"), TRUE, TRUE, NULL); vbox = gtk_vbox_new (FALSE, 8); gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); @@ -618,7 +625,7 @@ int filters_cfg_dialog (int page_num) { hbox = gtk_hbox_new (FALSE, 8); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); - button = gtk_button_new_with_label ("Cancel"); + button = gtk_button_new_with_label (_("Cancel")); gtk_widget_set_usize (button, 80, -1); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); @@ -626,7 +633,7 @@ int filters_cfg_dialog (int page_num) { GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_show (button); - button = gtk_button_new_with_label ("OK"); + button = gtk_button_new_with_label (_("OK")); gtk_widget_set_usize (button, 80, -1); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (server_filter_new_defaults), NULL); diff --git a/xqf/src/flt-player.c b/xqf/src/flt-player.c index 1b6eedf..303df95 100644 --- a/xqf/src/flt-player.c +++ b/xqf/src/flt-player.c @@ -34,6 +34,13 @@ #include "flt-player.h" #include "filter.h" +#ifdef ENABLE_NLS +#include +#define _(string) gettext(string) +#define N_(string) (string) +#else +#define _(string) (string) +#endif #define REGCOMP_FLAGS (REG_EXTENDED | REG_NOSUB | REG_ICASE) @@ -63,15 +70,15 @@ enum { }; static char *mode_symbols[3] = { - "string", - "substr", - "regexp" + N_("string"), + N_("substr"), + N_("regexp") }; static const char *mode_names[3] = { - "string", - "substring", - "regular expression" + N_("string"), + N_("substring"), + N_("regular expression") }; @@ -442,7 +449,7 @@ static void show_pattern_error (int row) { pp = (struct player_pattern *) list->data; if (pp->error) { - dialog_ok ("XQF: Error", "Regular Expression Error!\n\n%s\n\n%s.", + dialog_ok (_("XQF: Error"), _("Regular Expression Error!\n\n%s\n\n%s."), pp->pattern, pp->error); } } @@ -645,7 +652,7 @@ static GtkWidget *player_filter_pattern_editor (void) { /* Pattern Entry */ - label = gtk_label_new ("Pattern"); + label = gtk_label_new (_("Pattern")); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, 0, 0, 0, 0); gtk_widget_show (label); @@ -680,7 +687,7 @@ static GtkWidget *player_filter_pattern_editor (void) { /* Comment */ - frame = gtk_frame_new ("Pattern Comment"); + frame = gtk_frame_new (_("Pattern Comment")); gtk_box_pack_end (GTK_BOX (vbox), frame, TRUE, TRUE, 0); hbox = gtk_hbox_new (FALSE, 0); @@ -733,13 +740,13 @@ void player_filter_page (GtkWidget *notebook) { GtkWidget *pixmap; GtkWidget *button; GtkWidget *peditor; - char *titles[5] = { "", "", "", "Mode", "Pattern" }; + char *titles[5] = { "", "", "", N_("Mode"), N_("Pattern") }; int i; page_hbox = gtk_hbox_new (FALSE, 8); gtk_container_set_border_width (GTK_CONTAINER (page_hbox), 8); - label = gtk_label_new ("Player Filter"); + label = gtk_label_new (_("Player Filter")); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page_hbox, label); @@ -796,13 +803,13 @@ void player_filter_page (GtkWidget *notebook) { vbox = gtk_vbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (page_hbox), vbox, FALSE, FALSE, 0); - button = gtk_button_new_with_label (" New "); + button = gtk_button_new_with_label (_("New")); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (new_pattern_callback), NULL); gtk_widget_show (button); - delete_button = gtk_button_new_with_label (" Delete "); + delete_button = gtk_button_new_with_label (_("Delete")); gtk_box_pack_start (GTK_BOX (vbox), delete_button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (delete_button), "clicked", GTK_SIGNAL_FUNC (delete_pattern_callback), NULL); @@ -814,13 +821,13 @@ void player_filter_page (GtkWidget *notebook) { vbox2 = gtk_vbox_new (FALSE, 4); gtk_container_add (GTK_CONTAINER (alignment), vbox2); - up_button = gtk_button_new_with_label (" Up "); + up_button = gtk_button_new_with_label (_("Up")); gtk_box_pack_start (GTK_BOX (vbox2), up_button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (up_button), "clicked", GTK_SIGNAL_FUNC (move_up_down_pattern_callback), (void *) -1); gtk_widget_show (up_button); - down_button = gtk_button_new_with_label (" Down "); + down_button = gtk_button_new_with_label (_("Down")); gtk_box_pack_start (GTK_BOX (vbox2), down_button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (down_button), "clicked", GTK_SIGNAL_FUNC (move_up_down_pattern_callback), (void *) 1); diff --git a/xqf/src/launch.c b/xqf/src/launch.c index 23a7701..1c6f726 100644 --- a/xqf/src/launch.c +++ b/xqf/src/launch.c @@ -41,6 +41,12 @@ # define WAIT_ANY -1 #endif +#ifdef ENABLE_NLS +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif #define CLIENT_ERROR_BUFFER 256 #define CLIENT_ERROR_MSG_HEAD " " @@ -63,7 +69,7 @@ static GSList *clients = NULL; static void dialog_failed (char *func, char *arg) { - dialog_ok ("XQF: ERROR!", "ERROR!\n\n%s(%s) failed: %s", + dialog_ok (_("XQF: ERROR!"), _("ERROR!\n\n%s(%s) failed: %s"), func, (arg)? arg : "", g_strerror (errno)); } @@ -182,7 +188,7 @@ static void client_input_callback (struct running_client *cl, int fd, if (!strncmp (cl->buffer, CLIENT_ERROR_MSG_HEAD, strlen (CLIENT_ERROR_MSG_HEAD))) { - dialog_ok ("XQF: ERROR!", "ERROR!\n\n%s", + dialog_ok (_("XQF: ERROR!"), _("ERROR!\n\n%s"), cl->buffer + strlen (CLIENT_ERROR_MSG_HEAD)); pid = cl->pid; /* save PID value */ @@ -324,8 +330,8 @@ static int already_running (enum server_type type) { s = (struct server *) ((struct running_client *) clients->data) -> server; - res = dialog_yesno (NULL, 1, "Launch", "Cancel", - "There is %s client running.\n\nLaunch %s client?", + res = dialog_yesno (NULL, 1, _("Launch"), _("Cancel"), + _("There is %s client running.\n\nLaunch %s client?"), (another)? games[type].name : games[s->type].name, (another)? "another" : games[type].name); diff --git a/xqf/src/pref.c b/xqf/src/pref.c index 872b69e..69d420f 100644 --- a/xqf/src/pref.c +++ b/xqf/src/pref.c @@ -36,6 +36,14 @@ #include "config.h" #include "rc.h" +#ifdef ENABLE_NLS +#include +#define _(string) gettext(string) +#define N_(string) (string) +#else +#define _(string) (string) +#endif + char *user_rcdir = NULL; @@ -756,7 +764,7 @@ static GtkWidget *q1_skin_box_create (void) { /* Top (Shirt) Color */ - label = gtk_label_new ("Top"); + label = gtk_label_new (_("Top")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1); gtk_widget_show (label); @@ -772,7 +780,7 @@ static GtkWidget *q1_skin_box_create (void) { /* Bottom (Pants) Color */ - label = gtk_label_new ("Bottom"); + label = gtk_label_new (_("Bottom")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2); gtk_widget_show (label); @@ -855,7 +863,7 @@ static GtkWidget *qw_skin_box_create (void) { /* Top (Shirt) Color */ - label = gtk_label_new ("Top"); + label = gtk_label_new (_("Top")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1); gtk_widget_show (label); @@ -871,7 +879,7 @@ static GtkWidget *qw_skin_box_create (void) { /* Bottom (Pants) Color */ - label = gtk_label_new ("Bottom"); + label = gtk_label_new (_("Bottom")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2); gtk_widget_show (label); @@ -1012,7 +1020,7 @@ static GtkWidget *player_profile_q1_page (void) { alignment = gtk_alignment_new (0.5, 0.5, 0, 0); gtk_box_pack_start (GTK_BOX (page_vbox), alignment, FALSE, FALSE, 0); - frame = gtk_frame_new ("Colors"); + frame = gtk_frame_new (_("Colors")); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN); gtk_container_add (GTK_CONTAINER (alignment), frame); @@ -1044,7 +1052,7 @@ static GtkWidget *player_profile_qw_page (void) { alignment = gtk_alignment_new (0.5, 0.5, 0, 0); gtk_box_pack_start (GTK_BOX (page_vbox), alignment, FALSE, FALSE, 0); - frame = gtk_frame_new ("Skin/Colors"); + frame = gtk_frame_new (_("Skin/Colors")); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN); gtk_container_add (GTK_CONTAINER (alignment), frame); @@ -1059,7 +1067,7 @@ static GtkWidget *player_profile_qw_page (void) { hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (page_vbox), hbox, FALSE, FALSE, 4); - label = gtk_label_new ("Team"); + label = gtk_label_new (_("Team")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); @@ -1092,7 +1100,7 @@ static GtkWidget *player_profile_q2_page (void) { alignment = gtk_alignment_new (0.5, 0.5, 0, 0); gtk_box_pack_start (GTK_BOX (page_vbox), alignment, FALSE, FALSE, 0); - frame = gtk_frame_new ("Model/Skin"); + frame = gtk_frame_new (_("Model/Skin")); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN); gtk_container_add (GTK_CONTAINER (alignment), frame); @@ -1125,7 +1133,7 @@ static GtkWidget *player_profile_page (void) { /* Player Name */ - label = gtk_label_new ("Name"); + label = gtk_label_new (_("Name")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); @@ -1178,15 +1186,15 @@ static GtkWidget *player_profile_page (void) { static char *wb_switch_labels[9] = { - "--- Anything ---", - "Axe", - "Shotgun", - "Super Shotgun", - "Nailgun", - "Super Nailgun", - "Grenade Launcher", - "Rocket Launcher", - "ThunderBolt" + N_("--- Anything ---"), + N_("Axe"), + N_("Shotgun"), + N_("Super Shotgun"), + N_("Nailgun"), + N_("Super Nailgun"), + N_("Grenade Launcher"), + N_("Rocket Launcher"), + N_("ThunderBolt") }; @@ -1208,7 +1216,7 @@ static GtkWidget *create_wb_switch_menu (void (*callback) (GtkWidget *, int)) { menu = gtk_menu_new (); for (i = 0; i < 9; i++) { - menu_item = gtk_menu_item_new_with_label (wb_switch_labels[i]); + menu_item = gtk_menu_item_new_with_label (_(wb_switch_labels[i])); gtk_signal_connect (GTK_OBJECT (menu_item), "activate", GTK_SIGNAL_FUNC (callback), (gpointer) i); gtk_menu_append (GTK_MENU (menu), menu_item); @@ -1230,19 +1238,19 @@ static GtkWidget *create_noskins_menu (void) { menu = gtk_menu_new (); - menu_item = gtk_menu_item_new_with_label ("Use skins"); + menu_item = gtk_menu_item_new_with_label (_("Use skins")); gtk_signal_connect (GTK_OBJECT (menu_item), "activate", GTK_SIGNAL_FUNC (noskins_option_menu_callback), (gpointer) 0); gtk_menu_append (GTK_MENU (menu), menu_item); gtk_widget_show (menu_item); - menu_item = gtk_menu_item_new_with_label ("Don\'t use skins"); + menu_item = gtk_menu_item_new_with_label (_("Don\'t use skins")); gtk_signal_connect (GTK_OBJECT (menu_item), "activate", GTK_SIGNAL_FUNC (noskins_option_menu_callback), (gpointer) 1); gtk_menu_append (GTK_MENU (menu), menu_item); gtk_widget_show (menu_item); - menu_item = gtk_menu_item_new_with_label ("Don\'t download new skins"); + menu_item = gtk_menu_item_new_with_label (_("Don\'t download new skins")); gtk_signal_connect (GTK_OBJECT (menu_item), "activate", GTK_SIGNAL_FUNC (noskins_option_menu_callback), (gpointer) 2); gtk_menu_append (GTK_MENU (menu), menu_item); @@ -1282,7 +1290,7 @@ static GtkWidget *generic_game_frame (enum server_type type) { gtk_table_set_col_spacings (GTK_TABLE (table), 4); gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0); - label = gtk_label_new ("Command Line"); + label = gtk_label_new (_("Command Line")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0); @@ -1297,7 +1305,7 @@ static GtkWidget *generic_game_frame (enum server_type type) { 1, 2, 0, 1); gtk_widget_show (genprefs[type].cmd_entry); - label = gtk_label_new ("Working Directory"); + label = gtk_label_new (_("Working Directory")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0); @@ -1326,7 +1334,7 @@ static GtkWidget *generic_game_frame (enum server_type type) { gtk_widget_show (genprefs[type].dir_entry); if (games[type].custom_cfgs) { - label = gtk_label_new ("Custom CFG"); + label = gtk_label_new (_("Custom CFG")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, GTK_FILL, GTK_FILL, 0, 0); @@ -1432,7 +1440,7 @@ static GtkWidget *games_config_page (int defgame) { /* Common Options */ - frame = gtk_frame_new ("Common Options"); + frame = gtk_frame_new (_("Common Options")); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN); gtk_box_pack_start (GTK_BOX (page_vbox), frame, FALSE, FALSE, 20); @@ -1443,7 +1451,7 @@ static GtkWidget *games_config_page (int defgame) { /* Disable CD Audio */ nocdaudio_check_button = - gtk_check_button_new_with_label ("Disable CD Audio"); + gtk_check_button_new_with_label (_("Disable CD Audio")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (nocdaudio_check_button), default_nocdaudio); gtk_box_pack_end (GTK_BOX (hbox), nocdaudio_check_button, TRUE, FALSE, 0); @@ -1451,7 +1459,7 @@ static GtkWidget *games_config_page (int defgame) { /* Disable Sound */ - nosound_check_button = gtk_check_button_new_with_label ("Disable Sound"); + nosound_check_button = gtk_check_button_new_with_label (_("Disable Sound")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (nosound_check_button), default_nosound); gtk_box_pack_end (GTK_BOX (hbox), nosound_check_button, TRUE, FALSE, 0); @@ -1473,9 +1481,9 @@ static void add_pushlatency_options (GtkWidget *vbox) { int i; static const char *pushlatency_modes[] = { - "Do not set (use game default)", - "Automatically calculate from server ping time", - "Fixed value" + N_("Do not set (use game default)"), + N_("Automatically calculate from server ping time"), + N_("Fixed value") }; for (i = 0; i < 3; i++) { @@ -1483,7 +1491,7 @@ static void add_pushlatency_options (GtkWidget *vbox) { gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); pushlatency_mode_radio_buttons[i] = - gtk_radio_button_new_with_label (group, pushlatency_modes[i]); + gtk_radio_button_new_with_label (group, _(pushlatency_modes[i])); group = gtk_radio_button_group ( GTK_RADIO_BUTTON (pushlatency_mode_radio_buttons[i])); gtk_box_pack_start (GTK_BOX (hbox), pushlatency_mode_radio_buttons[i], @@ -1537,7 +1545,8 @@ static GtkWidget *qw_q2_options_page (void) { /* 'w_switch' & 'b_switch' control */ - frame2 = gtk_frame_new ("The highest weapon that Quake should switch to..."); + frame2 = gtk_frame_new (_("The highest weapon that Quake should " + "switch to...")); gtk_box_pack_start (GTK_BOX (vbox), frame2, FALSE, FALSE, 0); vbox2 = gtk_vbox_new (FALSE, 0); @@ -1549,7 +1558,7 @@ static GtkWidget *qw_q2_options_page (void) { hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0); - label = gtk_label_new ("upon a weapon pickup"); + label = gtk_label_new (_("upon a weapon pickup")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); @@ -1567,7 +1576,7 @@ static GtkWidget *qw_q2_options_page (void) { hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0); - label = gtk_label_new ("upon a backpack pickup"); + label = gtk_label_new (_("upon a backpack pickup")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); @@ -1584,7 +1593,7 @@ static GtkWidget *qw_q2_options_page (void) { /* 'pushlatency' */ - frame2 = gtk_frame_new ("pushlatency"); + frame2 = gtk_frame_new (_("pushlatency")); gtk_box_pack_start (GTK_BOX (vbox), frame2, FALSE, FALSE, 0); vbox2 = gtk_vbox_new (FALSE, 2); @@ -1601,7 +1610,8 @@ static GtkWidget *qw_q2_options_page (void) { hbox = gtk_hbox_new (FALSE, 8); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); - noaim_check_button = gtk_check_button_new_with_label ("Disable auto-aiming"); + noaim_check_button = + gtk_check_button_new_with_label (_("Disable auto-aiming")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (noaim_check_button), default_noaim); gtk_box_pack_start (GTK_BOX (hbox), noaim_check_button, FALSE, FALSE, 0); @@ -1632,7 +1642,7 @@ static GtkWidget *qw_q2_options_page (void) { hbox2 = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (hbox), hbox2, FALSE, FALSE, 0); - label = gtk_label_new ("Skins"); + label = gtk_label_new (_("Skins")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0); gtk_widget_show (label); @@ -1651,7 +1661,7 @@ static GtkWidget *qw_q2_options_page (void) { hbox2 = gtk_hbox_new (FALSE, 4); gtk_box_pack_end (GTK_BOX (hbox), hbox2, FALSE, FALSE, 0); - label = gtk_label_new ("Rate"); + label = gtk_label_new (_("Rate")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0); gtk_widget_show (label); @@ -1671,7 +1681,7 @@ static GtkWidget *qw_q2_options_page (void) { /* Troubleshooting */ - frame2 = gtk_frame_new ("Troubleshooting"); + frame2 = gtk_frame_new (_("Troubleshooting")); gtk_box_pack_start (GTK_BOX (vbox), frame2, FALSE, FALSE, 0); vbox2 = gtk_vbox_new (FALSE, 0); @@ -1684,7 +1694,7 @@ static GtkWidget *qw_q2_options_page (void) { gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0); cl_nodelta_check_button = gtk_check_button_new_with_label ( - "Disable delta-compression (cl_nodelta)"); + _("Disable delta-compression (cl_nodelta)")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cl_nodelta_check_button), default_cl_nodelta); gtk_box_pack_start (GTK_BOX (hbox), cl_nodelta_check_button, FALSE, FALSE, 0); @@ -1698,7 +1708,7 @@ static GtkWidget *qw_q2_options_page (void) { gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0); cl_predict_check_button = gtk_check_button_new_with_label ( - "Disable player/entity prediction (cl_predict_players)"); + _("Disable player/entity prediction (cl_predict_players)")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cl_predict_check_button), 1 - default_cl_predict); gtk_box_pack_start (GTK_BOX (hbox), cl_predict_check_button, FALSE, FALSE, 0); @@ -1752,7 +1762,7 @@ static GtkWidget *appearance_options_page (void) { GtkWidget *hbox; GtkWidget *vbox; GSList *group = NULL; - static const char *toolbar_styles[] = { "Icons", "Text", "Both" }; + static const char *toolbar_styles[] = { N_("Icons"), N_("Text"), N_("Both") }; int i; page_vbox = gtk_vbox_new (FALSE, 4); @@ -1771,7 +1781,7 @@ static GtkWidget *appearance_options_page (void) { gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); show_hostnames_check_button = - gtk_check_button_new_with_label ("Show host names"); + gtk_check_button_new_with_label (_("Show host names")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (show_hostnames_check_button), show_hostnames); gtk_box_pack_start (GTK_BOX (hbox), show_hostnames_check_button, @@ -1786,7 +1796,7 @@ static GtkWidget *appearance_options_page (void) { gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); show_defport_check_button = - gtk_check_button_new_with_label ("Show default port"); + gtk_check_button_new_with_label (_("Show default port")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (show_defport_check_button), show_default_port); gtk_box_pack_start (GTK_BOX (hbox), show_defport_check_button, @@ -1801,7 +1811,7 @@ static GtkWidget *appearance_options_page (void) { gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); refresh_sorts_check_button = gtk_check_button_new_with_label ( - "Sort servers real-time during refresh"); + _("Sort servers real-time during refresh")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (refresh_sorts_check_button), default_refresh_sorts); gtk_box_pack_start (GTK_BOX (hbox), refresh_sorts_check_button, @@ -1816,7 +1826,7 @@ static GtkWidget *appearance_options_page (void) { gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); refresh_on_update_check_button = - gtk_check_button_new_with_label ("Refresh on update"); + gtk_check_button_new_with_label (_("Refresh on update")); gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (refresh_on_update_check_button), default_refresh_on_update); @@ -1831,7 +1841,7 @@ static GtkWidget *appearance_options_page (void) { /* On Startup */ - frame = gtk_frame_new ("On Startup"); + frame = gtk_frame_new (_("On Startup")); gtk_box_pack_start (GTK_BOX (page_vbox), frame, FALSE, FALSE, 0); /* Refresh Favorites */ @@ -1841,7 +1851,7 @@ static GtkWidget *appearance_options_page (void) { gtk_container_add (GTK_CONTAINER (frame), hbox); auto_favorites_check_button = - gtk_check_button_new_with_label ("Refresh Favorites"); + gtk_check_button_new_with_label (_("Refresh Favorites")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (auto_favorites_check_button), default_auto_favorites); gtk_box_pack_start (GTK_BOX (hbox), auto_favorites_check_button, @@ -1854,7 +1864,7 @@ static GtkWidget *appearance_options_page (void) { /* On Exit */ - frame = gtk_frame_new ("On Exit"); + frame = gtk_frame_new (_("On Exit")); gtk_box_pack_start (GTK_BOX (page_vbox), frame, FALSE, FALSE, 0); vbox = gtk_vbox_new (FALSE, 2); @@ -1867,7 +1877,7 @@ static GtkWidget *appearance_options_page (void) { gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); save_lists_check_button = - gtk_check_button_new_with_label ("Save server lists"); + gtk_check_button_new_with_label (_("Save server lists")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (save_lists_check_button), default_save_lists); gtk_box_pack_start (GTK_BOX (hbox), save_lists_check_button, @@ -1882,7 +1892,7 @@ static GtkWidget *appearance_options_page (void) { gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); save_srvinfo_check_button = - gtk_check_button_new_with_label ("Save server information"); + gtk_check_button_new_with_label (_("Save server information")); gtk_box_pack_start (GTK_BOX (hbox), save_srvinfo_check_button, FALSE, FALSE, 0); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (save_srvinfo_check_button), @@ -1899,7 +1909,7 @@ static GtkWidget *appearance_options_page (void) { gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); save_plrinfo_check_button = - gtk_check_button_new_with_label ("Save player information"); + gtk_check_button_new_with_label (_("Save player information")); gtk_box_pack_start (GTK_BOX (hbox), save_plrinfo_check_button, FALSE, FALSE, 0); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (save_plrinfo_check_button), @@ -1915,7 +1925,7 @@ static GtkWidget *appearance_options_page (void) { /* On Quake Launch */ - frame = gtk_frame_new ("When launching a game..."); + frame = gtk_frame_new (_("When launching a game...")); gtk_box_pack_start (GTK_BOX (page_vbox), frame, FALSE, FALSE, 0); vbox = gtk_vbox_new (FALSE, 2); @@ -1927,7 +1937,8 @@ static GtkWidget *appearance_options_page (void) { hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); - terminate_check_button = gtk_check_button_new_with_label ("Terminate XQF"); + terminate_check_button = gtk_check_button_new_with_label ( + _("Terminate XQF")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (terminate_check_button), default_terminate); gtk_signal_connect (GTK_OBJECT (terminate_check_button), "toggled", @@ -1940,7 +1951,7 @@ static GtkWidget *appearance_options_page (void) { /* Iconify */ iconify_check_button = - gtk_check_button_new_with_label ("Iconify XQF window"); + gtk_check_button_new_with_label (_("Iconify XQF window")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (iconify_check_button), default_iconify); if (default_terminate) @@ -1955,7 +1966,7 @@ static GtkWidget *appearance_options_page (void) { gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); launchinfo_check_button = gtk_check_button_new_with_label - ("Create LaunchInfo.txt"); + (_("Create LaunchInfo.txt")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (launchinfo_check_button), default_launchinfo); gtk_signal_connect (GTK_OBJECT (launchinfo_check_button), "toggled", @@ -1969,7 +1980,7 @@ static GtkWidget *appearance_options_page (void) { /* Prelaunchinfo */ prelaunchexec_check_button = gtk_check_button_new_with_label - ("Execute prelaunch"); + (_("Execute prelaunch")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prelaunchexec_check_button), default_prelaunchexec); gtk_signal_connect (GTK_OBJECT (prelaunchexec_check_button), "toggled", @@ -1984,7 +1995,7 @@ static GtkWidget *appearance_options_page (void) { /* Toolbar */ - frame = gtk_frame_new ("Toolbar"); + frame = gtk_frame_new (_("Toolbar")); gtk_box_pack_start (GTK_BOX (page_vbox), frame, FALSE, FALSE, 0); hbox = gtk_hbox_new (FALSE, 4); @@ -1995,7 +2006,7 @@ static GtkWidget *appearance_options_page (void) { for (i = 0; i < 3; i++) { toolbar_style_radio_buttons[i] = - gtk_radio_button_new_with_label (group, toolbar_styles[i]); + gtk_radio_button_new_with_label (group, _(toolbar_styles[i])); group = gtk_radio_button_group ( GTK_RADIO_BUTTON (toolbar_style_radio_buttons[i])); gtk_box_pack_start (GTK_BOX (hbox), toolbar_style_radio_buttons[i], @@ -2009,7 +2020,7 @@ static GtkWidget *appearance_options_page (void) { /* Toolbar Tips */ - toolbar_tips_check_button = gtk_check_button_new_with_label ("Tooltips"); + toolbar_tips_check_button = gtk_check_button_new_with_label (_("Tooltips")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toolbar_tips_check_button), default_toolbar_tips); gtk_box_pack_end (GTK_BOX (hbox), toolbar_tips_check_button, @@ -2037,7 +2048,7 @@ static GtkWidget *qstat_options_page (void) { /* QStat preferences -- maxsimultaneous & maxretries */ - frame = gtk_frame_new ("QStat Options"); + frame = gtk_frame_new (_("QStat Options")); gtk_box_pack_start (GTK_BOX (page_vbox), frame, FALSE, FALSE, 0); table = gtk_table_new (2, 2, FALSE); @@ -2048,7 +2059,7 @@ static GtkWidget *qstat_options_page (void) { /* maxsimultaneous */ - label = gtk_label_new ("Number of simultaneous servers to query"); + label = gtk_label_new (_("Number of simultaneous servers to query")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1); gtk_widget_show (label); @@ -2065,7 +2076,7 @@ static GtkWidget *qstat_options_page (void) { /* maxretries */ - label = gtk_label_new ("Number of retries"); + label = gtk_label_new (_("Number of retries")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2); gtk_widget_show (label); @@ -2106,7 +2117,7 @@ void preferences_dialog (int page_num) { set_pref_defaults (); window = dialog_create_modal_transient_window ( - "XQF: Preferences", TRUE, FALSE, NULL); + _("XQF: Preferences"), TRUE, FALSE, NULL); if (!GTK_WIDGET_REALIZED (window)) gtk_widget_realize (window); @@ -2126,27 +2137,27 @@ void preferences_dialog (int page_num) { gtk_box_pack_start (GTK_BOX (vbox), notebook, FALSE, FALSE, 0); page = player_profile_page (); - label = gtk_label_new ("Player Profile"); + label = gtk_label_new (_("Player Profile")); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); page = games_config_page (game_num); - label = gtk_label_new ("Games"); + label = gtk_label_new (_("Games")); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); page = appearance_options_page (); - label = gtk_label_new ("Appearance"); + label = gtk_label_new (_("Appearance")); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); page = qstat_options_page (); - label = gtk_label_new ("QStat"); + label = gtk_label_new (_("QStat")); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); page = qw_q2_options_page (); - label = gtk_label_new ("QW/Q2"); + label = gtk_label_new (_("QW/Q2")); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); @@ -2175,7 +2186,7 @@ void preferences_dialog (int page_num) { hbox = gtk_hbox_new (FALSE, 8); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); - button = gtk_button_new_with_label ("Cancel"); + button = gtk_button_new_with_label (_("Cancel")); gtk_widget_set_usize (button, 80, -1); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); @@ -2183,7 +2194,7 @@ void preferences_dialog (int page_num) { GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_show (button); - button = gtk_button_new_with_label ("OK"); + button = gtk_button_new_with_label (_("OK")); gtk_widget_set_usize (button, 80, -1); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (get_new_defaults), NULL); @@ -2248,7 +2259,7 @@ int fix_qw_player_color (int color) { int init_user_info (void) { if (!g_get_user_name () || !g_get_home_dir () || !g_get_tmp_dir ()) { - fprintf (stderr, "Unable to get user name/home/tmpdir\n"); + fprintf (stderr, _("Unable to get user name/home/tmpdir\n")); return FALSE; } user_rcdir = file_in_dir (g_get_home_dir (), RC_DIR); @@ -2360,7 +2371,7 @@ int prefs_load (void) { #ifdef DEBUG fprintf (stderr, "prefs_load(): program version %s\n", - (newversion)? "changed" : "not changed" ); + (newversion)? "changed" : "not changed"); #endif /* Convert "dir" -> "real_dir" for all game types */ diff --git a/xqf/src/psearch.c b/xqf/src/psearch.c index 9a5541a..02ccf39 100644 --- a/xqf/src/psearch.c +++ b/xqf/src/psearch.c @@ -31,6 +31,13 @@ #include "config.h" #include "psearch.h" +#ifdef ENABLE_NLS +#include +#define _(string) gettext(string) +#define N_(string) (string) +#else +#define _(string) (string) +#endif #define REGCOMP_FLAGS (REG_EXTENDED | REG_NOSUB | REG_ICASE) @@ -45,9 +52,9 @@ static GtkWidget *mode_buttons[3]; static int psearch_new_pattern; static const char *mode_names[3] = { - "Exact Match", - "Substring", - "Regular Expression" + N_("Exact Match"), + N_("Substring"), + N_("Regular Expression") }; @@ -110,8 +117,9 @@ static int psearch_compile_pattern (void) { error = get_regerror (res, (regex_t *) psearch.data); psearch_free_pattern (); - dialog_ok ("XQF: Error", "Regular Expression Error!\n\n%s\n\n%s.", - psearch.pattern, error); + dialog_ok (_("XQF: Error"), + _("Regular Expression Error!\n\n%s\n\n%s."), + psearch.pattern, error); g_free (error); return FALSE; } @@ -167,7 +175,7 @@ int find_player_dialog (void) { psearch_new_pattern = FALSE; - window = dialog_create_modal_transient_window ("Find Player", + window = dialog_create_modal_transient_window (_("Find Player"), TRUE, FALSE, NULL); main_vbox = gtk_vbox_new (FALSE, 8); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 16); @@ -178,7 +186,7 @@ int find_player_dialog (void) { /* Pattern Entry */ - label = gtk_label_new ("Find Player:"); + label = gtk_label_new (_("Find Player:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); @@ -206,7 +214,7 @@ int find_player_dialog (void) { /* OK Button */ - button = gtk_button_new_with_label (" OK "); + button = gtk_button_new_with_label (_("OK")); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (psearch_combo_activate_callback), GTK_OBJECT (psearch_combo)); @@ -217,7 +225,7 @@ int find_player_dialog (void) { /* Cancel Button */ - button = gtk_button_new_with_label (" Cancel "); + button = gtk_button_new_with_label (_("Cancel")); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); @@ -233,7 +241,8 @@ int find_player_dialog (void) { group = NULL; for (i = 0; i < 3; i++) { - mode_buttons[i] = gtk_radio_button_new_with_label (group, mode_names[i]); + mode_buttons[i] = gtk_radio_button_new_with_label (group, + _(mode_names[i])); group = gtk_radio_button_group (GTK_RADIO_BUTTON (mode_buttons[i])); gtk_box_pack_start (GTK_BOX (hbox), mode_buttons[i], FALSE, FALSE, 0); gtk_widget_show (mode_buttons[i]); @@ -386,11 +395,11 @@ void find_player (int find_next) { } if (!find_next || server_clist->selection == NULL) { - dialog_ok (NULL, "Player not found."); + dialog_ok (NULL, _("Player not found.")); } else { - if (dialog_yesno (NULL, 0, "OK", "Cancel", - "End of server list reached. Continue from beginning?")) { + if (dialog_yesno (NULL, 0, _("OK"), _("Cancel"), + _("End of server list reached. Continue from beginning?"))) { find_player (FALSE); } } diff --git a/xqf/src/rc.c b/xqf/src/rc.c index ab52cde..da736cb 100644 --- a/xqf/src/rc.c +++ b/xqf/src/rc.c @@ -136,7 +136,7 @@ static struct keyword keywords[] = { static void unexpected_char_error (char c) { fprintf (stderr, "Unexpected character: "); fprintf (stderr, (isprint (c))? "\'%c\'" : "\\%03o", c); - fprintf (stderr, " in file %s[line:%d,pos:%d]\n", rcfilename, line, pos); + fprintf (stderr, " in file %s[line:%d,pos:%d]\n"), rcfilename, line, pos; } diff --git a/xqf/src/rcon.c b/xqf/src/rcon.c index ff051c6..0fb3306 100644 --- a/xqf/src/rcon.c +++ b/xqf/src/rcon.c @@ -38,6 +38,12 @@ #include "config.h" #include "rcon.h" +#ifdef ENABLE_NLS +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif #define PACKET_MAXSIZE (64 * 1024) @@ -342,7 +348,7 @@ void rcon_dialog (struct server *s, char *passwd) { /* Message */ - label = gtk_label_new ("Cmd:"); + label = gtk_label_new (_("Cmd:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); @@ -369,7 +375,7 @@ void rcon_dialog (struct server *s, char *passwd) { /* Send Button */ - button = gtk_button_new_with_label (" Send "); + button = gtk_button_new_with_label (_("Send")); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (rcon_combo_activate_callback), passwd); GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS); @@ -378,7 +384,7 @@ void rcon_dialog (struct server *s, char *passwd) { /* Status Button */ - button = gtk_button_new_with_label (" Status "); + button = gtk_button_new_with_label (_("Status")); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (rcon_status_button_clicked_callback), passwd); GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS); @@ -387,7 +393,7 @@ void rcon_dialog (struct server *s, char *passwd) { /* Clear Button */ - button = gtk_button_new_with_label (" Clear "); + button = gtk_button_new_with_label (_("Clear")); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (rcon_clear_button_clicked_callback), NULL); GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS); @@ -409,7 +415,7 @@ void rcon_dialog (struct server *s, char *passwd) { gtk_container_set_border_width (GTK_CONTAINER (hbox), 8); gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0); - button = gtk_button_new_with_label ("Close"); + button = gtk_button_new_with_label (_("Close")); gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_widget_set_usize (button, 80, -1); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", diff --git a/xqf/src/skin.c b/xqf/src/skin.c index 1a1d590..f944ded 100644 --- a/xqf/src/skin.c +++ b/xqf/src/skin.c @@ -31,7 +31,6 @@ #include "skin.h" #include "skin_pcx.h" - #define NOSKIN_BCOLOR 0x80 #define NOSKIN_WCOLOR 0xC0 diff --git a/xqf/src/source.c b/xqf/src/source.c index be54001..a97c80f 100644 --- a/xqf/src/source.c +++ b/xqf/src/source.c @@ -45,6 +45,13 @@ extern int errno; #include "zipped.h" #include "stat.h" +#ifdef ENABLE_NLS +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + struct master *favorites = NULL; GSList *master_groups = NULL; @@ -105,8 +112,8 @@ void save_favorites (void) { f = fopen (realname, "w"); if (!f) { - if (dialog_yesno (NULL, 0, "Retry", "Skip", - "Cannot write to file %s\nSystem Error: %s\n", + if (dialog_yesno (NULL, 0, _("Retry"), _("Skip"), + _("Cannot write to file %s\nSystem Error: %s\n"), realname, g_strerror (errno))) { continue; } diff --git a/xqf/src/srv-prop.c b/xqf/src/srv-prop.c index 6900bba..9461712 100644 --- a/xqf/src/srv-prop.c +++ b/xqf/src/srv-prop.c @@ -40,6 +40,13 @@ #include "dialogs.h" #include "srv-prop.h" +#ifdef ENABLE_NLS +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + static GtkWidget *password_entry; static GtkWidget *spectator_entry; @@ -322,7 +329,7 @@ static GtkWidget *server_info_page (struct server *s) { gtk_table_set_col_spacing (GTK_TABLE (table), 1, 16); - label = gtk_label_new ("IP Address:"); + label = gtk_label_new (_("IP Address:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1); gtk_widget_show (label); @@ -332,7 +339,7 @@ static GtkWidget *server_info_page (struct server *s) { gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 0, 1); gtk_widget_show (label); - label = gtk_label_new ("Port:"); + label = gtk_label_new (_("Port:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 2, 3, 0, 1); gtk_widget_show (label); @@ -344,7 +351,7 @@ static GtkWidget *server_info_page (struct server *s) { gtk_table_attach_defaults (GTK_TABLE (table), label, 3, 4, 0, 1); gtk_widget_show (label); - label = gtk_label_new ("Host Name:"); + label = gtk_label_new (_("Host Name:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2); gtk_widget_show (label); @@ -356,7 +363,7 @@ static GtkWidget *server_info_page (struct server *s) { gtk_widget_show (label); } - label = gtk_label_new ("Refreshed:"); + label = gtk_label_new (_("Refreshed:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 2, 3); gtk_widget_show (label); @@ -378,7 +385,7 @@ static GtkWidget *server_info_page (struct server *s) { /* Sources */ - frame = gtk_frame_new ("Sources"); + frame = gtk_frame_new (_("Sources")); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN); gtk_box_pack_start (GTK_BOX (page_vbox), frame, FALSE, FALSE, 0); @@ -430,7 +437,7 @@ static GtkWidget *server_info_page (struct server *s) { gtk_box_pack_end (GTK_BOX (hbox), customcfg_combo, FALSE, FALSE, 0); gtk_widget_show (customcfg_combo); - label = gtk_label_new ("Custom CFG:"); + label = gtk_label_new (_("Custom CFG:")); gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); @@ -479,21 +486,21 @@ static GtkWidget *server_passwords_page (struct server *s) { gtk_table_set_col_spacings (GTK_TABLE (table), 8); gtk_box_pack_start (GTK_BOX (page_vbox), table, FALSE, FALSE, 0); - password_entry = passwd_entry ("Server Password", + password_entry = passwd_entry (_("Server Password"), (props)? props->server_password : NULL, table, 0); if ((games[s->type].flags & GAME_PASSWORD) == 0) gtk_widget_set_sensitive (password_entry, FALSE); - spectator_entry = passwd_entry ("Spectator Password", + spectator_entry = passwd_entry (_("Spectator Password"), (props)? props->spectator_password : NULL, table, 1); if ((games[s->type].flags & GAME_SPECTATE) == 0) gtk_widget_set_sensitive (spectator_entry, FALSE); - rcon_entry = passwd_entry ("RCon Password", + rcon_entry = passwd_entry (_("RCon Password"), (props)? props->rcon_password : NULL, table, 2); @@ -520,7 +527,7 @@ void properties_dialog (struct server *s) { GtkWidget *label; char buf[256]; - window = dialog_create_modal_transient_window ("Properties", + window = dialog_create_modal_transient_window (_("Properties"), TRUE, FALSE, NULL); main_vbox = gtk_vbox_new (FALSE, 8); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 8); @@ -565,12 +572,12 @@ void properties_dialog (struct server *s) { gtk_box_pack_start (GTK_BOX (main_vbox), notebook, FALSE, FALSE, 0); page = server_info_page (s); - label = gtk_label_new (" Info "); + label = gtk_label_new (_("Info")); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); page = server_passwords_page (s); - label = gtk_label_new (" Passwords "); + label = gtk_label_new (_("Passwords")); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); @@ -585,7 +592,7 @@ void properties_dialog (struct server *s) { hbox = gtk_hbox_new (FALSE, 8); gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0); - button = gtk_button_new_with_label ("Cancel"); + button = gtk_button_new_with_label (_("Cancel")); gtk_widget_set_usize (button, 80, -1); gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", @@ -593,7 +600,7 @@ void properties_dialog (struct server *s) { GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_show (button); - button = gtk_button_new_with_label ("OK"); + button = gtk_button_new_with_label (_("OK")); gtk_widget_set_usize (button, 80, -1); gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "clicked", diff --git a/xqf/src/stat.c b/xqf/src/stat.c index 447c41f..0085861 100644 --- a/xqf/src/stat.c +++ b/xqf/src/stat.c @@ -44,6 +44,14 @@ #include "dns.h" #include "debug.h" +#ifdef ENABLE_NLS +#include +#define _(string) gettext(string) +#else +#define _(string) (string) +#endif + + static void stat_next (struct stat_job *job); @@ -851,7 +859,7 @@ static struct stat_conn *stat_open_conn_qstat (struct stat_job *job) { f = fopen (fn, "w"); if (!f) { - dialog_ok (NULL, "Failed to create a temporary file %s", fn); + dialog_ok (NULL, _("Failed to create a temporary file %s"), fn); return NULL; } diff --git a/xqf/src/statistics.c b/xqf/src/statistics.c index 0ae67c0..aae0931 100644 --- a/xqf/src/statistics.c +++ b/xqf/src/statistics.c @@ -37,13 +37,21 @@ #include "config.h" #include "statistics.h" +#ifdef ENABLE_NLS +#include +#define _(string) gettext(string) +#define N_(string) (string) +#else +#define _(string) (string) +#endif + #define PERCENTS(A,B) ((B)? (A)/((B)/100.0) : 0) - #define OS_NUM 5 #define CPU_NUM 5 + enum OS { OS_WINDOWS = 0, OS_LINUX, OS_SOLARIS, OS_MACOS, OS_UNKNOWN }; enum CPU { CPU_X86 = 0, CPU_SPARC, CPU_AXP, CPU_PPC, CPU_UNKNOWN }; @@ -64,19 +72,19 @@ struct arch_stats { static const char *srv_headers[6] = { - "Servers", "Up", "T/O", "Down", "Info n/a", "Players" + N_("Servers"), N_("Up"), N_("T/O"), N_("Down"), N_("Info n/a"), N_("Players") }; static const char *os_names[OS_NUM] = { - "Windows", "Linux", "Solaris", "MacOS", "unknown" + "Windows", "Linux", "Solaris", "MacOS", N_("unknown") }; static const char *cpu_names[CPU_NUM] = { - "Intel x86", "Sparc", "AXP", "PPC", "unknown" + "Intel x86", "Sparc", "AXP", "PPC", N_("unknown") }; -const char *srv_label = "Servers"; -const char *arch_label = "OS/CPU"; +const char *srv_label = N_("Servers"); +const char *arch_label = N_("OS/CPU"); static struct server_stats *srv_stats; @@ -329,7 +337,7 @@ static GtkWidget *server_stats_page (void) { gtk_table_set_row_spacing (GTK_TABLE (table), GAMES_TOTAL, 12); for (i = 0; i < 6; i++) - put_label_to_table (table, srv_headers[i], 1.0, i + 1, 0); + put_label_to_table (table, _(srv_headers[i]), 1.0, i + 1, 0); for (i = 0; i < GAMES_TOTAL; i++) { game_label = game_pixmap_with_label (i); @@ -349,7 +357,7 @@ static GtkWidget *server_stats_page (void) { } } - put_label_to_table (table, "Total", 0.0, 0, GAMES_TOTAL + 1); + put_label_to_table (table, _("Total"), 0.0, 0, GAMES_TOTAL + 1); put_server_stats (table, 0, GAMES_TOTAL + 1); @@ -392,17 +400,17 @@ static void arch_notebook_page (GtkWidget *notebook, gtk_table_set_col_spacing (GTK_TABLE (table), OS_NUM, 20); gtk_table_set_row_spacing (GTK_TABLE (table), CPU_NUM, 12); - put_label_to_table (table, "CPU \\ OS", 0.5, 0, 0); + put_label_to_table (table, _("CPU \\ OS"), 0.5, 0, 0); for (i = 0; i < OS_NUM; i++) { - put_label_to_table (table, os_names[i], 1.0, i + 1, 0); + put_label_to_table (table, _(os_names[i]), 1.0, i + 1, 0); } - put_label_to_table (table, "Total", 1.0, OS_NUM + 1, 0); + put_label_to_table (table, _("Total"), 1.0, OS_NUM + 1, 0); for (i = 0; i < CPU_NUM; i++) { - put_label_to_table (table, cpu_names[i], 0.0, 0, i + 1); + put_label_to_table (table, _(cpu_names[i]), 0.0, 0, i + 1); } - put_label_to_table (table, "Total", 0.0, 0, CPU_NUM + 1); + put_label_to_table (table, _("Total"), 0.0, 0, CPU_NUM + 1); for (j = 0; j < CPU_NUM; j++) { cpu_total = 0; @@ -498,13 +506,13 @@ void statistics_dialog (void) { server_stats_create (); collect_statistics (); - window = dialog_create_modal_transient_window ("Statistics", + window = dialog_create_modal_transient_window (_("Statistics"), TRUE, FALSE, NULL); main_vbox = gtk_vbox_new (FALSE, 8); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 8); gtk_container_add (GTK_CONTAINER (window), main_vbox); - label = gtk_label_new ("Statistics"); + label = gtk_label_new (_("Statistics")); gtk_box_pack_start (GTK_BOX (main_vbox), label, FALSE, FALSE, 8); gtk_widget_show (label); @@ -514,12 +522,12 @@ void statistics_dialog (void) { gtk_box_pack_start (GTK_BOX (main_vbox), stat_notebook, FALSE, FALSE, 0); page = server_stats_page (); - label = gtk_label_new (srv_label); + label = gtk_label_new (_(srv_label)); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (stat_notebook), page, label); page = archs_stats_page (); - label = gtk_label_new (arch_label); + label = gtk_label_new (_(arch_label)); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (stat_notebook), page, label); @@ -538,7 +546,7 @@ void statistics_dialog (void) { hbox = gtk_hbox_new (FALSE, 8); gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0); - button = gtk_button_new_with_label ("Close"); + button = gtk_button_new_with_label (_("Close")); gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_widget_set_usize (button, 80, -1); gtk_signal_connect (GTK_OBJECT (button), "clicked", diff --git a/xqf/src/xqf.c b/xqf/src/xqf.c index 363c6e0..6753c9f 100644 --- a/xqf/src/xqf.c +++ b/xqf/src/xqf.c @@ -56,6 +56,15 @@ #include "menus.h" #include "config.h" +#ifdef ENABLE_NLS +#include +#include +#define _(string) gettext(string) +#define N_(string) (string) +#else +#define _(string) (string) +#endif + #include "debug.h" time_t xqf_start_time; @@ -476,19 +485,19 @@ static void stat_lists_state_handler (struct stat_job *job, switch (state) { case STAT_UPDATE_SOURCE: - progress_bar_str = "Updating lists..."; + progress_bar_str = _("Updating lists..."); break; case STAT_RESOLVE_NAMES: - progress_bar_str = "Resolving host names: %d/%d"; + progress_bar_str = _("Resolving host names: %d/%d"); break; case STAT_REFRESH_SERVERS: - progress_bar_str = "Refreshing: %d/%d"; + progress_bar_str = _("Refreshing: %d/%d"); break; case STAT_RESOLVE_HOSTS: - progress_bar_str = "Resolving host addresses: %d/%d"; + progress_bar_str = _("Resolving host addresses: %d/%d"); break; default: @@ -513,7 +522,7 @@ static void stat_lists_close_handler (struct stat_job *job, int killed) { server_clist_build_filtered (cur_server_list, TRUE); } - print_status (main_status_bar, "Done."); + print_status (main_status_bar, _("Done.")); progress_bar_reset (main_progress_bar); @@ -606,8 +615,8 @@ static void launch_close_handler (struct stat_job *job, int killed) { props = properties (s); if (s->ping >= MAX_PING) { - launch = dialog_yesno (NULL, 1, "Launch", "Cancel", - "Server %s:%d is %s.\n\nLaunch client anyway?", + launch = dialog_yesno (NULL, 1, _("Launch"), _("Cancel"), + _("Server %s:%d is %s.\n\nLaunch client anyway?"), (s->host->name)? s->host->name : inet_ntoa (s->host->ip), s->port, (s->ping == MAX_PING)? "unreachable" : "down"); @@ -618,8 +627,8 @@ static void launch_close_handler (struct stat_job *job, int killed) { } if (!launch && s->curplayers >= s->maxplayers && !con->spectate) { - launch = dialog_yesno (NULL, 1, "Launch", "Cancel", - "Server %s:%d is full.\n\nLaunch client anyway?", + launch = dialog_yesno (NULL, 1, _("Launch"), _("Cancel"), + _("Server %s:%d is full.\n\nLaunch client anyway?"), (s->host->name)? s->host->name : inet_ntoa (s->host->ip), s->port); if (!launch) { @@ -638,7 +647,7 @@ static void launch_close_handler (struct stat_job *job, int killed) { } else { con->spectator_password = enter_string_with_option_dialog (FALSE, - "Save Password", &save, "Spectator Password:"); + _("Save Password"), &save, _("Spectator Password:")); if (!con->spectator_password) { condef_free (con); return; @@ -658,7 +667,7 @@ static void launch_close_handler (struct stat_job *job, int killed) { } else if ((s->flags & SERVER_PASSWORD) != 0) { con->password = enter_string_with_option_dialog (FALSE, - "Save Password", &save, "Server Password:"); + _("Save Password"), &save, _("Server Password:")); if (!con->password) { condef_free (con); return; @@ -791,11 +800,11 @@ static void launch_callback (GtkWidget *widget, enum launch_mode mode) { return; if ((games[cur_server->type].flags & GAME_SPECTATE) != 0) { - demo = enter_string_with_option_dialog (TRUE, "Spectator", &spectate, - "Demo name:"); + demo = enter_string_with_option_dialog (TRUE, _("Spectator"), &spectate, + _("Demo name:")); } else { - demo = enter_string_dialog (TRUE, "Demo name:"); + demo = enter_string_dialog (TRUE, _("Demo name:")); } if (!demo) @@ -995,7 +1004,7 @@ static void add_server_name_handler (struct stat_job *job, struct userver *us, } else { progress_bar_reset (main_progress_bar); - dialog_ok (NULL, "Host %s not found", us->hostname); + dialog_ok (NULL, _("Host %s not found"), us->hostname); } } @@ -1019,7 +1028,7 @@ static void add_server_callback (GtkWidget *widget, gpointer data) { return; if (!parse_address (str, &addr, &port)) { - dialog_ok (NULL, "\"%s\" is not valid host[:port] combination.", str); + dialog_ok (NULL, _("\"%s\" is not valid host[:port] combination."), str); g_free (str); return; } @@ -1180,7 +1189,7 @@ static void add_master_callback (GtkWidget *widget, gpointer data) { source_ctree_select_source (m); } else { - dialog_ok (NULL, "Master address \"%s\" is not valid.", str); + dialog_ok (NULL, _("Master address \"%s\" is not valid."), str); } g_free (str); @@ -1223,8 +1232,9 @@ static void del_master_callback (GtkWidget *widget, gpointer data) { if (!masters) return; - delete = dialog_yesno (NULL, 1, "Delete", "Cancel", - "Master%s to delete:\n\n%s", (g_slist_length (masters) > 1)? "s" : "", + delete = dialog_yesno (NULL, 1, _("Delete"), _("Cancel"), + _("Master%s to delete:\n\n%s"), + (g_slist_length (masters) > 1)? "s" : "", master_names); if (delete) { @@ -1246,7 +1256,7 @@ static void find_player_callback (GtkWidget *widget, int find_next) { if (find_next || find_player_dialog ()) { if (!psearch_data_is_empty ()) { pattern = psearch_lookup_pattern (); - print_status (main_status_bar, "Find Player: %s", pattern); + print_status (main_status_bar, _("Find Player: %s"), pattern); g_free (pattern); find_player (find_next); @@ -1346,7 +1356,7 @@ static void rcon_callback (GtkWidget *widget, gpointer data) { if (!sp || !sp->rcon_password) { passwd = enter_string_with_option_dialog (FALSE, - "Save Password", &save, "Server Password:"); + _("Save Password"), &save, _("Server Password:")); if (!passwd) /* canceled */ return; @@ -1469,7 +1479,7 @@ static void source_selection_changed (void) { server_clist_set_list (cur_server_list); print_status (main_status_bar, (server_clist->rows == 1) ? - "%d server" : "%d servers", server_clist->rows); + _("%d server") : _("%d servers"), server_clist->rows); } @@ -1612,14 +1622,14 @@ static void statistics_callback (GtkWidget *widget, gpointer data) { static void about_dialog (GtkWidget *widget, gpointer data) { - dialog_ok ("About XQF", - "X11 Quake/QuakeWorld/Quake2/Quake3 Front-End\n" - "Version " XQF_VERSION "\n\n" - "Copyright (C) 1998-2000 Roman Pozlevich \n\n" + dialog_ok (_("About XQF"), + _("X11 Quake/QuakeWorld/Quake2/Quake3 Front-End\n" + "Version %s\n\n" + "Copyright (C) 1998-2001 Roman Pozlevich \n\n" "Mod & server version filter: Bill Adams \n" - "SoF & GameSpy master support: Alex Burger \n\n" - - "http://www.linuxgames.com/xqf/"); + "SoF & GameSpy master support: Alex Burger \n" + "Internationalization (i18n): Jordi Mallach \n\n" + "http://www.linuxgames.com/xqf/"), XQF_VERSION); } @@ -1637,17 +1647,17 @@ struct __menuitem { static const struct menuitem srvopt_menu_items[] = { { - MENU_ITEM, "Connect", 0, 0, + MENU_ITEM, N_("Connect"), 0, 0, GTK_SIGNAL_FUNC (launch_callback), (gpointer) LAUNCH_NORMAL, &connect_menu_item }, { - MENU_ITEM, "Observe", 0, 0, + MENU_ITEM, N_("Observe"), 0, 0, GTK_SIGNAL_FUNC (launch_callback), (gpointer) LAUNCH_SPECTATE, &observe_menu_item }, { - MENU_ITEM, "Record Demo", 0, 0, + MENU_ITEM, N_("Record Demo"), 0, 0, GTK_SIGNAL_FUNC (launch_callback), (gpointer) LAUNCH_RECORD, &record_menu_item }, @@ -1655,27 +1665,27 @@ static const struct menuitem srvopt_menu_items[] = { { MENU_SEPARATOR, NULL, 0, 0, NULL, NULL, NULL }, { - MENU_ITEM, "Add to Favorites", 0, 0, + MENU_ITEM, N_("Add to Favorites"), 0, 0, GTK_SIGNAL_FUNC (add_to_favorites_callback), NULL, &favadd_menu_item }, { - MENU_ITEM, "Add...", 0, 0, + MENU_ITEM, N_("Add..."), 0, 0, GTK_SIGNAL_FUNC (add_server_callback), NULL, &add_menu_item }, { - MENU_ITEM, "Delete", 0, 0, + MENU_ITEM, N_("Delete"), 0, 0, GTK_SIGNAL_FUNC (del_server_callback), NULL, &delete_menu_item }, { - MENU_ITEM, "Copy", 0, 0, + MENU_ITEM, N_("Copy"), 0, 0, GTK_SIGNAL_FUNC (copy_server_callback), NULL, NULL }, { - MENU_ITEM, "Copy+", 0, 0, + MENU_ITEM, N_("Copy+"), 0, 0, GTK_SIGNAL_FUNC (copy_server_callback_plus), NULL, NULL }, @@ -1683,12 +1693,12 @@ static const struct menuitem srvopt_menu_items[] = { { MENU_SEPARATOR, NULL, 0, 0, NULL, NULL, NULL }, { - MENU_ITEM, "Refresh", 0, 0, + MENU_ITEM, N_("Refresh"), 0, 0, GTK_SIGNAL_FUNC (refresh_callback), NULL, &refresh_menu_item }, { - MENU_ITEM, "Refresh Selected", 0, 0, + MENU_ITEM, N_("Refresh Selected"), 0, 0, GTK_SIGNAL_FUNC (refresh_selected_callback), NULL, &refrsel_menu_item }, @@ -1696,7 +1706,7 @@ static const struct menuitem srvopt_menu_items[] = { { MENU_SEPARATOR, NULL, 0, 0, NULL, NULL, NULL }, { - MENU_ITEM, "DNS Lookup", 0, 0, + MENU_ITEM, N_("DNS Lookup"), 0, 0, GTK_SIGNAL_FUNC (resolve_callback), NULL, &resolve_menu_item }, @@ -1704,12 +1714,12 @@ static const struct menuitem srvopt_menu_items[] = { { MENU_SEPARATOR, NULL, 0, 0, NULL, NULL, NULL }, { - MENU_ITEM, "RCon...", 0, 0, + MENU_ITEM, N_("RCon..."), 0, 0, GTK_SIGNAL_FUNC (rcon_callback), NULL, &rcon_menu_item }, { - MENU_ITEM, "Properties...", 0, 0, + MENU_ITEM, N_("Properties..."), 0, 0, GTK_SIGNAL_FUNC (properties_callback), NULL, &properties_menu_item }, @@ -1719,7 +1729,7 @@ static const struct menuitem srvopt_menu_items[] = { static const struct menuitem file_menu_items[] = { { - MENU_ITEM, "_Statistics...", 0, 0, + MENU_ITEM, N_("_Statistics..."), 0, 0, GTK_SIGNAL_FUNC (statistics_callback), NULL, &file_statistics_menu_item }, @@ -1727,7 +1737,7 @@ static const struct menuitem file_menu_items[] = { { MENU_SEPARATOR, NULL, 0, 0, NULL, NULL, NULL }, { - MENU_ITEM, "_Exit", 'Q', GDK_CONTROL_MASK, + MENU_ITEM, N_("_Exit"), 'Q', GDK_CONTROL_MASK, NULL, NULL, &file_quit_menu_item }, @@ -1737,22 +1747,22 @@ static const struct menuitem file_menu_items[] = { static const struct menuitem edit_menu_items[] = { { - MENU_ITEM, "_Add Server...", 'N', GDK_CONTROL_MASK, + MENU_ITEM, N_("_Add Server..."), 'N', GDK_CONTROL_MASK, GTK_SIGNAL_FUNC (add_server_callback), NULL, &edit_add_menu_item }, { - MENU_ITEM, "_Delete", 'D', GDK_CONTROL_MASK, + MENU_ITEM, N_("_Delete"), 'D', GDK_CONTROL_MASK, GTK_SIGNAL_FUNC (del_server_callback), NULL, &edit_delete_menu_item }, { - MENU_ITEM, "_Copy", 'C', GDK_CONTROL_MASK, + MENU_ITEM, N_("_Copy"), 'C', GDK_CONTROL_MASK, GTK_SIGNAL_FUNC (copy_server_callback), NULL, NULL }, { - MENU_ITEM, "_Copy+", 'O', GDK_CONTROL_MASK, + MENU_ITEM, N_("_Copy+"), 'O', GDK_CONTROL_MASK, GTK_SIGNAL_FUNC (copy_server_callback_plus), NULL, NULL }, @@ -1760,12 +1770,12 @@ static const struct menuitem edit_menu_items[] = { { MENU_SEPARATOR, NULL, 0, 0, NULL, NULL, NULL }, { - MENU_ITEM, "Add _Master...", 'M', GDK_CONTROL_MASK, + MENU_ITEM, N_("Add _Master..."), 'M', GDK_CONTROL_MASK, GTK_SIGNAL_FUNC (add_master_callback), NULL, &edit_add_master_menu_item }, { - MENU_ITEM, "D_elete Master", 0, 0, + MENU_ITEM, N_("D_elete Master"), 0, 0, GTK_SIGNAL_FUNC (del_master_callback), NULL, &edit_delete_master_menu_item }, @@ -1773,12 +1783,12 @@ static const struct menuitem edit_menu_items[] = { { MENU_SEPARATOR, NULL, 0, 0, NULL, NULL, NULL }, { - MENU_ITEM, "_Find Player...", 'F', GDK_CONTROL_MASK, + MENU_ITEM, N_("_Find Player..."), 'F', GDK_CONTROL_MASK, GTK_SIGNAL_FUNC (find_player_callback), (gpointer) FALSE, &edit_find_player_menu_item }, { - MENU_ITEM, "Find A_gain", 'G', GDK_CONTROL_MASK, + MENU_ITEM, N_("Find A_gain"), 'G', GDK_CONTROL_MASK, GTK_SIGNAL_FUNC (find_player_callback), (gpointer) TRUE, &edit_find_again_menu_item }, @@ -1788,17 +1798,17 @@ static const struct menuitem edit_menu_items[] = { static const struct menuitem view_menu_items[] = { { - MENU_ITEM, "_Refresh", 'R', GDK_CONTROL_MASK, + MENU_ITEM, N_("_Refresh"), 'R', GDK_CONTROL_MASK, GTK_SIGNAL_FUNC (refresh_callback), NULL, &view_refresh_menu_item }, { - MENU_ITEM, "Refresh _Selected", 'S', GDK_CONTROL_MASK, + MENU_ITEM, N_("Refresh _Selected"), 'S', GDK_CONTROL_MASK, GTK_SIGNAL_FUNC (refresh_selected_callback), NULL, &view_refrsel_menu_item }, { - MENU_ITEM, "_Update From Master", 'U', GDK_CONTROL_MASK, + MENU_ITEM, N_("_Update From Master"), 'U', GDK_CONTROL_MASK, GTK_SIGNAL_FUNC (update_source_callback), NULL, &view_update_menu_item }, @@ -1806,12 +1816,12 @@ static const struct menuitem view_menu_items[] = { { MENU_SEPARATOR, NULL, 0, 0, NULL, NULL, NULL }, { - MENU_CHECK_ITEM, "Show _Host Names", 'H', GDK_CONTROL_MASK, + MENU_CHECK_ITEM, N_("Show _Host Names"), 'H', GDK_CONTROL_MASK, GTK_SIGNAL_FUNC (show_hostnames_callback), NULL, &view_hostnames_menu_item }, { - MENU_CHECK_ITEM, "Show Default _Port", 0, 0, + MENU_CHECK_ITEM, N_("Show Default _Port"), 0, 0, GTK_SIGNAL_FUNC (show_default_port_callback), NULL, &view_defport_menu_item }, @@ -1833,7 +1843,7 @@ struct menuitem *server_filter_menu_items; /* Bad Bill! The const has been removed from the next line. */ static struct menuitem server_menu_items[] = { { - MENU_BRANCH, "_Server Filters", 0, 0, + MENU_BRANCH, N_("_Server Filters"), 0, 0, NULL, NULL, /* <-- This gets set to the addres of server_filter_menu_items after @@ -1841,17 +1851,17 @@ static struct menuitem server_menu_items[] = { NULL }, { - MENU_ITEM, "_Connect", 0, 0, + MENU_ITEM, N_("_Connect"), 0, 0, GTK_SIGNAL_FUNC (launch_callback), (gpointer) LAUNCH_NORMAL, &server_connect_menu_item }, { - MENU_ITEM, "_Observe", 0, 0, + MENU_ITEM, N_("_Observe"), 0, 0, GTK_SIGNAL_FUNC (launch_callback), (gpointer) LAUNCH_SPECTATE, &server_observe_menu_item }, { - MENU_ITEM, "Record _Demo", 0, 0, + MENU_ITEM, N_("Record _Demo"), 0, 0, GTK_SIGNAL_FUNC (launch_callback), (gpointer) LAUNCH_RECORD, &server_record_menu_item }, @@ -1859,18 +1869,18 @@ static struct menuitem server_menu_items[] = { { MENU_SEPARATOR, NULL, 0, 0, NULL, NULL, NULL }, { - MENU_ITEM, "Add to _Favorites", 0, 0, + MENU_ITEM, N_("Add to _Favorites"), 0, 0, GTK_SIGNAL_FUNC (add_to_favorites_callback), NULL, &server_favadd_menu_item }, { - MENU_ITEM, "Delete", 0, 0, + MENU_ITEM, N_("Delete"), 0, 0, GTK_SIGNAL_FUNC (del_server_callback), NULL, &delete_menu_item }, { - MENU_ITEM, "DNS _Lookup", 'L', GDK_CONTROL_MASK, + MENU_ITEM, N_("DNS _Lookup"), 'L', GDK_CONTROL_MASK, GTK_SIGNAL_FUNC (resolve_callback), NULL, &server_resolve_menu_item }, @@ -1878,12 +1888,12 @@ static struct menuitem server_menu_items[] = { { MENU_SEPARATOR, NULL, 0, 0, NULL, NULL, NULL }, { - MENU_ITEM, "_RCon...", 0, 0, + MENU_ITEM, N_("_RCon..."), 0, 0, GTK_SIGNAL_FUNC (rcon_callback), NULL, &server_rcon_menu_item }, { - MENU_ITEM, "_Properties...", 0, 0, + MENU_ITEM, N_("_Properties..."), 0, 0, GTK_SIGNAL_FUNC (properties_callback), NULL, &server_properties_menu_item }, @@ -1893,31 +1903,31 @@ static struct menuitem server_menu_items[] = { static const struct menuitem preferences_menu_items[] = { { - MENU_ITEM, "_Player Profile...", 0, 0, + MENU_ITEM, N_("_Player Profile..."), 0, 0, GTK_SIGNAL_FUNC (start_preferences_dialog), (gpointer) (PREF_PAGE_PLAYER + UNKNOWN_SERVER * 256), NULL }, { - MENU_ITEM, "_Games...", 0, 0, + MENU_ITEM, N_("_Games..."), 0, 0, GTK_SIGNAL_FUNC (start_preferences_dialog), (gpointer) (PREF_PAGE_GAMES + UNKNOWN_SERVER * 256), NULL }, { - MENU_ITEM, "_Appearance...", 0, 0, + MENU_ITEM, N_("_Appearance..."), 0, 0, GTK_SIGNAL_FUNC (start_preferences_dialog), (gpointer) (PREF_PAGE_APPEARANCE + UNKNOWN_SERVER * 256), NULL }, { - MENU_ITEM, "_QStat Options...", 0, 0, + MENU_ITEM, N_("_QStat Options..."), 0, 0, GTK_SIGNAL_FUNC (start_preferences_dialog), (gpointer) (PREF_PAGE_QSTAT + UNKNOWN_SERVER * 256), NULL }, { - MENU_ITEM, "_QW/Q2 Options...", 0, 0, + MENU_ITEM, N_("_QW/Q2 Options..."), 0, 0, GTK_SIGNAL_FUNC (start_preferences_dialog), (gpointer) (PREF_PAGE_QWQ2 + UNKNOWN_SERVER * 256), NULL @@ -1926,12 +1936,12 @@ static const struct menuitem preferences_menu_items[] = { { MENU_SEPARATOR, NULL, 0, 0, NULL, NULL, NULL }, { - MENU_ITEM, "_Server Filter...", 0, 0, + MENU_ITEM, N_("_Server Filter..."), 0, 0, GTK_SIGNAL_FUNC (start_filters_cfg_dialog), (gpointer) FILTER_SERVER, NULL }, { - MENU_ITEM, "Player _Filter...", 0, 0, + MENU_ITEM, N_("Player _Filter..."), 0, 0, GTK_SIGNAL_FUNC (start_filters_cfg_dialog), (gpointer) FILTER_PLAYER, NULL }, @@ -1941,7 +1951,7 @@ static const struct menuitem preferences_menu_items[] = { static const struct menuitem help_menu_items[] = { { - MENU_ITEM, "_About...", 0, 0, + MENU_ITEM, N_("_About..."), 0, 0, GTK_SIGNAL_FUNC (about_dialog), NULL, NULL }, @@ -1952,32 +1962,32 @@ static const struct menuitem help_menu_items[] = { static const struct menuitem menubar_menu_items[] = { { - MENU_BRANCH, "_File", 0, 0, + MENU_BRANCH, N_("_File"), 0, 0, NULL, &file_menu_items, NULL }, { - MENU_BRANCH, "_Edit", 0, 0, + MENU_BRANCH, N_("_Edit"), 0, 0, NULL, &edit_menu_items, NULL }, { - MENU_BRANCH, "_View", 0, 0, + MENU_BRANCH, N_("_View"), 0, 0, NULL, &view_menu_items, NULL }, { - MENU_BRANCH, "_Server", 0, 0, + MENU_BRANCH, N_("_Server"), 0, 0, NULL, &server_menu_items, NULL }, { - MENU_BRANCH, "_Preferences", 0, 0, + MENU_BRANCH, N_("_Preferences"), 0, 0, NULL, &preferences_menu_items, NULL }, { - MENU_LAST_BRANCH, "_Help", 0, 0, + MENU_LAST_BRANCH, N_("_Help"), 0, 0, NULL, &help_menu_items, NULL }, @@ -2020,28 +2030,28 @@ static GtkWidget *create_player_menu (GtkAccelGroup *accel_group) { marker_menu = gtk_menu_new (); - menu_item = create_player_menu_item ("Mark as Red", 0); + menu_item = create_player_menu_item (_("Mark as Red"), 0); gtk_menu_append (GTK_MENU (marker_menu), menu_item); gtk_signal_connect (GTK_OBJECT (menu_item), "activate", GTK_SIGNAL_FUNC (add_to_player_filter_callback), (gpointer) PLAYER_GROUP_RED); gtk_widget_show (menu_item); - menu_item = create_player_menu_item ("Mark as Green", 1); + menu_item = create_player_menu_item (_("Mark as Green"), 1); gtk_menu_append (GTK_MENU (marker_menu), menu_item); gtk_signal_connect (GTK_OBJECT (menu_item), "activate", GTK_SIGNAL_FUNC (add_to_player_filter_callback), (gpointer) PLAYER_GROUP_GREEN); gtk_widget_show (menu_item); - menu_item = create_player_menu_item ("Mark as Blue", 2); + menu_item = create_player_menu_item (_("Mark as Blue"), 2); gtk_menu_append (GTK_MENU (marker_menu), menu_item); gtk_signal_connect (GTK_OBJECT (menu_item), "activate", GTK_SIGNAL_FUNC (add_to_player_filter_callback), (gpointer) PLAYER_GROUP_BLUE); gtk_widget_show (menu_item); - menu_item = gtk_menu_item_new_with_label ("Add to Player Filter"); + menu_item = gtk_menu_item_new_with_label (_("Add to Player Filter")); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), marker_menu); gtk_menu_append (GTK_MENU (menu), menu_item); gtk_widget_show (menu_item); @@ -2062,7 +2072,7 @@ static void populate_main_toolbar (void) { gtk_widget_show (pixmap); update_button = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar), - "Update", "Update from master", NULL, + _("Update"), _("Update from master"), NULL, pixmap, GTK_SIGNAL_FUNC (update_source_callback), NULL); @@ -2070,7 +2080,7 @@ static void populate_main_toolbar (void) { gtk_widget_show (pixmap); refresh_button = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar), - "Refresh", "Refresh current list", NULL, + _("Refresh"), _("Refresh current list"), NULL, pixmap, GTK_SIGNAL_FUNC (refresh_callback), NULL); @@ -2078,7 +2088,7 @@ static void populate_main_toolbar (void) { gtk_widget_show (pixmap); refrsel_button = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar), - "Ref.Sel.", "Refresh selected servers", NULL, + _("Ref.Sel."), _("Refresh selected servers"), NULL, pixmap, GTK_SIGNAL_FUNC (refresh_selected_callback), NULL); @@ -2086,7 +2096,7 @@ static void populate_main_toolbar (void) { gtk_widget_show (pixmap); stop_button = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar), - "Stop", "Stop", NULL, + _("Stop"), _("Stop"), NULL, pixmap, GTK_SIGNAL_FUNC (stop_callback), NULL); @@ -2096,7 +2106,7 @@ static void populate_main_toolbar (void) { gtk_widget_show (pixmap); connect_button = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar), - "Connect", "Connect", NULL, + _("Connect"), _("Connect"), NULL, pixmap, GTK_SIGNAL_FUNC (launch_callback), (gpointer) LAUNCH_NORMAL); @@ -2104,7 +2114,7 @@ static void populate_main_toolbar (void) { gtk_widget_show (pixmap); observe_button = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar), - "Observe", "Observe", NULL, + _("Observe"), _("Observe"), NULL, pixmap, GTK_SIGNAL_FUNC (launch_callback), (gpointer) LAUNCH_SPECTATE); @@ -2112,7 +2122,7 @@ static void populate_main_toolbar (void) { gtk_widget_show (pixmap); record_button = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar), - "Record", "Record Demo", NULL, + _("Record"), _("Record Demo"), NULL, pixmap, GTK_SIGNAL_FUNC (launch_callback), (gpointer) LAUNCH_RECORD); @@ -2207,7 +2217,7 @@ void create_main_window (void) { i = 0; j = 0; server_filter_menu_items[i].type = MENU_ITEM; - server_filter_menu_items[i].label = "Filters"; + server_filter_menu_items[i].label = _("Filters"); server_filter_menu_items[i].accel_key = 0; server_filter_menu_items[i].accel_mods = 0; server_filter_menu_items[i].callback = NULL; @@ -2227,7 +2237,7 @@ void create_main_window (void) { /* Start of the filters */ filter_start_index = i; server_filter_menu_items[i].type = MENU_ITEM; - server_filter_menu_items[i].label = "None"; + server_filter_menu_items[i].label = _("None"); server_filter_menu_items[i].accel_key = 0; server_filter_menu_items[i].accel_mods = 0; server_filter_menu_items[i].callback = GTK_SIGNAL_FUNC (server_filter_select_callback); @@ -2462,6 +2472,12 @@ int main (int argc, char *argv[]) { int i,j; /* For parsing the command line. */ +#ifdef ENABLE_NLS + setlocale(LC_ALL, ""); + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); +#endif + set_debug_level (DEFAULT_DEBUG_LEVEL); debug (5, "main() -- Debug Level Default Set at %d", DEFAULT_DEBUG_LEVEL);