added gettext support
authorConstantin Wenger <constantin.wenger@googlemail.com>
Wed, 20 Jul 2011 14:51:19 +0000 (16:51 +0200)
committerConstantin Wenger <constantin.wenger@googlemail.com>
Wed, 20 Jul 2011 14:51:19 +0000 (16:51 +0200)
german translation file
and bashscript to update translations

README.txt
po/de/minetest-c55.po [new file with mode: 0644]
src/CMakeLists.txt
src/gettext.h [new file with mode: 0644]
src/guiMainMenu.cpp
src/guiMessageMenu.cpp
src/guiPasswordChange.cpp
src/guiPauseMenu.cpp
src/guiTextInputMenu.cpp
src/main.cpp
updatelocales.sh [new file with mode: 0644]

index 41048992e98e10d083b9f413d6789c7005be11e7..662f2770b0734d0ca2a6212959cae376b890f4db 100644 (file)
@@ -90,6 +90,8 @@ Compiling on Windows:
                http://www.winimage.com/zLibDll/index.html
        * Zlib library (zlibwapi.lib and zlibwapi.dll from zlib125dll.zip):
                http://www.winimage.com/zLibDll/index.html
+       * gettext bibrary and tools:
+               http://gnuwin32.sourceforge.net/downlinks/gettext.php
        * And, of course, Minetest-c55:
                http://celeron.55.lt/~celeron55/minetest/download
 - Steps:
@@ -117,6 +119,10 @@ Compiling on Windows:
                        + lib
                        + include
                        ...
+               + gettext
+                       +bin
+                       +include
+                       +lib
                + minetest
                        + src
                        + doc
@@ -145,6 +151,10 @@ Compiling on Windows:
        ZLIB_DLL                 DIR/zlib125dll/dll32/zlibwapi.dll
        ZLIB_INCLUDE_DIR         DIR/zlib-1.2.5
        ZLIB_LIBRARIES           DIR/zlib125dll/dll32/zlibwapi.lib
+       GETTEXT_BIN_DIR          DIR/gettext/bin
+       GETTEXT_INCLUDE_DIR      DIR/gettext/include
+       GETTEXT_LIBRARIES        DIR/gettext/lib/intl.lib
+       GETTEXT_MSGFMT           DIR/gettext/bin/msgfmt
        -----------------
        - Hit "Configure"
        - Hit "Generate"
