Re: Zaz in Debian
2009/8/25 Remigiusz Dybka <remigiusz.dybka@googlemail.com>:
> Hello,
Hi :)
> Honestly I am at the moment concentrating on getting this thing to run
> properly
> as it is. Gettextizing the project shouldn't be a problem and yes, it sounds
> like
> a nice feature for a fully grown, finished project. I can promise I will
> look into it
> as soon as bug reports stop flowing in and when the levels are done (planned
> to have at least 23 of them). That, I hope, will happen in a couple of
> weeks.
> I will check out quesoglc (i didn't even know it existed when I picked
> FTGL).
> The game is not too text-rendering orientated, so switching the engine
> (if it turns out necessary) shouldn't be a big problem.
>
> I am very happy that you packaged Zaz for Debian. I wasn't expecting
> something
> like that before months after first release.
> Guess Open Source really works
> Keep up the good work,
> Greetings,
> Rem
I'm attaching my gettext patches, pot file and initial translation
into Spanish in case you're interested :)
Greetings,
Miry
# 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 <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-08-25 01:08+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/mainmenu.cpp:31
msgid "Start game"
msgstr ""
#: src/mainmenu.cpp:33
msgid "Options"
msgstr ""
#: src/mainmenu.cpp:34
msgid "Credits"
msgstr ""
#: src/mainmenu.cpp:35
msgid "Exit"
msgstr ""
#: src/mainmenu.cpp:49
msgid "Resolution"
msgstr ""
#: src/mainmenu.cpp:50
msgid "Fullscreen"
msgstr ""
#: src/mainmenu.cpp:51
msgid "Show FPS"
msgstr ""
#: src/mainmenu.cpp:52
msgid "Mouse sensivity"
msgstr ""
#: src/mainmenu.cpp:53
msgid "SFX volume"
msgstr ""
#: src/mainmenu.cpp:54
msgid "Music volume"
msgstr ""
#: src/mainmenu.cpp:55 src/gameloop.cpp:68
msgid "Back to main menu"
msgstr ""
#: src/mainmenu.cpp:59
msgid "Back"
msgstr ""
#: src/mainmenu.cpp:242
msgid "Hall of Fame"
msgstr ""
#: src/mainmenu.cpp:268
msgid "code, gfx, snd & design:"
msgstr ""
#: src/mainmenu.cpp:269
msgid "Remigiusz Dybka"
msgstr ""
#: src/mainmenu.cpp:270
msgid "[remigiusz.dybka@gmail.com]"
msgstr ""
#: src/mainmenu.cpp:272
msgid "music:"
msgstr ""
#: src/mainmenu.cpp:273
msgid "Nine Inch Nails"
msgstr ""
#: src/mainmenu.cpp:274
msgid ""
"[http://nin.com] Released under Creative Commons Attribution Non-Commercial "
"Share Alike License"
msgstr ""
#: src/gameloop.cpp:56 src/gameloop.cpp:62
msgid "End game"
msgstr ""
#: src/gameloop.cpp:57
msgid "Continue"
msgstr ""
#: src/gameloop.cpp:61
msgid "Next level"
msgstr ""
#: src/gameloop.cpp:63 src/gameloop.cpp:70
msgid "View replay"
msgstr ""
#: src/gameloop.cpp:64 src/gameloop.cpp:71
msgid "Export video"
msgstr ""
#: src/gameloop.cpp:69
msgid "Restart game"
msgstr ""
#: src/gameloop.cpp:445
msgid "Game paused"
msgstr ""
#: src/gameloop.cpp:458
msgid "Level cleared"
msgstr ""
#: src/gameloop.cpp:461
#, c-format
msgid "Current score: %05d"
msgstr ""
#: src/gameloop.cpp:472
msgid "Game Over"
msgstr ""
#: src/gameloop.cpp:478
#, c-format
msgid "Score: %05d"
msgstr ""
#: src/gameloop.cpp:486
msgid "Congratulations !!! You just pwned"
msgstr ""
#: src/gameloop.cpp:511
msgid "You have a new hi score"
msgstr ""
#: src/gameloop.cpp:512
msgid "please enter your name"
msgstr ""
#: data/data/level1.lvl:1
msgid "Zatlantiz"
msgstr ""
#: data/data/level2.lvl:1
msgid "Zuza"
msgstr ""
#: data/data/level3.lvl:1
msgid "Bendlantiz"
msgstr ""
#: data/data/level4.lvl:1
msgid "You have been warned"
msgstr ""
#: data/data/level5.lvl:1
msgid "Double D"
msgstr ""
#: data/data/level6.lvl:1
msgid "SuperZaz"
msgstr ""
--- zaz-0.2.6.orig/src/Makefile.am
+++ zaz-0.2.6/src/Makefile.am
@@ -58,7 +58,9 @@
hiscores.h \
hiscores.cpp \
lineeditor.h \
- lineeditor.cpp
+ lineeditor.cpp \
+ i18n.h \
+ i18n.cpp
zaz_LDFLAGS =
--- /dev/null
+++ zaz-0.2.6/src/i18n.cpp
@@ -0,0 +1,31 @@
+// (c) 2009 Miriam Ruiz <little_miry@yahoo.es>
+//
+// This code is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This code is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+
+#include "i18n.h"
+
+#include <libintl.h>
+#include <locale.h>
+
+GetTextInit::GetTextInit()
+{
+ if (!IsInit)
+ {
+ IsInit = true;
+ setlocale (LC_MESSAGES, "");
+ setlocale (LC_CTYPE, "");
+ setlocale (LC_COLLATE, "");
+ textdomain ("zaz");
+ bindtextdomain ("zaz", NULL);
+ }
+}
+
+bool GetTextInit::IsInit = false;
--- /dev/null
+++ zaz-0.2.6/src/i18n.h
@@ -0,0 +1,29 @@
+// (c) 2009 Miriam Ruiz <little_miry@yahoo.es>
+//
+// This code is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This code is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+
+#ifndef __I18N_H__
+#define __I18N_H__
+
+#include <libintl.h>
+#define _(String) gettext (String)
+
+class GetTextInit
+{
+ protected:
+ static bool IsInit;
+ public:
+ GetTextInit();
+};
+
+static GetTextInit gettext_init;
+
+#endif // __I18N_H__
--- zaz-0.2.6.orig/src/common.h
+++ zaz-0.2.6/src/common.h
@@ -40,6 +40,7 @@
#include <FTGL/ftgl.h>
#include <GL/gl.h>
+#include "i18n.h"
#include "error.h"
#include "settings.h"
#include "hiscores.h"
--- zaz-0.2.6.orig/src/mainmenu.cpp
+++ zaz-0.2.6/src/mainmenu.cpp
@@ -28,11 +28,11 @@
renderHiscores(true), showCredits(false), oldFullscreen(settings->getb("fullscreen", false)),
oldRes(settings->get("resolution", "")), logoGpl(LoadTexture ("gpl3.png"))
{
- startMenu.Add(new GenericMenuItem("Start game", startMenuStartHandler, this));
+ startMenu.Add(new GenericMenuItem(_("Start game"), startMenuStartHandler, this));
// startMenu.Add("Practice");
- startMenu.Add(new GenericMenuItem("Options", startMenuOptionsHandler, this));
- startMenu.Add(new GenericMenuItem("Credits", startMenuCreditsHandler, this));
- startMenu.Add(new GenericMenuItem("Exit", startMenuExitHandler, this));
+ startMenu.Add(new GenericMenuItem(_("Options"), startMenuOptionsHandler, this));
+ startMenu.Add(new GenericMenuItem(_("Credits"), startMenuCreditsHandler, this));
+ startMenu.Add(new GenericMenuItem(_("Exit"), startMenuExitHandler, this));
startMenu.SetDimensions(60, 40, 40);
@@ -46,17 +46,17 @@
resolutions.push_back(sm.str());
}
- optionsMenu.Add(new OptionMenuItem("Resolution", resolutions, settings, "resolution"));
- optionsMenu.Add(new BooleanMenuItem("Fullscreen", settings, "fullscreen"));
- optionsMenu.Add(new BooleanMenuItem("Show FPS", settings, "showFps"));
- optionsMenu.Add(new ValueMenuItem("Mouse sensivity", 1, 10, settings, "mouseSensivity"));
- optionsMenu.Add(new ValueMenuItem("SFX volume", 0, 100, settings, "sfxVolume"));
- optionsMenu.Add(new ValueMenuItem("Music volume", 0, 100, settings, "musicVolume"));
- optionsMenu.Add(new GenericMenuItem("Back to main menu", optionsMenuBackHandler, this));
+ optionsMenu.Add(new OptionMenuItem(_("Resolution"), resolutions, settings, "resolution"));
+ optionsMenu.Add(new BooleanMenuItem(_("Fullscreen"), settings, "fullscreen"));
+ optionsMenu.Add(new BooleanMenuItem(_("Show FPS"), settings, "showFps"));
+ optionsMenu.Add(new ValueMenuItem(_("Mouse sensivity"), 1, 10, settings, "mouseSensivity"));
+ optionsMenu.Add(new ValueMenuItem(_("SFX volume"), 0, 100, settings, "sfxVolume"));
+ optionsMenu.Add(new ValueMenuItem(_("Music volume"), 0, 100, settings, "musicVolume"));
+ optionsMenu.Add(new GenericMenuItem(_("Back to main menu"), optionsMenuBackHandler, this));
optionsMenu.SetDimensions(55, 45, 60);
- creditsMenu.Add(new GenericMenuItem("Back", optionsMenuBackHandler, this));
+ creditsMenu.Add(new GenericMenuItem(_("Back"), optionsMenuBackHandler, this));
creditsMenu.SetDimensions(30, 10, 40);
// load the textures
@@ -239,7 +239,7 @@
glScalef(0.15f, 0.15f, 0.15f);
glColor4d(1.0, 1.0, 1.0, 1.0);
- font3->Render("Hall of Fame", -1);
+ font3->Render(_("Hall of Fame"), -1);
glPopMatrix();
float y = 35;
@@ -265,13 +265,13 @@
if (showCredits)
{
glColor4f(1.0, 1.0, 1.0, 1.0);
- CenterMsg("code, gfx, snd & design:", 46, font, 0.08);
- CenterMsg("Remigiusz Dybka", 43.5, font, 0.1);
- CenterMsg("[remigiusz.dybka@gmail.com]", 41.5, font, 0.08);
-
- CenterMsg("music:", 37, font, 0.08);
- CenterMsg("Nine Inch Nails", 34.5, font, 0.1);
- CenterMsg("[http://nin.com] Released under Creative Commons Attribution Non-Commercial Share Alike License", 32.5, font, 0.08);
+ CenterMsg(_("code, gfx, snd & design:"), 46, font, 0.08);
+ CenterMsg(_("Remigiusz Dybka"), 43.5, font, 0.1);
+ CenterMsg(_("[remigiusz.dybka@gmail.com]"), 41.5, font, 0.08);
+
+ CenterMsg(_("music:"), 37, font, 0.08);
+ CenterMsg(_("Nine Inch Nails"), 34.5, font, 0.1);
+ CenterMsg(_("[http://nin.com] Released under Creative Commons Attribution Non-Commercial Share Alike License"), 32.5, font, 0.08);
glLoadIdentity();
glEnable(GL_TEXTURE_2D);
--- zaz-0.2.6.orig/src/gameloop.cpp
+++ zaz-0.2.6/src/gameloop.cpp
@@ -53,22 +53,22 @@
}
};
- pauseMenu.Add(new GenericMenuItem("End game", pauseMenuEndGameHandler, this));
- pauseMenu.Add(new GenericMenuItem("Continue", pauseMenuContinueHandler, this));
+ pauseMenu.Add(new GenericMenuItem(_("End game"), pauseMenuEndGameHandler, this));
+ pauseMenu.Add(new GenericMenuItem(_("Continue"), pauseMenuContinueHandler, this));
pauseMenu.SetDimensions(30, 40, 40);
- nextLevelMenu.Add(new GenericMenuItem("Next level", nextLevelMenuNextLevelHandler, this));
- nextLevelMenu.Add(new GenericMenuItem("End game", pauseMenuEndGameHandler, this));
- nextLevelMenu.Add(new GenericMenuItem("View replay", nextLevelMenuViewReplayHandler, this));
- nextLevelMenu.Add(new GenericMenuItem("Export video", nextLevelMenuExportVideoHandler, this));
+ nextLevelMenu.Add(new GenericMenuItem(_("Next level"), nextLevelMenuNextLevelHandler, this));
+ nextLevelMenu.Add(new GenericMenuItem(_("End game"), pauseMenuEndGameHandler, this));
+ nextLevelMenu.Add(new GenericMenuItem(_("View replay"), nextLevelMenuViewReplayHandler, this));
+ nextLevelMenu.Add(new GenericMenuItem(_("Export video"), nextLevelMenuExportVideoHandler, this));
nextLevelMenu.SetDimensions(30, 40, 40);
- gameOverMenu.Add(new GenericMenuItem("Back to main menu", pauseMenuEndGameHandler, this));
- gameOverMenu.Add(new GenericMenuItem("Restart game", gameOverMenuRestartHandler, this));
- gameOverMenu.Add(new GenericMenuItem("View replay", nextLevelMenuViewReplayHandler, this));
- gameOverMenu.Add(new GenericMenuItem("Export video", nextLevelMenuExportVideoHandler, this));
+ gameOverMenu.Add(new GenericMenuItem(_("Back to main menu"), pauseMenuEndGameHandler, this));
+ gameOverMenu.Add(new GenericMenuItem(_("Restart game"), gameOverMenuRestartHandler, this));
+ gameOverMenu.Add(new GenericMenuItem(_("View replay"), nextLevelMenuViewReplayHandler, this));
+ gameOverMenu.Add(new GenericMenuItem(_("Export video"), nextLevelMenuExportVideoHandler, this));
gameOverMenu.SetDimensions(30, 40, 40);
@@ -442,7 +442,7 @@
if (showPauseMenu)
{
pauseMenu.Render();
- string msg = "Game paused";
+ string msg = _("Game paused");
glColor3d(1.0, 0.0, 0.0);
CenterMsg(msg, 45, font);
@@ -455,10 +455,10 @@
glLoadIdentity( );
glColor3d(1.0, 1.0, 1.0);
- CenterMsg("Level cleared", 50, font);
+ CenterMsg(_("Level cleared"), 50, font);
char msgscore[256];
- sprintf(msgscore, "Current score: %05d", score);
+ sprintf(msgscore, _("Current score: %05d"), score);
CenterMsg(msgscore, 45, font);
}
@@ -469,13 +469,13 @@
gameOverMenu.Render();
glLoadIdentity( );
- string msg = "Game Over";
+ string msg = _("Game Over");
glColor3d(1.0, 0.0, 0.0);
CenterMsg(msg, 50, font);
char msgscore[256];
- sprintf(msgscore, "Score: %05d", score);
+ sprintf(msgscore, _("Score: %05d"), score);
glColor3d(1.0, 1.0, 1.0);
CenterMsg(msgscore, 45, font);
}
@@ -483,7 +483,7 @@
if (pwned && !hiScore)
{
glColor3d(1.0, 1.0, 1.0);
- CenterMsg("Congratulations !!! You just pwned", 90, font3);
+ CenterMsg(_("Congratulations !!! You just pwned"), 90, font3);
// logo
glLoadIdentity();
@@ -508,8 +508,8 @@
if (hiScore)
{
glColor3d(1.0, 1.0, 1.0);
- CenterMsg("You have a new hi score", 65, font);
- CenterMsg("please enter your name", 60, font);
+ CenterMsg(_("You have a new hi score"), 65, font);
+ CenterMsg(_("please enter your name"), 60, font);
editor.Render();
}
}
--- zaz-0.2.6.orig/src/game.cpp
+++ zaz-0.2.6/src/game.cpp
@@ -487,7 +487,7 @@
glLoadIdentity( );
glPushMatrix();
- FTBBox b = font3->BBox(level.name.c_str());
+ FTBBox b = font3->BBox(gettext(level.name.c_str()));
double tw = b.Upper().X() / 5;
glTranslated((100 - tw) / 2, 50, 5);
@@ -502,7 +502,7 @@
glColor4d(1.0, 1.0, 1.0, alpha);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- font3->Render(level.name.c_str());
+ font3->Render(gettext(level.name.c_str()));
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glPopMatrix();
# translation of es.po to español
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Miriam Ruiz <miriam@debian.org>, 2009.
msgid ""
msgstr ""
"Project-Id-Version: es\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-08-25 01:01+0200\n"
"PO-Revision-Date: 2009-08-25 01:04+0200\n"
"Last-Translator: Miriam Ruiz <miriam@debian.org>\n"
"Language-Team: español <es@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/mainmenu.cpp:31
msgid "Start game"
msgstr "Comenzar el juego"
#: src/mainmenu.cpp:33
msgid "Options"
msgstr "Opciones"
#: src/mainmenu.cpp:34
msgid "Credits"
msgstr "Créditos"
#: src/mainmenu.cpp:35
msgid "Exit"
msgstr "Salir"
#: src/mainmenu.cpp:49
msgid "Resolution"
msgstr "Resolución"
#: src/mainmenu.cpp:50
msgid "Fullscreen"
msgstr "Pantalla completa"
#: src/mainmenu.cpp:51
msgid "Show FPS"
msgstr "Mostrar FPS"
#: src/mainmenu.cpp:52
msgid "Mouse sensivity"
msgstr "Sensib. ratón"
#: src/mainmenu.cpp:53
msgid "SFX volume"
msgstr "Vol. de sonidos"
#: src/mainmenu.cpp:54
msgid "Music volume"
msgstr "Vol. de música"
#: src/mainmenu.cpp:55 src/gameloop.cpp:68
msgid "Back to main menu"
msgstr "Volver al menú principal"
#: src/mainmenu.cpp:59
msgid "Back"
msgstr "Volver"
#: src/mainmenu.cpp:242
msgid "Hall of Fame"
msgstr "Mejores"
#: src/mainmenu.cpp:268
msgid "code, gfx, snd & design:"
msgstr "código, gráficos, sonido y diseño"
#: src/mainmenu.cpp:269
msgid "Remigiusz Dybka"
msgstr ""
#: src/mainmenu.cpp:270
msgid "[remigiusz.dybka@gmail.com]"
msgstr ""
#: src/mainmenu.cpp:272
msgid "music:"
msgstr "música"
#: src/mainmenu.cpp:273
msgid "Nine Inch Nails"
msgstr ""
#: src/mainmenu.cpp:274
msgid ""
"[http://nin.com] Released under Creative Commons Attribution Non-Commercial "
"Share Alike License"
msgstr "[http://nin.com] Publicado bajo la licencia Creative Commons Reconocimiento-No comercial-Compartir bajo la misma licencia"
#: src/gameloop.cpp:56 src/gameloop.cpp:62
msgid "End game"
msgstr "Terminar el juego"
#: src/gameloop.cpp:57
msgid "Continue"
msgstr "Continuar"
#: src/gameloop.cpp:61
msgid "Next level"
msgstr "Siguiente nivel"
#: src/gameloop.cpp:63 src/gameloop.cpp:70
msgid "View replay"
msgstr "Ver repetición"
#: src/gameloop.cpp:64 src/gameloop.cpp:71
msgid "Export video"
msgstr "Exportar vídeo"
#: src/gameloop.cpp:69
msgid "Restart game"
msgstr "Volver a empezar"
#: src/gameloop.cpp:445
msgid "Game paused"
msgstr "Juego parado"
#: src/gameloop.cpp:458
msgid "Level cleared"
msgstr "Nivel superado"
#: src/gameloop.cpp:461
#, c-format
msgid "Current score: %05d"
msgstr "Puntuación actual: %05d"
#: src/gameloop.cpp:472
msgid "Game Over"
msgstr "Fin del juego"
#: src/gameloop.cpp:478
#, c-format
msgid "Score: %05d"
msgstr "Puntuación: %05d"
#: src/gameloop.cpp:486
msgid "Congratulations !!! You just pwned"
msgstr "¡¡Enhorabuena!! ¡¡Has triunfado!!"
#: src/gameloop.cpp:511
#, fuzzy
msgid "You have a new hi score"
msgstr "¡Cuidado! ¡ojo!"
#: src/gameloop.cpp:512
msgid "please enter your name"
msgstr "por favor, introduce tu nombre"
#: data/data/level1.lvl:1
msgid "Zatlantiz"
msgstr "Zatlántida"
#: data/data/level2.lvl:1
msgid "Zuza"
msgstr ""
#: data/data/level3.lvl:1
msgid "Bendlantiz"
msgstr "Torzlántida"
#: data/data/level4.lvl:1
msgid "You have been warned"
msgstr "¡Cuidado! ¡ojo!"
#: data/data/level5.lvl:1
msgid "Double D"
msgstr "Doble D"
#: data/data/level6.lvl:1
msgid "SuperZaz"
msgstr "Super Zaz"
Reply to: