Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

.net format strings

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support
View previous topic :: View next topic  
Author Message
hofingerandi



Joined: 29 Nov 2010
Posts: 19

PostPosted: Mon Nov 29, 2010 7:59 am    Post subject: .net format strings Reply with quote

Hi,

consider the case where a format string should be translated.
The usage in the program is e.g. as follows
Code:
MessageBox.Show(string.Format("File {0} not found", filename));

Now by accident, the translator corrupts the braces in the format string, such that in effect the program executes
Code:
MessageBox.Show(string.Format("Die Datei {0) konnte nicht gefunden werden", filename));

This code will cause an exception at runtime:
Quote:
System.FormatException: Input string was not in a correct format.

As you can imagine, such a message box could handle a very rare situation, which is not covered in standard UI-tests.

Is there any possibility to automatically detect format string errors (of course this would require the developer to mark a string as format string).

Regards
Andreas
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Nov 29, 2010 10:56 pm    Post subject: Reply with quote

In the next major release of Globalizer.NET we plan to incorporate a validation function that will enable you to detect this sort of issue. One of our users and translators has actually developed a small tool that parses Globalizer.NET files and does this with the current version. I will check if they are willing to share this and get back to you.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Nov 30, 2010 9:28 pm    Post subject: Reply with quote

Daniel Camenzind has kindly allowed us to share his checking application. You can download it from:

www.infralution.com/downloads/GlobalizerLanguageCheck.zip

Daniel noted in his reply to us:

Quote:
I think that customer is German – based on the example he made. If they set ShowInvariantEnglishTab to true in the cnfg file, there will be another tab that compares the Invariant and English language items. Since English is not our native language, we let somebody from our brand in the USA check it. He does it in the English column, not directly in the Invariant, because I think he can’t edit the Invariant with the Translator Edition.

_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
sheitman



Joined: 27 Apr 2010
Posts: 98

PostPosted: Wed Dec 01, 2010 11:27 am    Post subject: Reply with quote

Thanks for this tool. It's amazing found 5 strings wich were wrong translated =)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group