diff --git a/po/de/minetest-c55.po b/po/de/minetest-c55.po
new file mode 100644 (file)
index 0000000..58c977f
--- /dev/null
@@ -0,0 +1,121 @@
+# German translations for minetest-c55 package.
+# Copyright (C) 2011 celeron
+# This file is distributed under the same license as the minetest-c55 package.
+# Constantin Wenger <constantin.wenger@googlemail.com>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: 0.0.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-07-20 16:03+0200\n"
+"PO-Revision-Date: 2011-07-20 16:04+0100\n"
+"Last-Translator: Constantin Wenger <constantin.wenger@googlemail.com>\n"
+"Language-Team: Deutsch <>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n!=1);\n"
+
+#: src/guiMainMenu.cpp:173
+msgid "Name/Password"
+msgstr "Name/Passwort"
+
+#: src/guiMainMenu.cpp:195
+msgid "Address/Port"
+msgstr "Adresse / Port"
+
+#: src/guiMainMenu.cpp:214
+msgid "Leave address blank to start a local server."
+msgstr "Lasse die Adresse frei um einen eigenen Server zu starten"
+
+#: src/guiMainMenu.cpp:220
+msgid "Fancy trees"
+msgstr "Schöne Bäume"
+
+#: src/guiMainMenu.cpp:226
+msgid "Smooth Lighting"
+msgstr "Besseres Licht"
+
+#: src/guiMainMenu.cpp:233
+msgid "Start Game / Connect"
+msgstr "Spiel starten / Verbinden"
+
+#: src/guiMainMenu.cpp:256
+msgid "Creative Mode"
+msgstr "Kreativitätsmodus"
+
+#: src/guiMainMenu.cpp:261
+msgid "Enable Damage"
+msgstr "Schaden einschalten"
+
+#: src/guiMainMenu.cpp:268
+msgid "Delete world"
+msgstr "Welt löschen"
+
+#: src/guiMessageMenu.cpp:92
+#: src/guiTextInputMenu.cpp:110
+msgid "Proceed"
+msgstr "Fortsetzen"
+
+#: src/guiPasswordChange.cpp:102
+msgid "Old Password"
+msgstr "Altes Passwort"
+
+#: src/guiPasswordChange.cpp:116
+msgid "New Password"
+msgstr "Neues Passwort"
+
+#: src/guiPasswordChange.cpp:129
+msgid "Confirm Password"
+msgstr "Passwort wiederholen"
+
+#: src/guiPasswordChange.cpp:143
+msgid "Change"
+msgstr "Ändern"
+
+#: src/guiPasswordChange.cpp:151
+msgid "Passwords do not match!"
+msgstr "Passwörter passen nicht zusammen"
+
+#: src/guiPauseMenu.cpp:109
+msgid "Continue"
+msgstr "Weiter"
+
+#: src/guiPauseMenu.cpp:115
+msgid "Change Password"
+msgstr "Passwort ändern"
+
+#: src/guiPauseMenu.cpp:121
+msgid "Disconnect"
+msgstr "Verbindung trennen"
+
+#: src/guiPauseMenu.cpp:127
+msgid "Exit to OS"
+msgstr "Programm beenden"
+
+#: src/guiPauseMenu.cpp:134
+msgid ""
+"Keys:\n"
+"- WASD: Walk\n"
+"- Mouse left: dig blocks\n"
+"- Mouse right: place blocks\n"
+"- Mouse wheel: select item\n"
+"- 0...9: select item\n"
+"- Shift: sneak\n"
+"- R: Toggle viewing all loaded chunks\n"
+"- I: Inventory menu\n"
+"- ESC: This menu\n"
+"- T: Chat\n"
+msgstr ""
+"Tastenkürzel:\n"
+"- WASD: Gehen\n"
+"- linke Maustaste: dig blocks\n"
+"- rechte Maustaste: place blocks\n"
+"- Mausrad: Item auswählen\n"
+"- 0...9: Item auswählen\n"
+"- Shift: ducken\n"
+"- R: Alle geladenen Kartenteile anzeigen, umschalten\n"
+"- I: Inventarmenü\n"
+"- T: Chat\n"
+
index dfe5b57532023b3eba631c42949d4ea7708f65d1..fd15914236ca7257bd336de33da4bb13d522ac51 100644 (file)
@@ -27,6 +27,14 @@ if(WIN32)
                        CACHE FILEPATH "Path to zlibwapi.lib")
        set(ZLIB_DLL "${PROJECT_SOURCE_DIR}/../../zlib125dll/dll32/zlibwapi.dll"
                        CACHE FILEPATH "Path to zlibwapi.dll (for installation)")
+       set(GETTEXT_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/../../gettext/include"
+                       CACHE PATH "gettext include directory")
+       set(GETTEXT_BIN_DIR "${PROJECT_SOURCE_DIR}/../../gettext/bin"
+                       CACHE PATH "gettext bin directory")
+       set(GETTEXT_LIBRARIES "${PROJECT_SOURCE_DIR}/../../gettext/lib/intl.lib"
+                       CACHE FILEPATH "gettext intl.lib")
+       set(IRRLICHT_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../irrlicht-1.7.2"
+                       CACHE PATH "irrlicht dir")
 else()
        # Unix probably
        if(BUILD_CLIENT)
@@ -134,6 +142,7 @@ include_directories(
        ${ZLIB_INCLUDE_DIR}
        ${CMAKE_BUILD_TYPE}
        ${PNG_INCLUDE_DIR}
+       ${GETTEXT_INCLUDE_DIR}
        "${PROJECT_SOURCE_DIR}/jthread"
        "${PROJECT_SOURCE_DIR}/sqlite"
 )
@@ -151,6 +160,7 @@ if(BUILD_CLIENT)
                ${BZIP2_LIBRARIES}
                ${PNG_LIBRARIES}
                ${X11_LIBRARIES}
+               ${GETTEXT_LIBRARIES}
                ${PLATFORM_LIBS}
                ${CLIENT_PLATFORM_LIBS}
                jthread
@@ -208,6 +218,10 @@ else()
                set(ARCH i386)
        endif()
 
