diff --git a/Makefile.cfg b/Makefile.cfg index 6d2a028..6785aee 100644 --- a/Makefile.cfg +++ b/Makefile.cfg @@ -7,6 +7,8 @@ INSTALLDIR=/usr/local/games/jugglemaster/ FFMPEG_PREFIX=/home/chunky/extras/ffmpeg #HAVE_FFMPEG=1 +# System locale directory +LOCALEDIR=/usr/share/locale # You shouldn't have to edit anything below this line diff --git a/src/aajm/Makefile b/src/aajm/Makefile index 352319f..b24685d 100644 --- a/src/aajm/Makefile +++ b/src/aajm/Makefile @@ -1,6 +1,6 @@ include ../../Makefile.cfg -CXXFLAGS+=-Wall -fsigned-char `aalib-config --cflags` -I../jmlib +CXXFLAGS+=-Wall -fsigned-char `aalib-config --cflags` -I../jmlib -DLOCALEDIR=\"$(LOCALEDIR)\" CFLAGS+=-Wall -fsigned-char `aalib-config --cflags` -I../jmlib LIBS+=`aalib-config --libs` -L../jmlib -ljm BINARY=aajm @@ -31,7 +31,10 @@ install: mkdir -p $(INSTALLDIR)/bin $(INSTALL) $(BINARY) $(INSTALLDIR)/bin $(INSTALL) aajm-remote $(INSTALLDIR)/bin + mkdir -p $(LOCALEDIR)/es_AR/LC_MESSAGES + $(INSTALL) locale/es_AR/LC_MESSAGES/aajm.mo $(LOCALEDIR)/es_AR/LC_MESSAGES/aajm.mo clean: rm -f *.o core aajm aajm-remote $(MAKE) -C ../jmlib clean + rm -f $(LOCALEDIR)/es_AR/LC_MESSAGES/aajm.mo diff --git a/src/aajm/aajm.cpp b/src/aajm/aajm.cpp index faf64eb..35b4917 100644 --- a/src/aajm/aajm.cpp +++ b/src/aajm/aajm.cpp @@ -15,6 +15,9 @@ #include "./aajm.h" +#include +#include + aa_context *context; aa_renderparams *params; JMLib* jmlib; @@ -82,7 +85,7 @@ void draw_juggler(int show_loadavg, aa_context *c, JMLib *j) { aa_imgwidth(c), aa_imgheight(c)); aa_printf(c, 0, 0, AA_SPECIAL, - "Site: %s Style: %s Balls: %i", + gettext("Site: %s Style: %s Balls: %i"), j->getSite(), j->getStyle(), j->numBalls()); if(show_loadavg) { @@ -92,7 +95,7 @@ void draw_juggler(int show_loadavg, aa_context *c, JMLib *j) { load.one, load.five, load.fifteen); } if(j->getStatus() == ST_PAUSE) { - aa_puts(c, 1, 3, AA_SPECIAL, "Paused"); + aa_puts(c, 1, 3, AA_SPECIAL, gettext("Paused")); } aa_flush(c); @@ -270,7 +273,7 @@ void main_loop(int max_iterations, int delay, memset(newsite,0,JML_MAX_SITELEN); strncpy(newsite, jmlib->getSite(), JML_MAX_SITELEN); aa_puts(context, 1, 4, AA_SPECIAL, - "Enter New SiteSwap..."); + gettext("Enter New SiteSwap...")); aa_edit(context, 1, 5, 20, newsite, JML_MAX_SITELEN); if(newsite[0]!=0) { @@ -292,7 +295,7 @@ void main_loop(int max_iterations, int delay, } else if(c=='t' || c=='T') { /* Change Style */ aa_puts(context, 3, 4, AA_SPECIAL, - "Choose New Style..."); + gettext("Choose New Style...")); for (i=0;inumStyles();i++) { aa_printf(context, 3, 5+i, AA_SPECIAL, "%i: %s",i+1,possible_styles[i]); @@ -311,31 +314,31 @@ void main_loop(int max_iterations, int delay, /* Help */ int curr_height = 4; aa_puts(context, 3, curr_height, AA_SPECIAL, - "Key Help"); + gettext("Key Help")); ++curr_height; aa_puts(context, 3, ++curr_height, AA_SPECIAL, - "h - This screen"); + gettext("h - This screen")); aa_puts(context, 3, ++curr_height, AA_SPECIAL, - "s - Change Siteswap"); + gettext("s - Change Siteswap")); aa_puts(context, 3, ++curr_height, AA_SPECIAL, - "r - Random Pattern"); + gettext("r - Random Pattern")); aa_puts(context, 3, ++curr_height, AA_SPECIAL, - "t - Change Style"); + gettext("t - Change Style")); aa_puts(context, 3, ++curr_height, AA_SPECIAL, - "l - Toggle Load Monitoring"); + gettext("l - Toggle Load Monitoring")); #ifdef HAVE_AVCODEC_H aa_puts(context, 3, ++curr_height, AA_SPECIAL, - "m - Dump MPEG"); + gettext("m - Dump MPEG")); #endif aa_puts(context, 3, ++curr_height, AA_SPECIAL, - "q - Quit"); + gettext("q - Quit")); aa_puts(context, 3, ++curr_height, AA_SPECIAL, - "space - Pause"); + gettext("space - Pause")); aa_puts(context, 3, ++curr_height, AA_SPECIAL, - "+, -, enter - Speed up, down, reset"); + gettext("+, -, enter - Speed up, down, reset")); ++curr_height; aa_puts(context, 3, ++curr_height, AA_SPECIAL, - "Press any key to remove this menu"); + gettext("Press any key to remove this menu")); aa_flush(context); aa_getkey(context, 1); } else if(c=='+' || c=='=' || c=='k') { @@ -351,7 +354,7 @@ void main_loop(int max_iterations, int delay, char mpegname[20]; memset(mpegname,0,20); aa_puts(context, 1, 4, AA_SPECIAL, - "Enter MPEG Name..."); + gettext("Enter MPEG Name...")); aa_edit(context, 1, 5, 20, mpegname, JML_MAX_SITELEN); if(mpegname[0]!=0) { @@ -500,6 +503,10 @@ int main(int argc, char **argv) { float randomizesitetime = 0; char *endptr; + setlocale(LC_ALL, ""); + bindtextdomain("aajm", LOCALEDIR); + textdomain("aajm"); + char options[] = "aljhip:n:d:m:t:s:T:S:"; static struct option long_options[] = { @@ -583,27 +590,27 @@ int main(int argc, char **argv) { } if(aahelp_flag || help_flag) { - printf("AAJM, An ASCII Art Juggling program\n"); - printf("Usage: %s [OPTIONS]\n",argv[0]); + printf(gettext("AAJM, An ASCII Art Juggling program\n")); + printf(gettext("Usage: %s [OPTIONS]\n"),argv[0]); } if(help_flag) { - printf("Jugglemaster Options:\n"); - printf(" -s, --siteswap=XX show siteswap XX (3)\n"); - printf(" -t, --style=XX use style XX (\"Normal\")\n"); - printf(" -S, --rsiteswap=XX Randomize siteswap every XX seconds (%f)\n", DEFRANDOMSITETIME); - printf(" -T, --rstyle=XX Randomize style every XX seconds (%f)\n", DEFRANDOMSTYLETIME); - printf(" -d, --delay=XX delay XX ms between frames (%i)\n", (int)DEFSPEED/1000); - printf(" -m, --maxiterations=XX do at most XX iterations\n"); - printf(" -j, --justoutput only output [don't init kb or mouse]\n"); - printf(" -i, --ipc enable IPC\n"); - printf(" -p, --port=XX use port XX for IPC (%i)\n",DEFPORT); - printf(" -l, --loadavg change speed based on load average\n"); - printf(" -n, --normalload=XX a normal load average for your machine (%2.2f)\n",DEFLOAD); - printf(" -h, --help get help [this screen]\n"); - printf(" -a, --aahelp get help on AA options\n\n"); + printf(gettext("Jugglemaster Options:\n")); + printf(gettext(" -s, --siteswap=XX show siteswap XX (3)\n")); + printf(gettext(" -t, --style=XX use style XX (\"Normal\")\n")); + printf(gettext(" -S, --rsiteswap=XX Randomize siteswap every XX seconds (%f)\n"), DEFRANDOMSITETIME); + printf(gettext(" -T, --rstyle=XX Randomize style every XX seconds (%f)\n"), DEFRANDOMSTYLETIME); + printf(gettext(" -d, --delay=XX delay XX ms between frames (%i)\n"), (int)DEFSPEED/1000); + printf(gettext(" -m, --maxiterations=XX do at most XX iterations\n")); + printf(gettext(" -j, --justoutput only output [don't init kb or mouse]\n")); + printf(gettext(" -i, --ipc enable IPC\n")); + printf(gettext(" -p, --port=XX use port XX for IPC (%i)\n"),DEFPORT); + printf(gettext(" -l, --loadavg change speed based on load average\n")); + printf(gettext(" -n, --normalload=XX a normal load average for your machine (%2.2f)\n"),DEFLOAD); + printf(gettext(" -h, --help get help [this screen]\n")); + printf(gettext(" -a, --aahelp get help on AA options\n\n")); } if(aahelp_flag) { - printf("AALib Options:\n%s\n\n",aa_help); + printf(gettext("AALib Options:\n%s\n\n"),aa_help); } if(aahelp_flag || help_flag) { return 0; @@ -612,7 +619,7 @@ int main(int argc, char **argv) { context = aa_autoinit(&aa_defparams); if (context == NULL) { - printf("Failed to initialize aalib\n"); + printf(gettext("Failed to initialize aalib\n")); exit(1); } diff --git a/src/aajm/locale/es_AR/LC_MESSAGES/aajm.mo b/src/aajm/locale/es_AR/LC_MESSAGES/aajm.mo new file mode 100644 index 0000000..751f0da Binary files /dev/null and b/src/aajm/locale/es_AR/LC_MESSAGES/aajm.mo differ diff --git a/src/aajm/locale/es_AR/LC_MESSAGES/aajm.po b/src/aajm/locale/es_AR/LC_MESSAGES/aajm.po new file mode 100644 index 0000000..d50e607 --- /dev/null +++ b/src/aajm/locale/es_AR/LC_MESSAGES/aajm.po @@ -0,0 +1,192 @@ +# Spanish translations for PACKAGE package. +# Copyright (C) 2011 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# TPI , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: aajm\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-11-10 06:54-0300\n" +"PO-Revision-Date: 2011-11-10 07:21-0300\n" +"Last-Translator: TPI\n" +"Language-Team: Argentinian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ASCII\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: aajm.cpp:600 +#, c-format +msgid " -S, --rsiteswap=XX Randomize siteswap every XX seconds (%f)\n" +msgstr "" +" -S, --rsiteswap=XX Hacer aleatorio el siteswap cada XX segundos (%" +"f)\n" + +#: aajm.cpp:601 +#, c-format +msgid " -T, --rstyle=XX Randomize style every XX seconds (%f)\n" +msgstr "" +" -T, --rstyle=XX Hacer aleatorio el estilo cada XX segundos (%" +"f)\n" + +#: aajm.cpp:610 +#, c-format +msgid "" +" -a, --aahelp get help on AA options\n" +"\n" +msgstr "" +" -a, --aahelp obtener ayuda con las opciones de AA\n" +"\n" + +#: aajm.cpp:602 +#, c-format +msgid " -d, --delay=XX delay XX ms between frames (%i)\n" +msgstr " -d, --delay=XX demora de XX ms entre frames (%i)\n" + +#: aajm.cpp:609 +#, c-format +msgid " -h, --help get help [this screen]\n" +msgstr " -h, --help mostrar la ayuda [esta pantalla]\n" + +#: aajm.cpp:605 +#, c-format +msgid " -i, --ipc enable IPC\n" +msgstr " -i, --ipc habilitar IPC\n" + +#: aajm.cpp:604 +#, c-format +msgid " -j, --justoutput only output [don't init kb or mouse]\n" +msgstr "" +" -j, --justoutput slo la salida [no inicializa teclado o mouse]\n" + +#: aajm.cpp:607 +#, c-format +msgid " -l, --loadavg change speed based on load average\n" +msgstr "" +" -l, --loadavg cambiar la velocidad basada en la carga " +"promedio\n" + +#: aajm.cpp:603 +#, c-format +msgid " -m, --maxiterations=XX do at most XX iterations\n" +msgstr " -m, --maxiterations=XX realizar a lo sumo XX iteraciones\n" + +#: aajm.cpp:608 +#, c-format +msgid "" +" -n, --normalload=XX a normal load average for your machine (%2.2f)\n" +msgstr "" +" -n, --normalload=XX una carga normal promedio para su computadora (%" +"2.2f)\n" + +#: aajm.cpp:606 +#, c-format +msgid " -p, --port=XX use port XX for IPC (%i)\n" +msgstr " -p, --port=XX usar el puerto XX para IPC (%i)\n" + +#: aajm.cpp:598 +#, c-format +msgid " -s, --siteswap=XX show siteswap XX (3)\n" +msgstr " -s, --siteswap=XX mostrar el siteswap XX (3)\n" + +#: aajm.cpp:599 +#, c-format +msgid " -t, --style=XX use style XX (\"Normal\")\n" +msgstr " -t, --style=XX usar el estilo XX (\"Normal\")\n" + +#: aajm.cpp:338 +msgid "+, -, enter - Speed up, down, reset" +msgstr "+, -, enter - Aumentar velocidad, disminuir velocidad, reinicializar" + +#: aajm.cpp:593 +#, c-format +msgid "AAJM, An ASCII Art Juggling program\n" +msgstr "AAJM, Un programa para hacer malabares hecho en ASCII Art\n" + +#: aajm.cpp:613 +#, c-format +msgid "" +"AALib Options:\n" +"%s\n" +"\n" +msgstr "" +"Opciones de AALib:\n" +"%s\n" +"\n" + +#: aajm.cpp:298 +msgid "Choose New Style..." +msgstr "Elegir nuevo estilo..." + +#: aajm.cpp:357 +msgid "Enter MPEG Name..." +msgstr "Escribir el nombre del MPEG" + +#: aajm.cpp:276 +msgid "Enter New SiteSwap..." +msgstr "Escribir el nuevo SiteSwap..." + +#: aajm.cpp:622 +#, c-format +msgid "Failed to initialize aalib\n" +msgstr "La inicializacin de aalib fall\n" + +#: aajm.cpp:597 +#, c-format +msgid "Jugglemaster Options:\n" +msgstr "Opciones de Jugglemaster:\n" + +#: aajm.cpp:317 +msgid "Key Help" +msgstr "Ayuda - Teclas" + +#: aajm.cpp:98 +msgid "Paused" +msgstr "En pausa" + +#: aajm.cpp:341 +msgid "Press any key to remove this menu" +msgstr "Presione cualquier tecla para cerrar este men" + +#: aajm.cpp:88 +#, c-format +msgid "Site: %s Style: %s Balls: %i" +msgstr "Sitio: %s Estilo: %s Pelotas: %i" + +#: aajm.cpp:594 +#, c-format +msgid "Usage: %s [OPTIONS]\n" +msgstr "Uso: %s [OPTIONS]\n" + +#: aajm.cpp:320 +msgid "h - This screen" +msgstr "h - esta pantalla" + +#: aajm.cpp:328 +msgid "l - Toggle Load Monitoring" +msgstr "l - Activar/desactivar monitoreo de carga" + +#: aajm.cpp:331 +msgid "m - Dump MPEG" +msgstr "m - Exportar a MPEG" + +#: aajm.cpp:334 +msgid "q - Quit" +msgstr "q - Salir" + +#: aajm.cpp:324 +msgid "r - Random Pattern" +msgstr "r - Patrn aleatorio" + +#: aajm.cpp:322 +msgid "s - Change Siteswap" +msgstr "s - Cambiar Siteswap" + +#: aajm.cpp:336 +msgid "space - Pause" +msgstr "space - Pausa" + +#: aajm.cpp:326 +msgid "t - Change Style" +msgstr "t - Cambiar estilo" diff --git a/src/aajm/locale/es_AR/LC_MESSAGES/aajm.pot b/src/aajm/locale/es_AR/LC_MESSAGES/aajm.pot new file mode 100644 index 0000000..a863ddb --- /dev/null +++ b/src/aajm/locale/es_AR/LC_MESSAGES/aajm.pot @@ -0,0 +1,183 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-11-10 06:54-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: aajm.cpp:600 +#, c-format +msgid " -S, --rsiteswap=XX Randomize siteswap every XX seconds (%f)\n" +msgstr " -S, --rsiteswap=XX Hacer aleatorio el siteswap cada XX segundos (%f)" + +#: aajm.cpp:601 +#, c-format +msgid " -T, --rstyle=XX Randomize style every XX seconds (%f)\n" +msgstr " -T, --rstyle=XX Hacer aleatorio el estilo cada XX segundos (%f)\n" + +#: aajm.cpp:610 +#, c-format +msgid "" +" -a, --aahelp get help on AA options\n" +"\n" +msgstr " -a, --aahelp obtener ayuda con las opciones de AA\n" +"\n" + +#: aajm.cpp:602 +#, c-format +msgid " -d, --delay=XX delay XX ms between frames (%i)\n" +msgstr " -d, --delay=XX demora de XX ms entre frames (%i)\n" + +#: aajm.cpp:609 +#, c-format +msgid " -h, --help get help [this screen]\n" +msgstr " -h, --help mostrar la ayuda [esta pantalla]\n" + +#: aajm.cpp:605 +#, c-format +msgid " -i, --ipc enable IPC\n" +msgstr " -i, --ipc habilitar IPC\n" + +#: aajm.cpp:604 +#, c-format +msgid " -j, --justoutput only output [don't init kb or mouse]\n" +msgstr " -j, --justoutput sólo la salida [no inicializa teclado o mouse]\n" + +#: aajm.cpp:607 +#, c-format +msgid " -l, --loadavg change speed based on load average\n" +msgstr " -l, --loadavg cambiar la velocidad basada en la carga promedio\n" + +#: aajm.cpp:603 +#, c-format +msgid " -m, --maxiterations=XX do at most XX iterations\n" +msgstr " -m, --maxiterations=XX realizar a lo sumo XX iteraciones\n" + +#: aajm.cpp:608 +#, c-format +msgid "" +" -n, --normalload=XX a normal load average for your machine (%2.2f)\n" +msgstr "" +" -n, --normalload=XX una carga normal promedio para su computadora (%2.2f)\n" + +#: aajm.cpp:606 +#, c-format +msgid " -p, --port=XX use port XX for IPC (%i)\n" +msgstr " -p, --port=XX usar el puerto XX para IPC (%i)\n" + +#: aajm.cpp:598 +#, c-format +msgid " -s, --siteswap=XX show siteswap XX (3)\n" +msgstr " -s, --siteswap=XX mostrar el siteswap XX (3)\n" + +#: aajm.cpp:599 +#, c-format +msgid " -t, --style=XX use style XX (\"Normal\")\n" +msgstr " -t, --style=XX usar el estilo XX (\"Normal\")\n" + +#: aajm.cpp:338 +msgid "+, -, enter - Speed up, down, reset" +msgstr "+, -, enter - Aumentar velocidad, disminuir velocidad, reinicializar" + +#: aajm.cpp:593 +#, c-format +msgid "AAJM, An ASCII Art Juggling program\n" +msgstr "AAJM, Un programa para hacer malabares hecho en ASCII Art\n" + +#: aajm.cpp:613 +#, c-format +msgid "" +"AALib Options:\n" +"%s\n" +"\n" +msgstr "" +"Opciones de AALib:\n" +"%s\n" +"\n" + +#: aajm.cpp:298 +msgid "Choose New Style..." +msgstr "Elegir nuevo estilo..." + +#: aajm.cpp:357 +msgid "Enter MPEG Name..." +msgstr "Escribir el nombre del MPEG" + +#: aajm.cpp:276 +msgid "Enter New SiteSwap..." +msgstr "Escribir el nuevo SiteSwap..." + +#: aajm.cpp:622 +#, c-format +msgid "Failed to initialize aalib\n" +msgstr "La inicialización de aalib falló\n" + +#: aajm.cpp:597 +#, c-format +msgid "Jugglemaster Options:\n" +msgstr "Opciones de Jugglemaster:\n" + +#: aajm.cpp:317 +msgid "Key Help" +msgstr "Ayuda - Teclas" + +#: aajm.cpp:98 +msgid "Paused" +msgstr "En pausa" + +#: aajm.cpp:341 +msgid "Press any key to remove this menu" +msgstr "Presione cualquier tecla para cerrar este menú" + +#: aajm.cpp:88 +#, c-format +msgid "Site: %s Style: %s Balls: %i" +msgstr "Sitio: %s Estilo: %s Pelotas: %i" + +#: aajm.cpp:594 +#, c-format +msgid "Usage: %s [OPTIONS]\n" +msgstr "Uso: %s [OPTIONS]\n" + +#: aajm.cpp:320 +msgid "h - This screen" +msgstr "h - esta pantalla" + +#: aajm.cpp:328 +msgid "l - Toggle Load Monitoring" +msgstr "l - Activar/desactivar monitoreo de carga" + +#: aajm.cpp:331 +msgid "m - Dump MPEG" +msgstr "m - Exportar a MPEG" + +#: aajm.cpp:334 +msgid "q - Quit" +msgstr "q - Salir" + +#: aajm.cpp:324 +msgid "r - Random Pattern" +msgstr "r - Patrón aleatorio" + +#: aajm.cpp:322 +msgid "s - Change Siteswap" +msgstr "s - Cambiar Siteswap" + +#: aajm.cpp:336 +msgid "space - Pause" +msgstr "space - Pausa" + +#: aajm.cpp:326 +msgid "t - Change Style" +msgstr "t - Cambiar estilo"