From 052bb24c7f03e5542be2b8c2a14662fcbf928a42 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Wed, 20 Jul 2011 16:51:19 +0200 Subject: added gettext support german translation file and bashscript to update translations --- src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 698c5fc71..1cc479d65 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -401,6 +401,8 @@ Doing currently: #include "keycode.h" #include "tile.h" +#include "gettext.h" + // This makes textures ITextureSource *g_texturesource = NULL; @@ -1058,6 +1060,9 @@ int main(int argc, char *argv[]) std::locale::global(std::locale("C")); // This enables printing all characters in bitmap font setlocale(LC_CTYPE, "en_US"); + setlocale(LC_ALL, ""); + bindtextdomain("minetest-c55", "./../locale"); + textdomain("minetest-c55"); /* Parse command line -- cgit v1.2.3 From 3fb5b7a3bd95eb6327c6894072739a7c28c711ce Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 9 Jun 2011 22:31:40 +0200 Subject: Set the window caption for the initial window too --- src/main.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 1cc479d65..7d0ea12ab 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1350,6 +1350,9 @@ int main(int argc, char *argv[]) // Set device in game parameters device = device; + + // Set the window caption + device->setWindowCaption(L"Minetest [Main Menu]"); // Create time getter g_timegetter = new IrrlichtTimeGetter(device); -- cgit v1.2.3 From 4d43a674190767cd85288b48737f97e94854e6f4 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Wed, 20 Jul 2011 18:49:18 +0200 Subject: fixed problem with wront paths in gettext --- src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 1cc479d65..00248a203 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1060,10 +1060,6 @@ int main(int argc, char *argv[]) std::locale::global(std::locale("C")); // This enables printing all characters in bitmap font setlocale(LC_CTYPE, "en_US"); - setlocale(LC_ALL, ""); - bindtextdomain("minetest-c55", "./../locale"); - textdomain("minetest-c55"); - /* Parse command line */ @@ -1135,6 +1131,10 @@ int main(int argc, char *argv[]) // Create user data directory fs::CreateDir(porting::path_userdata); + + setlocale(LC_ALL, ""); + bindtextdomain("minetest-c55", (porting::path_userdata+"/locale").c_str()); + textdomain("minetest-c55"); // Initialize debug streams #ifdef RUN_IN_PLACE -- cgit v1.2.3 From a09660dc85a6dd6eed83f72a85bacd62f1d9eb1a Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Fri, 22 Jul 2011 12:54:07 +0200 Subject: fixed problem with displaying special chars --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index b6a53566e..a7634a3c1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1132,7 +1132,7 @@ int main(int argc, char *argv[]) // Create user data directory fs::CreateDir(porting::path_userdata); - setlocale(LC_ALL, ""); + setlocale(LC_MESSAGES, ""); bindtextdomain("minetest-c55", (porting::path_userdata+"/locale").c_str()); textdomain("minetest-c55"); -- cgit v1.2.3 From fb4c3ab4fbd29498a72a488199be58ead7505cc7 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Fri, 22 Jul 2011 20:19:43 +0200 Subject: fixed some problems with filenames of the translations --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index a7634a3c1..b94d0c361 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1133,8 +1133,8 @@ int main(int argc, char *argv[]) fs::CreateDir(porting::path_userdata); setlocale(LC_MESSAGES, ""); - bindtextdomain("minetest-c55", (porting::path_userdata+"/locale").c_str()); - textdomain("minetest-c55"); + bindtextdomain("minetest", (porting::path_userdata+"/locale").c_str()); + textdomain("minetest"); // Initialize debug streams #ifdef RUN_IN_PLACE -- cgit v1.2.3 From f6d9bcc9bb020f79f73bc2cf0187f73a6d1d9275 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Sat, 23 Jul 2011 22:36:11 +0200 Subject: updated cmakerules to autodetect if gettext can be used fixed error if gettext is disabled --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index b94d0c361..11941a43f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1132,10 +1132,12 @@ int main(int argc, char *argv[]) // Create user data directory fs::CreateDir(porting::path_userdata); +#ifdef LC_MESSAGES setlocale(LC_MESSAGES, ""); bindtextdomain("minetest", (porting::path_userdata+"/locale").c_str()); textdomain("minetest"); - +#endif + // Initialize debug streams #ifdef RUN_IN_PLACE std::string debugfile = DEBUGFILE; -- cgit v1.2.3 From d4e7faca219ca2d9d84b02e46d591799afed32d8 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 23 Jul 2011 15:49:06 +0200 Subject: Gettext domain should match the project name This partially reverts 023cc0d37776976b4b192b7363f73a5d2debdef6, goes back to using PROJECT_NAME for the filename and also uses PROJECT_NAME as text domain in the source code. --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 11941a43f..2f48d229f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1134,8 +1134,8 @@ int main(int argc, char *argv[]) #ifdef LC_MESSAGES setlocale(LC_MESSAGES, ""); - bindtextdomain("minetest", (porting::path_userdata+"/locale").c_str()); - textdomain("minetest"); + bindtextdomain(PROJECT_NAME, (porting::path_userdata+"/locale").c_str()); + textdomain(PROJECT_NAME); #endif // Initialize debug streams -- cgit v1.2.3 From c578efb32b57b08275b9a0a2fd4a76b4e4b9e87d Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 23 Jul 2011 16:38:37 +0200 Subject: Refactor gettext init Put the gettext init code in a macro and define it appropriately depending on whether gettext is actually available or not. --- src/main.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 2f48d229f..bdfbc35f7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1132,11 +1132,7 @@ int main(int argc, char *argv[]) // Create user data directory fs::CreateDir(porting::path_userdata); -#ifdef LC_MESSAGES - setlocale(LC_MESSAGES, ""); - bindtextdomain(PROJECT_NAME, (porting::path_userdata+"/locale").c_str()); - textdomain(PROJECT_NAME); -#endif + init_gettext((porting::path_userdata+"/locale").c_str()); // Initialize debug streams #ifdef RUN_IN_PLACE -- cgit v1.2.3 From 423109e64c9e723f9f2a52e3537892f584383865 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 24 Jul 2011 18:12:11 +0200 Subject: Two more instances of unhardcoding the project name --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index bdfbc35f7..0001d33ec 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1153,7 +1153,7 @@ int main(int argc, char *argv[]) BEGIN_DEBUG_EXCEPTION_HANDLER // Print startup message - dstream< Date: Sun, 24 Jul 2011 19:20:40 +0200 Subject: Locale dir should be parallel to global data dir --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 0001d33ec..bcca60d95 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1132,7 +1132,7 @@ int main(int argc, char *argv[]) // Create user data directory fs::CreateDir(porting::path_userdata); - init_gettext((porting::path_userdata+"/locale").c_str()); + init_gettext((porting::path_data+"/../locale").c_str()); // Initialize debug streams #ifdef RUN_IN_PLACE -- cgit v1.2.3