+       if(WIN32)
+               set(CMAKE_EXE_LINKER_FLAGS "-lintl -L ${GETTEXT_BIN_DIR}")
+       endif()
+
        set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${WARNING_FLAGS} -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops")
        set(CMAKE_CXX_FLAGS_DEBUG "-g -O1 -Wall ${WARNING_FLAGS}")
 
@@ -239,6 +253,8 @@ if(BUILD_CLIENT)
 
        install(FILES ${images} DESTINATION ${DATADIR})
 
+       install(FILES ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo DESTINATION locale/de/LC_MESSAGES)
        if(WIN32)
                if(DEFINED IRRLICHT_DLL)
                        install(FILES ${IRRLICHT_DLL} DESTINATION ${BINDIR})
@@ -246,6 +262,10 @@ if(BUILD_CLIENT)
                if(DEFINED ZLIB_DLL)
                        install(FILES ${ZLIB_DLL} DESTINATION ${BINDIR})
                endif()
+               if(DEFINED GETTEXT_BIN_DIR)
+                       install(FILES ${GETTEXT_BIN_DIR}/libintl3.dll DESTINATION ${BINDIR})
+                       install(FILES ${GETTEXT_BIN_DIR}/libiconv2.dll DESTINATION ${BINDIR})
+               endif()
        endif()
 endif(BUILD_CLIENT)
 
@@ -253,6 +273,27 @@ if(BUILD_SERVER)
        install(TARGETS minetestserver DESTINATION ${BINDIR})
 endif(BUILD_SERVER)
 
+if(WIN32)
+       set(GETTEXT_MSGFMT "${GETTEXT_BIN_DIR}/msgfmt" CACHE FILEPATH "path to msgfmt")
+elseif(APPLE)
+       set(GETTEXT_MSGFMT "${GETTEXT_BIN_DIR}/msgfmt" CACHE FILEPATH "path to msgfmt")
+else()
+       set(GETTEXT_MSGFMT "msgfmt")
+endif()
+
+add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMENT "mo-update [de]: Creating locale directory.")
+
+add_custom_command(
+               OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo
+               COMMAND ${GETTEXT_MSGFMT} -o ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po 
+               DEPENDS 
+                       ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES
+                       ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po
+               WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/po/de
+               COMMENT "mo-update [de]: Creating mo file."
+               )
+add_custom_target(translation_de ALL COMMENT "mo update [de]" DEPENDS ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo)
+
 # Subdirectories
 
 add_subdirectory(jthread)
diff --git a/src/gettext.h b/src/gettext.h
new file mode 100644 (file)
index 0000000..7f5f56e
--- /dev/null
@@ -0,0 +1,12 @@
+#include <libintl.h>
+#define _(String) gettext(String)
+#define gettext_noop(String) String
+#define N_(String) gettext_noop (String)
+
+inline wchar_t* chartowchar_t(char *str)
+{
+       size_t l = strlen(str)+1;
+       wchar_t* nstr = new wchar_t[l];
+       mbstowcs(nstr, str, l);
+       return nstr;
+}
index cea32860bc9109d1e15962f11a456fdd0a0bef1b..f557f4dc08eeb0c14fe6bd0a56f97900fa975e73 100644 (file)
@@ -25,6 +25,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 
 
