At 12:00am -0700 00-04-25, Palm Developer Forum digest wrote:
>Subject: Re: Symptom of something currupt?
>From: "Richard Burmeister" <[EMAIL PROTECTED]>
>Date: Mon, 24 Apr 2000 16:57:26 -0500
>X-Message-Number: 38
>
>From: "Charles Rezsonya" <[EMAIL PROTECTED]>
>  >
>  > FrmCustomAlert(TestAlert, "this is my test message", NULL, NULL);
>
>Do you have all three parameters (^1, ^2, and ^3) in your alert?  When you
>call FrmCustomAlert, don't pass in NULL if your alert uses ^1, ^2, and ^3.
>For each unused parameter, pass in a string containing a single blank.

In pre-3.1 versions of the OS, you don't way to pass NULL or "" for 
any parameter which has a corresponding template (^1, ^2, or ^3) 
sub-string in the alert text.

Though you could think of this as the OS's way of saying "Don't do 
that". Having parameters which conditionally appear or disappear in a 
message often leads to a message that cannot be correctly translated. 
The one common exception I can think of is when the parameter 
corresponds to a complete sentence; for example, your message says 
something like "Sorry, an error occurred. ^1" and then the ^1 
parameter is only used when additional information is available.

>Another solution (the one I personally prefer, but others may disagree) is
>to only use one replaceable string (^1) in the alert form and to use
>StrPrintF to build the string.  This has the advantage of allowing any
>number of string replacements.  For example:
>
>StrPrintF( msg, "Thank's for registering, %s!\n\nYour code is %s", name,
>code );
>FrmCustomAlert( GeneralAlert, msg, NULL, NULL );
>
>Note that, in this case, it is safe to pass in NULL because my GeneralAlert
>only contains ^1.

This is the kind of thing that will prevent your app from being 
localizable, for two reasons.

a. You've got a hard-coded string in your code.

b. The localizers are unable to re-order parameters in the message, 
which is frequently necessary to get a grammatically correct (or at 
least reasonable) translation.

-- Ken

Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to