translated main menu to german, omitting header info in gettext calls, libs, test gettext call in menuitem render

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4629 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2009-08-12 20:58:29 +00:00
parent e7a3cc012b
commit 581ecdb9f6
15 changed files with 141 additions and 2 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
+46
View File
@@ -0,0 +1,46 @@
# 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-12 20:23+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: R:\projects\actioncube\_svn\trunk\ac\source\src\main.cpp:614
msgid "hello world\n"
msgstr ""
msgid "Multiplayer"
msgstr ""
msgid "Singleplayer"
msgstr ""
msgid "Settings"
msgstr ""
msgid "Demo"
msgstr ""
msgid "Editing"
msgstr ""
msgid "Help"
msgstr ""
msgid "About"
msgstr ""
msgid "Quit"
msgstr ""
Binary file not shown.
+42
View File
@@ -0,0 +1,42 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) rabid viper productions
# FIRST AUTHOR blah, 2009
#
msgid ""
msgstr ""
"Project-Id-Version: AC\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-08-12 20:23+0200\n"
"PO-Revision-Date: 2009-08-12 20:23+0200\n"
"Last-Translator: dude <EMAIL@ADDRESS>\n"
"Language-Team: German <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "About"
msgstr "Info"
msgid "Demo"
msgstr "Demo"
msgid "Editing"
msgstr "Editieren"
msgid "Help"
msgstr "Hilfe"
msgid "Multiplayer"
msgstr "Mehrspieler"
msgid "Quit"
msgstr "Beenden"
msgid "Settings"
msgstr "Einstellungen"
msgid "Singleplayer"
msgstr "Einzelspieler"
msgid "hello world\n"
msgstr "HALLO WELT\n"
+3
View File
@@ -0,0 +1,3 @@
msgfmt -c -v -o de\lc_messages\AC.mo de\lc_messages\AC.po
copy /Y de\lc_messages\AC.mo ..\..\packages\locale\de\lc_messages\AC.mo
pause
+2
View File
@@ -0,0 +1,2 @@
msgmerge.exe -s -U de\lc_messages\AC.po AC.pot
pause
+1
View File
@@ -9,6 +9,7 @@
#include "weapon.h"
#include "entity.h"
#include "world.h"
#include "i18n.h"
#ifndef STANDALONE
#include "command.h"
+15
View File
@@ -0,0 +1,15 @@
// internationalization and localization
#include "pch.h"
#include "cube.h"
i18nmanager::i18nmanager(const char *domain, const char *basepath) : domain(domain), basepath(basepath)
{
locale = setlocale(LC_ALL, ""); // use current default locale
bindtextdomain(domain, basepath); // set base path
textdomain(domain);
printf("current locale: %s\n", locale);
printf(_("hello world\n")); // test output
}
+12
View File
@@ -0,0 +1,12 @@
// internationalization and localization
// localization manager
struct i18nmanager
{
const char *basepath;
const char *domain;
char *locale;
i18nmanager(const char *domain, const char *basepath); // initialize locale system
};
+2
View File
@@ -606,6 +606,8 @@ int main(int argc, char **argv)
}
if(!quitdirectly)
{
i18nmanager i18n("AC", path("packages/locale", true));
initing = NOT_INITING;
initlog("sdl");
+1 -1
View File
@@ -158,7 +158,7 @@ struct mitemmanual : mitem
virtual void render(int x, int y, int w)
{
mitem::render(x, y, w);
draw_text(text, x, y);
draw_text(_(text), x, y);
}
virtual void focus(bool on)
+9 -1
View File
@@ -638,7 +638,15 @@ inline char *newstring(const char *s) { return newstring(s, strlen(s))
inline char *newstringbuf() { return newstring(_MAXDEFSTR-1); }
inline char *newstringbuf(const char *s) { return newstring(s, _MAXDEFSTR-1); }
#define _(STRING) gettext(STRING)
inline char *_gettext(const char *msgid)
{
if(msgid && msgid[0] != '\0')
return gettext(msgid);
else
return "";
}
#define _(s) _gettext(s)
extern const char *timestring(bool local = false, const char *fmt = NULL);
extern const char *asctime();
+8
View File
@@ -569,6 +569,10 @@
RelativePath="..\src\hudgun.h"
>
</File>
<File
RelativePath="..\src\i18n.h"
>
</File>
<File
RelativePath="..\src\md2.h"
>
@@ -1769,6 +1773,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\i18n.cpp"
>
</File>
<File
RelativePath="..\src\log.cpp"
>