+#include "gettext.h"
+
 GUIMainMenu::GUIMainMenu(gui::IGUIEnvironment* env,
                gui::IGUIElement* parent, s32 id,
                IMenuManager *menumgr,
@@ -175,8 +177,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
        {
                core::rect<s32> rect(0, 0, 110, 20);
                rect += topleft_client + v2s32(35, 50+6);
-               const wchar_t *text = L"Name/Password";
-               Environment->addStaticText(text, rect, false, true, this, -1);
+               Environment->addStaticText(chartowchar_t(gettext("Name/Password")), rect, false, true, this, -1);
        }
        {
                core::rect<s32> rect(0, 0, 230, 30);
@@ -198,8 +199,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
        {
                core::rect<s32> rect(0, 0, 110, 20);
                rect += topleft_client + v2s32(35, 100+6);
-               const wchar_t *text = L"Address/Port";
-               Environment->addStaticText(text, rect, false, true, this, -1);
+               Environment->addStaticText(chartowchar_t(gettext("Address/Port")), rect, false, true, this, -1);
        }
        {
                core::rect<s32> rect(0, 0, 230, 30);
@@ -217,28 +217,26 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
        }
        {
                core::rect<s32> rect(0, 0, 400, 20);
-               rect += topleft_client + v2s32(160, 100+35);
-               const wchar_t *text = L"Leave address blank to start a local server.";
-               Environment->addStaticText(text, rect, false, true, this, -1);
+               Environment->addStaticText(chartowchar_t(gettext("Leave address blank to start a local server.")), rect, false, true, this, -1);
        }
        {
                core::rect<s32> rect(0, 0, 250, 30);
                rect += topleft_client + v2s32(35, 150);
                Environment->addCheckBox(fancy_trees, rect, this, GUI_ID_FANCYTREE_CB,
-                               L"Fancy trees");
+                       chartowchar_t(gettext("Fancy trees"))); 
        }
        {
                core::rect<s32> rect(0, 0, 250, 30);
                rect += topleft_client + v2s32(35, 150+30);
                Environment->addCheckBox(smooth_lighting, rect, this, GUI_ID_SMOOTH_LIGHTING_CB,
-                               L"Smooth Lighting");
+                               chartowchar_t(gettext("Smooth Lighting")));
        }
        // Start game button
        {
                core::rect<s32> rect(0, 0, 180, 30);
                //rect += topleft_client + v2s32(size_client.X/2-180/2, 225-30/2);
                rect += topleft_client + v2s32(size_client.X-180-40, 150+25);
-               Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON, L"Start Game / Connect");
+               Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON, chartowchar_t(gettext("Start Game / Connect")));
        }
 
        // Key change button
@@ -246,7 +244,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
                core::rect<s32> rect(0, 0, 100, 30);
                //rect += topleft_client + v2s32(size_client.X/2-180/2, 225-30/2);
                rect += topleft_client + v2s32(size_client.X-180-40-100-20, 150+25);
