[Tux4kids-commits] r836 - in tuxtype/trunk: . data/themes/french src
dbruce-guest at alioth.debian.org
dbruce-guest at alioth.debian.org
Sun Jan 11 19:35:23 UTC 2009
Author: dbruce-guest
Date: 2009-01-11 19:35:23 +0000 (Sun, 11 Jan 2009)
New Revision: 836
Modified:
tuxtype/trunk/ChangeLog
tuxtype/trunk/ChangeLog~
tuxtype/trunk/data/themes/french/settings.txt
tuxtype/trunk/src/loaders.c
tuxtype/trunk/src/main.c
Log:
trying to get i18n functioning in Windows
Modified: tuxtype/trunk/ChangeLog
===================================================================
--- tuxtype/trunk/ChangeLog 2009-01-10 20:15:09 UTC (rev 835)
+++ tuxtype/trunk/ChangeLog 2009-01-11 19:35:23 UTC (rev 836)
@@ -1,3 +1,9 @@
+10 Jan 2009 - svn revision 830
+[ David Bruce <davidstuartbruce at gmail.com> ]
+ - adaptation of menu code for lessons activity so as to be consistent with
+ rest of menus.
+
+
08 Jan 2009 - svn revision 830
[ David Bruce <davidstuartbruce at gmail.com> ]
- adaptation of menu code for lessons activity so as to be consistent with
Modified: tuxtype/trunk/ChangeLog~
===================================================================
--- tuxtype/trunk/ChangeLog~ 2009-01-10 20:15:09 UTC (rev 835)
+++ tuxtype/trunk/ChangeLog~ 2009-01-11 19:35:23 UTC (rev 836)
@@ -1,5 +1,8 @@
+08 Jan 2009 - svn revision 830
+[ David Bruce <davidstuartbruce at gmail.com> ]
+ - adaptation of menu code for lessons activity so as to be consistent with
+ rest of menus.
-=======
06 Jan 2009 - svn revision 822
[ David Bruce <davidstuartbruce at gmail.com> ]
- Bugfix to prevent BlackOutline() from segfault if passed empty string
Modified: tuxtype/trunk/data/themes/french/settings.txt
===================================================================
--- tuxtype/trunk/data/themes/french/settings.txt 2009-01-10 20:15:09 UTC (rev 835)
+++ tuxtype/trunk/data/themes/french/settings.txt 2009-01-11 19:35:23 UTC (rev 836)
@@ -1 +1 @@
-theme_locale_name=fr_FR.utf8
+theme_locale_name=fr_FR.ISO8859-1
Modified: tuxtype/trunk/src/loaders.c
===================================================================
--- tuxtype/trunk/src/loaders.c 2009-01-10 20:15:09 UTC (rev 835)
+++ tuxtype/trunk/src/loaders.c 2009-01-11 19:35:23 UTC (rev 836)
@@ -68,19 +68,28 @@
/* also should have return value reflect success or failure. */
void LoadLang(void)
{
- const char *s1;
+ char *s1, *s2, *s3, *s4;
s1 = setlocale(LC_ALL, settings.theme_locale_name);
+ s2 = bindtextdomain(PACKAGE, TUXLOCALE);
+ s3 = bind_textdomain_codeset(PACKAGE, "UTF-8");
+ s4 = textdomain(PACKAGE);
DEBUGCODE
{
+ fprintf(stderr, "PACKAGE = %s\n", PACKAGE);
+ fprintf(stderr, "TUXLOCALE = %s\n", TUXLOCALE);
fprintf(stderr, "setlocale(LC_ALL, %s) returned: %s\n", settings.theme_locale_name, s1);
+ fprintf(stderr, "bindtextdomain(PACKAGE, TUXLOCALE) returned: %s\n", s2);
+ fprintf(stderr, "bind_textdomain_codeset(PACKAGE, \"UTF-8\") returned: %s\n", s3);
+ fprintf(stderr, "textdomain(PACKAGE) returned: %s\n", s4);
+ fprintf(stderr, "gettext(\"Fish\"): %s\n\n", gettext("Fish"));
+ fprintf(stderr, "After gettext() call\n");
}
-
return;
-
}
+
int max(int n1, int n2)
{
return (n1 > n2 ? n1 : n2);
@@ -268,17 +277,18 @@
DEBUGCODE { fprintf(stderr, "Warning: graphics file %s could not be loaded\n", fn);}
}
+ /* NOTE changed this so we just return NULL instead of exiting - DSB
/* Couldn't load image - action depends on whether image is essential: */
if (!tmp_pic)
{
- if (mode & IMG_NOT_REQUIRED)
+// if (mode & IMG_NOT_REQUIRED)
{
// settings.debug_on = oldDebug;
+ fprintf(stderr, "Warning - could not load graphics file %s\n", datafile);
return NULL;
}
- fprintf(stderr, "ERROR could not load required graphics file %s\n", datafile);
- exit(1);
+// exit(1);
}
Modified: tuxtype/trunk/src/main.c
===================================================================
--- tuxtype/trunk/src/main.c 2009-01-10 20:15:09 UTC (rev 835)
+++ tuxtype/trunk/src/main.c 2009-01-11 19:35:23 UTC (rev 836)
@@ -39,41 +39,14 @@
Uint32 lib_flags = 0;
int i;
- const char *s1, *s2, *s3, *s4;
- s1 = setlocale(LC_ALL, "");
- s2 = bindtextdomain(PACKAGE, TUXLOCALE);
- s3 = bind_textdomain_codeset(PACKAGE, "UTF-8");
- s4 = textdomain(PACKAGE);
- DEBUGCODE
- {
- fprintf(stderr, "PACKAGE = %s\n", PACKAGE);
- fprintf(stderr, "TUXLOCALE = %s\n", TUXLOCALE);
- fprintf(stderr, "setlocale(LC_ALL, \"\") returned: %s\n", s1);
- fprintf(stderr, "bindtextdomain(PACKAGE, TUXLOCALE) returned: %s\n", s2);
- fprintf(stderr, "bind_textdomain_codeset(PACKAGE, \"UTF-8\") returned: %s\n", s3);
- fprintf(stderr, "textdomain(PACKAGE) returned: %s\n", s4);
- fprintf(stderr, "gettext(\"Help\"): %s\n\n", gettext("Help"));
- fprintf(stderr, "After gettext() call\n");
- }
-
- /* Initialize settings with hard-coded defaults: */
- Opts_Initialize();
-
srand(time(NULL));
- // This sets settings.default_data_path to the default theme file path:
- SetupPaths(NULL);
-
- LoadSettings();
- DEBUGCODE { printf("Window setting from config file is: %d\n", settings.fullscreen);}
-
- lib_flags = SDL_INIT_VIDEO;
-
- /* FIXME this could go into something like HandleCommandArgs() */
- // check command line args
- if (argc > 1)
+ Opts_Initialize(); // First, initialize settings with hard-coded defaults
+ LoadSettings(); // Second, read saved any saved settings
+ // Third, check command line args as these should override saved settings
+ if (argc > 1) /* FIXME this could go into something like HandleCommandArgs() */
{
for (i = 1; i < argc; i++)
{
@@ -152,6 +125,38 @@
fprintf(stderr, "\n%s, version %s BEGIN\n", PACKAGE, VERSION);
}
+ //Now initialize locale/gettext system.
+ //This is done after reading settings just so we can print
+ //if the "-d" debug flag is set.
+ {
+ char *s1, *s2, *s3, *s4;
+
+ s1 = setlocale(LC_ALL, "");
+ s2 = bindtextdomain(PACKAGE, TUXLOCALE);
+ s3 = bind_textdomain_codeset(PACKAGE, "UTF-8");
+ s4 = textdomain(PACKAGE);
+
+ DEBUGCODE
+ {
+ fprintf(stderr, "PACKAGE = %s\n", PACKAGE);
+ fprintf(stderr, "TUXLOCALE = %s\n", TUXLOCALE);
+ fprintf(stderr, "setlocale(LC_ALL, \"\") returned: %s\n", s1);
+ fprintf(stderr, "bindtextdomain(PACKAGE, TUXLOCALE) returned: %s\n", s2);
+ fprintf(stderr, "bind_textdomain_codeset(PACKAGE, \"UTF-8\") returned: %s\n", s3);
+ fprintf(stderr, "textdomain(PACKAGE) returned: %s\n", s4);
+ fprintf(stderr, "gettext(\"Fish\"): %s\n\n", gettext("Fish"));
+ fprintf(stderr, "After gettext() call\n");
+ }
+ }
+
+
+ // This sets settings.default_data_path to the default theme file path:
+ SetupPaths(NULL);
+
+
+
+ lib_flags = SDL_INIT_VIDEO;
+
lib_flags |= SDL_INIT_AUDIO;
LibInit(lib_flags); /* calls SDL_Init(), TTF_Init(), some other settings */
More information about the Tux4kids-commits
mailing list