Support forum of the software localization tool Sisulizer


Localization Tool for VB, Delphi, .NET, C#, VB.NET, XML, Online Help, HTML ... Home

Get in contact with the makers of Sisulizer.
Our forum is open for all questions around Sisulizer from customers and prospects.
Don't hesitate to register and ask. The Sisulizer team will answer ASAP.

Search     Help Home Sisulizer Website Download
Search by username
Not logged in - Login | Register 

 Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius
New Topic Reply Printer Friendly
Format String Validators firing incorrectly - Bugs and Quirks in Sisulizer - Technical Support (You need to be registered at the forum to write) - Localization Tool for VB, Delphi, .NET, C#, VB.NET, XML, Online Help, HTML ...
AuthorPost
 Posted: Mon Nov 3rd, 2008 12:20 am
PM Quote Reply
mdunmill
Member
 

Joined: Tue Nov 13th, 2007
Location:  
Posts: 64
Status: 
Offline
In some situations the Inconsistent Format String and the Possibly Extra Format string validation rules fire when there is no real validation error. See the attached image for some examples of where this is the case.

Attachment: ErrorMessages02.PNG (Downloaded 27 times)

Back To Top PM Quote Reply

 Posted: Mon Nov 3rd, 2008 06:51 am
PM Quote Reply
Ilkka.Salmenius
Administrator


Joined: Wed Aug 8th, 2007
Location: Espoo, Finland
Posts: 455
Status: 
Offline
Could you send that SLP file to me please.

support (at) sisulizer.fi



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Quote Reply

 Posted: Mon Nov 3rd, 2008 11:36 am
PM Quote Reply
Janusz Grzybek
Super Moderator


Joined: Fri Dec 1st, 2006
Location: Zabrze, Poland
Posts: 561
Status: 
Offline
Hello,

You don't need to send your Sisulizer project to us, because I reproduced it with my sample project.

Best,
Janusz



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Quote Reply

 Posted: Mon Nov 3rd, 2008 12:22 pm
PM Quote Reply
Janusz Grzybek
Super Moderator


Joined: Fri Dec 1st, 2006
Location: Zabrze, Poland
Posts: 561
Status: 
Offline
You don't need to send your Sisulizer project to us, because I reproduced it with my sample project.Ignore my previous post, because my placeholder value incorrectly reported as bug has other format, and for this reason your SLP could be useful for us.

Janusz



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Quote Reply

 Posted: Tue Nov 4th, 2008 04:43 am
PM Quote Reply
mdunmill
Member
 

Joined: Tue Nov 13th, 2007
Location:  
Posts: 64
Status: 
Offline
I have sent the project file to support as requested.

Thanks in advance.
Mark

Back To Top PM Quote Reply

 Posted: Tue Nov 4th, 2008 09:00 am
PM Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Tokyo, Japan
Posts: 1641
Status: 
Offline
What is the format function that you use? Your message patterns do not seem to be valid printf/sprinft patterns.

Jaakko



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Quote Reply

 Posted: Sun Nov 9th, 2008 10:52 pm
PM Quote Reply
mdunmill
Member
 

Joined: Tue Nov 13th, 2007
Location:  
Posts: 64
Status: 
Offline
We are using the Windows FormatMessage function.

see http://msdn.microsoft.com/en-us/library/ms679351.aspx

There are certainly some instances where Sisulizer is reporting validation errors correctly. e.g. when %s is in the original and %1 in the translation etc.

However, Sisulizer is getting it wrong with other strings. e.g. when "%%" is in both the original and the translation etc.

See the previous posts for more examples of where Sisulizer is reporting false positives.

From http://msdn.microsoft.com/en-us/library/ms679351.aspx comes the following section on the valid format specifiers.

Within the message text, several escape sequences are supported for dynamically formatting the message. These escape sequences and their meanings are shown in the following tables. All escape sequences start with the percent character (%).





Escape sequence
Meaning

%0
Terminates a message text line without a trailing new line character. This escape sequence can be used to build up long lines or to terminate the message itself without a trailing new line character. It is useful for prompt messages.

%n!format string!
Identifies an insert. The value of n can be in the range from 1 through 99. The format string (which must be surrounded by exclamation marks) is optional and defaults to !s! if not specified. For more information, see Format Specification Fields.
The format string can include a width and precision specifier for strings and a width specifier for integers. Use an asterisk (*) to specify the width and precision. For example, %1!*.*s! or %1!*u!.

If you do not use the width and precision specifiers, the insert numbers correspond directly to the input arguments. For example, if the source string is "%1 %2 %1" and the input arguments are "Bill" and "Bob", the formatted output string is "Bill Bob Bill".

However, if you use a width and precision specifier, the insert numbers do not correspond directly to the input arguments. For example, the insert numbers for the previous example could change to "%1!*.*s! %4 %5!*s!".

The insert numbers depend on whether you use an arguments array (FORMAT_MESSAGE_ARGUMENT_ARRAY) or a va_list. For an arguments array, the next insert number is n+2 if the previous format string contained one asterisk and is n+3 if two asterisks were specified. For a va_list, the next insert number is n+1 if the previous format string contained one asterisk and is n+2 if two asterisks were specified.

If you want to repeat "Bill", as in the previous example, the arguments must include "Bill" twice. For example, if the source string is "%1!*.*s! %4 %5!*s!", the arguments could be, 4, 2, Bill, Bob, 6, Bill (if using the FORMAT_MESSAGE_ARGUMENT_ARRAY flag). The formatted string would then be "  Bi Bob   Bill".

Repeating insert numbers when the source string contains width and precision specifiers may not yield the intended results. If you replaced %5 with %1, the function would try to print a string at address 6 (likely resulting in an access violation).

Floating-point format specifiers—e, E, f, and g—are not supported. The workaround is to use the StringCchPrintf function to format the floating-point number into a temporary buffer, then use that buffer as the insert string.

Inserts that use the I64 prefix are treated as two 32-bit arguments. They must be used before subsequent arguments are used. Note that it may be easier for you to use StringCchPrintf instead of this prefix.


Any other nondigit character following a percent character is formatted in the output message without the percent character. Following are some examples.





Format string
Resulting output

%%
A single percent sign.

%space
A single space. This format string can be used to ensure the appropriate number of trailing spaces in a message text line.

%.
A single period. This format string can be used to include a single period at the beginning of a line without terminating the message text definition.

%!
A single exclamation point. This format string can be used to include an exclamation point immediately after an insert without its being mistaken for the beginning of a format string.

%n
A hard line break when the format string occurs at the end of a line. This format string is useful when FormatMessage is supplying regular line breaks so the message fits in a certain width.

%r
A hard carriage return without a trailing newline character.

%t
A single tab.

Back To Top PM Quote Reply

Current time is 07:54 am  
Localization Tool for VB, Delphi, .NET, C#, VB.NET, XML, Online Help, HTML ... > Technical Support (You need to be registered at the forum to write) > Bugs and Quirks in Sisulizer > Format String Validators firing incorrectly



WowUltra 1.11 Copyright © 2007 by Jim Hale - Based on WowBB Copyright © 2003-2006 Aycan Gulez

Sisulizer software localization tool - Three simple steps to localize