-               Environment->addButton(rect, this, GUI_ID_CHANGE_KEYS_BUTTON, L"Change keys");
+               Environment->addButton(rect, this, GUI_ID_CHANGE_KEYS_BUTTON, chartowchar_t(gettext("Change keys")));
        }
        /*
                Server section
@@ -268,19 +266,19 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
        {
                core::rect<s32> rect(0, 0, 250, 30);
                rect += topleft_server + v2s32(35, 30);
-               Environment->addCheckBox(creative_mode, rect, this, GUI_ID_CREATIVE_CB, L"Creative Mode");
+               Environment->addCheckBox(creative_mode, rect, this, GUI_ID_CREATIVE_CB, chartowchar_t(gettext("Creative Mode")));
        }
        {
                core::rect<s32> rect(0, 0, 250, 30);
                rect += topleft_server + v2s32(35, 60);
-               Environment->addCheckBox(enable_damage, rect, this, GUI_ID_DAMAGE_CB, L"Enable Damage");
+               Environment->addCheckBox(enable_damage, rect, this, GUI_ID_DAMAGE_CB, chartowchar_t(gettext("Enable Damage")));
        }
        // Map delete button
        {
                core::rect<s32> rect(0, 0, 130, 30);
                //rect += topleft_server + v2s32(size_server.X-40-130, 100+25);
                rect += topleft_server + v2s32(40, 100+25);
-               Environment->addButton(rect, this, GUI_ID_DELETE_MAP_BUTTON, L"Delete map");
+               Environment->addButton(rect, this, GUI_ID_DELETE_MAP_BUTTON, chartowchar_t(gettext("Delete map")));
        }
 }
 
index 192911355151a7afdf7fe4a672798fa712d10571..e4e582ab176f35dcfa31041d1a145e04330fc908 100644 (file)
@@ -22,6 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "serialization.h"
 #include <string>
 
+#include "gettext.h"
+
 GUIMessageMenu::GUIMessageMenu(gui::IGUIEnvironment* env,
                gui::IGUIElement* parent, s32 id,
                IMenuManager *menumgr,
@@ -87,7 +89,7 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize)
                core::rect<s32> rect(0, 0, 140, 30);
                rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25);
                gui::IGUIElement *e = 
-               Environment->addButton(rect, this, 257, L"Proceed");
+               Environment->addButton(rect, this, 257, chartowchar_t(gettext("Proceed")));
                Environment->setFocus(e);
        }
 }
index ec1cd029ab321165df02086198bc0b71240316b1..79601a99fb5724cd60f238f7c12c7f34b366b65e 100644 (file)
@@ -21,6 +21,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "serialization.h"
 #include <string>
 
+#include "gettext.h"
+
 const int ID_oldPassword = 256;
 const int ID_newPassword1 = 257;
 const int ID_newPassword2 = 258;
@@ -97,8 +99,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
        {
                core::rect<s32> rect(0, 0, 110, 20);
                rect += topleft_client + v2s32(35, ypos+6);
-               const wchar_t *text = L"Old Password";
-               Environment->addStaticText(text, rect, false, true, this, -1);
+               Environment->addStaticText(chartowchar_t(gettext("Old Password")), rect, false, true, this, -1);
        }
        {
                core::rect<s32> rect(0, 0, 230, 30);
@@ -112,8 +113,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
        {
                core::rect<s32> rect(0, 0, 110, 20);
                rect += topleft_client + v2s32(35, ypos+6);
-               const wchar_t *text = L"New Password";
-               Environment->addStaticText(text, rect, false, true, this, -1);
+               Environment->addStaticText(chartowchar_t(gettext("New Password")), rect, false, true, this, -1);
        }
        {
                core::rect<s32> rect(0, 0, 230, 30);
@@ -126,8 +126,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
        {
                core::rect<s32> rect(0, 0, 110, 20);
                rect += topleft_client + v2s32(35, ypos+6);
-               const wchar_t *text = L"Confirm Password";
-               Environment->addStaticText(text, rect, false, true, this, -1);
+               Environment->addStaticText(chartowchar_t(gettext("Confirm Password")), rect, false, true, this, -1);
        }
        {
                core::rect<s32> rect(0, 0, 230, 30);
@@ -141,16 +140,15 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
        {
                core::rect<s32> rect(0, 0, 140, 30);
                rect = rect + v2s32(size.X/2-140/2, ypos);
-               Environment->addButton(rect, this, ID_change, L"Change");
+               Environment->addButton(rect, this, ID_change, chartowchar_t(gettext("Change")));
        }
 
        ypos += 50;
        {
                core::rect<s32> rect(0, 0, 300, 20);
                rect += topleft_client + v2s32(35, ypos);
-               const wchar_t *text = L"Passwords do not match!";
                IGUIElement *e = 
-               Environment->addStaticText(text, rect, false, true, this, ID_message);
+               Environment->addStaticText(chartowchar_t(gettext("Passwords do not match!")), rect, false, true, this, ID_message);
                e->setVisible(false);
        }
 
index 1a885a6ea0bdee3e14d6290c0448df0f5ffeb848..5f40a4820462decaea4dad57a86c502c470a1cac 100644 (file)
@@ -24,6 +24,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "config.h"\r
 #include "main.h"\r
 \r
+#include "gettext.h"\r
+\r
 GUIPauseMenu::GUIPauseMenu(gui::IGUIEnvironment* env,\r
                gui::IGUIElement* parent, s32 id,\r
                IGameCallback *gamecallback,\r
@@ -104,43 +106,43 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
        {\r
                core::rect<s32> rect(0, 0, 140, btn_height);\r
                rect = rect + v2s32(size.X/2-140/2, btn_y);\r
-               Environment->addButton(rect, this, 256, L"Continue");\r
+               Environment->addButton(rect, this, 256, chartowchar_t(gettext("Continue")));\r
        }\r
        btn_y += btn_height + btn_gap;\r
        {\r
                core::rect<s32> rect(0, 0, 140, btn_height);\r
                rect = rect + v2s32(size.X/2-140/2, btn_y);\r
-               Environment->addButton(rect, this, 261, L"Change Password");\r
+               Environment->addButton(rect, this, 261, chartowchar_t(gettext("Change Password")));\r
        }\r
        btn_y += btn_height + btn_gap;\r
        {\r
                core::rect<s32> rect(0, 0, 140, btn_height);\r
                rect = rect + v2s32(size.X/2-140/2, btn_y);\r
-               Environment->addButton(rect, this, 260, L"Disconnect");\r
+               Environment->addButton(rect, this, 260, chartowchar_t(gettext("Disconnect")));\r
        }\r
        btn_y += btn_height + btn_gap;\r
        {\r
                core::rect<s32> rect(0, 0, 140, btn_height);\r
                rect = rect + v2s32(size.X/2-140/2, btn_y);\r
-               Environment->addButton(rect, this, 257, L"Exit to OS");\r
+               Environment->addButton(rect, this, 257, chartowchar_t(gettext("Exit to OS")));\r
        }\r
 \r
        {\r
                core::rect<s32> rect(0, 0, 180, 240);\r
                rect = rect + v2s32(size.X/2 + 90, size.Y/2-rect.getHeight()/2);\r
-               const wchar_t *text =\r
-               L"Keys:\n"\r
-               L"- WASD: Walk\n"\r
-               L"- Mouse left: dig blocks\n"\r
-               L"- Mouse right: place blocks\n"\r
-               L"- Mouse wheel: select item\n"\r
-               L"- 0...9: select item\n"\r
-               L"- Shift: sneak\n"\r
-               L"- R: Toggle viewing all loaded chunks\n"\r
-               L"- I: Inventory menu\n"\r
-               L"- ESC: This menu\n"\r
-               L"- T: Chat\n";\r
-               Environment->addStaticText(text, rect, false, true, this, 258);\r
+               Environment->addStaticText(chartowchar_t(gettext(\r
+               "Keys:\n"\r
+               "- WASD: Walk\n"\r
+               "- Mouse left: dig blocks\n"\r
+               "- Mouse right: place blocks\n"\r
+               "- Mouse wheel: select item\n"\r
+               "- 0...9: select item\n"\r
+               "- Shift: sneak\n"\r
+               "- R: Toggle viewing all loaded chunks\n"\r
+               "- I: Inventory menu\n"\r
+               "- ESC: This menu\n"\r
+               "- T: Chat\n"\r
+               )), rect, false, true, this, 258);\r
        }\r
        {\r
                core::rect<s32> rect(0, 0, 180, 220);\r
index 2cb8cae6295b3e5417989408d650d959986e10b3..b15f8bc07354dc922ce448dc10fda9afec77393d 100644 (file)
@@ -22,6 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "serialization.h"
 #include <string>
 
+#include "gettext.h"
+
 GUITextInputMenu::GUITextInputMenu(gui::IGUIEnvironment* env,
                gui::IGUIElement* parent, s32 id,
                IMenuManager *menumgr,
@@ -105,7 +107,7 @@ void GUITextInputMenu::regenerateGui(v2u32 screensize)
        {
                core::rect<s32> rect(0, 0, 140, 30);
                rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25);
-               Environment->addButton(rect, this, 257, L"Proceed");
+               Environment->addButton(rect, this, 257, chartowchar_t(gettext("Proceed")));
        }
 }
 
index 698c5fc712d416b8c1317d80ba84561e98118243..1cc479d65eb57bb5a1a7fbab91d37bfc264918f1 100644 (file)
@@ -401,6 +401,8 @@ Doing currently:
 #include "keycode.h"\r
 #include "tile.h"\r
 \r
+#include "gettext.h"\r
+\r
 // This makes textures\r
 ITextureSource *g_texturesource = NULL;\r
 \r
@@ -1058,6 +1060,9 @@ int main(int argc, char *argv[])
        std::locale::global(std::locale("C"));\r
        // This enables printing all characters in bitmap font\r
        setlocale(LC_CTYPE, "en_US");\r
+       setlocale(LC_ALL, "");\r
+       bindtextdomain("minetest-c55", "./../locale");\r
+       textdomain("minetest-c55");\r
 \r
        /*\r
                Parse command line\r
diff --git a/updatelocales.sh b/updatelocales.sh
new file mode 100644 (file)
index 0000000..1ac4234
--- /dev/null
@@ -0,0 +1,4 @@
+#! /bin/bash
+xgettext -n -o minetest-c55.pot ./src/*.cpp ./src/*.h
+msgmerge -U ./po/de/minetest-c55.po minetest-c55.pot
+rm minetest-c55.pot