View previous topic :: View next topic |
Author |
Message |
hofingerandi
Joined: 29 Nov 2010 Posts: 19
|
Posted: Mon Nov 29, 2010 7:59 am Post subject: .net format strings |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Nov 29, 2010 10:56 pm Post subject: |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Nov 30, 2010 9:28 pm Post subject: |
|
|
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 |
|
|
sheitman
Joined: 27 Apr 2010 Posts: 98
|
Posted: Wed Dec 01, 2010 11:27 am Post subject: |
|
|
Thanks for this tool. It's amazing found 5 strings wich were wrong translated =) |
|
Back to top |
|
|
|