[AD] Untranslated string: ALLEGRO_WINDOW_CLOSE_MESSAGE

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hi.

At the moment there's a string which can't be translated
because it's a define: ALLEGRO_WINDOW_CLOSE_MESSAGE, located in
include/allegro/inline/system.inl. I noticed this while playing a
few of the speedhack entries provided as windows binaries by Matthew
Leverton.

The problem is that it's such a long string that the simple recovery
method of get_config_text get's in the way of coding/translating. Using
an abbreviation may render the message useless for users running with
no xxlang.cfg file.

My proposed solution consists of a hybrid: manual use of get_config_string
with the abbreviation and the define as parameters. This still isn't
ideal for translators, so the string key and it's translation are to be
added to the english resource file so other translators can notice it.

Files which should fix this: beos/bgfxapi.cpp, qnx/qsystem.c and
win/wwnd.c.  Take this as a simple proposal, I didn't check if it works.

PD: Looks like hard tabs dissappeard from a few source files...

-- 
 Grzegorz Adam Hankiewicz   gradha@xxxxxxxxxx   http://gradha.infierno.org/
Index: resource/language/entext.cfg
===================================================================
RCS file: /cvsroot/alleg/allegro/resource/language/entext.cfg,v
retrieving revision 1.2
diff -u -r1.2 entext.cfg
--- resource/language/entext.cfg	17 Sep 2001 10:01:51 -0000	1.2
+++ resource/language/entext.cfg	28 May 2002 22:09:32 -0000
@@ -1,3 +1,5 @@
 language_name = English
 
 [language]
+allegro_window_close_message = Warning: forcing program shutdown may lead to data loss and unexpected results. It is preferable to use the exit command inside the window. Proceed anyway?
+
Index: src/win/wwnd.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/win/wwnd.c,v
retrieving revision 1.50
diff -u -r1.50 wwnd.c
--- src/win/wwnd.c	27 May 2002 14:21:32 -0000	1.50
+++ src/win/wwnd.c	28 May 2002 22:09:35 -0000
@@ -381,8 +381,11 @@
             }
             else {
                /* default window close message */
-               if (MessageBox(wnd, ALLEGRO_WINDOW_CLOSE_MESSAGE, wnd_title,
-                              MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2) == IDYES)
+	       char tmp[512];
+	       if (MessageBox(wnd, uconvert_toascii(get_config_string
+		     ("[language]", "allegro_window_close_message",
+		     ALLEGRO_WINDOW_CLOSE_MESSAGE), tmp), wnd_title,
+		     MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2) == IDYES)
                   ExitProcess(0);
             }
             return 0;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/