|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Tranlating errors to another language...Hi All,
I see that there are hard coded error messages in English in the error handling withing the iTextSharp. In example if I have invalid PDF file and try to use PdfReader class to read that file, System.IO.IOException gets thrown. Now it does indeed have message in English that file has invalid PDF header. This is thrown from PRTokeniser. This is however quite unsuitable to be shown to end-user or used to automatically detect that this is not PDF document. I would propose that all throwed exceptions in this class (and elsewhere where applies) would use specific iTextSharp exception class that provides more easily analyzed information that can be used to translate to different languages. Thanks, Vesa Jääskeläinen ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ itextsharp-questions mailing list itextsharp-questions@... https://lists.sourceforge.net/lists/listinfo/itextsharp-questions |
|
|
Re: Tranlating errors to another language...There's work being done in error localization and some new exception types
wouldn't hurt either. Paulo ----- Original Message ----- From: "Vesa Jääskeläinen" <chaac@...> To: <itextsharp-questions@...> Sent: Saturday, August 08, 2009 1:48 PM Subject: [itextsharp-questions] Tranlating errors to another language... > Hi All, > > I see that there are hard coded error messages in English in the error > handling withing the iTextSharp. > > In example if I have invalid PDF file and try to use PdfReader class to > read that file, System.IO.IOException gets thrown. Now it does indeed > have message in English that file has invalid PDF header. This is thrown > from PRTokeniser. This is however quite unsuitable to be shown to > end-user or used to automatically detect that this is not PDF document. > > I would propose that all throwed exceptions in this class (and elsewhere > where applies) would use specific iTextSharp exception class that > provides more easily analyzed information that can be used to translate > to different languages. > > Thanks, > Vesa Jääskeläinen ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ itextsharp-questions mailing list itextsharp-questions@... https://lists.sourceforge.net/lists/listinfo/itextsharp-questions |
|
|
Re: Tranlating errors to another language...Hi Paulo,
I noticed that SVN version indeed now has this localization support. Thanks for this extra exception class usage I can detect the situation a bit more easier. InvalidPdfException could be easily extended to have enum about error types. Something like: try { throw new InvalidPdfException(EPdfHeaderMissing, MessageLocalization.GetComposedMessage("PRTokeniser.pdf.header.not.found")); } catch(InvalidPdfException e) { switch(e.GetPdfError()) { case EPdfHeaderMissing: ... break; ... } } What do you think about this? I can try to bake a patch if you prefer it that way? Thanks, Vesa Jääskeläinen Paulo Soares wrote: > There's work being done in error localization and some new exception types > wouldn't hurt either. > > Paulo > > ----- Original Message ----- > From: "Vesa Jääskeläinen" <chaac@...> > To: <itextsharp-questions@...> > Sent: Saturday, August 08, 2009 1:48 PM > Subject: [itextsharp-questions] Tranlating errors to another language... > > >> Hi All, >> >> I see that there are hard coded error messages in English in the error >> handling withing the iTextSharp. >> >> In example if I have invalid PDF file and try to use PdfReader class to >> read that file, System.IO.IOException gets thrown. Now it does indeed >> have message in English that file has invalid PDF header. This is thrown >> from PRTokeniser. This is however quite unsuitable to be shown to >> end-user or used to automatically detect that this is not PDF document. >> >> I would propose that all throwed exceptions in this class (and elsewhere >> where applies) would use specific iTextSharp exception class that >> provides more easily analyzed information that can be used to translate >> to different languages. >> >> Thanks, >> Vesa Jääskeläinen > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > itextsharp-questions mailing list > itextsharp-questions@... > https://lists.sourceforge.net/lists/listinfo/itextsharp-questions ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ itextsharp-questions mailing list itextsharp-questions@... https://lists.sourceforge.net/lists/listinfo/itextsharp-questions |
|
|
Re: Tranlating errors to another language...Please provide a patch, it's most welcome.
Paulo > -----Original Message----- > From: Vesa Jääskeläinen [mailto:chaac@...] > Sent: Saturday, September 05, 2009 7:12 PM > To: Post all your questions about iTextSharp here > Subject: Re: [itextsharp-questions] Tranlating errors to > another language... > > Hi Paulo, > > I noticed that SVN version indeed now has this localization support. > Thanks for this extra exception class usage I can detect the > situation a > bit more easier. > > InvalidPdfException could be easily extended to have enum > about error types. > > Something like: > > try > { > throw new InvalidPdfException(EPdfHeaderMissing, > MessageLocalization.GetComposedMessage("PRTokeniser.pdf.header > .not.found")); > } > catch(InvalidPdfException e) > { > switch(e.GetPdfError()) > { > case EPdfHeaderMissing: > ... > break; > ... > } > } > > What do you think about this? > > I can try to bake a patch if you prefer it that way? > > Thanks, > Vesa Jääskeläinen > > Paulo Soares wrote: > > There's work being done in error localization and some new > exception types > > wouldn't hurt either. > > > > Paulo > > > > ----- Original Message ----- > > From: "Vesa Jääskeläinen" <chaac@...> > > To: <itextsharp-questions@...> > > Sent: Saturday, August 08, 2009 1:48 PM > > Subject: [itextsharp-questions] Tranlating errors to > another language... > > > > > >> Hi All, > >> > >> I see that there are hard coded error messages in English > in the error > >> handling withing the iTextSharp. > >> > >> In example if I have invalid PDF file and try to use > PdfReader class to > >> read that file, System.IO.IOException gets thrown. Now it > does indeed > >> have message in English that file has invalid PDF header. > This is thrown > >> from PRTokeniser. This is however quite unsuitable to be shown to > >> end-user or used to automatically detect that this is not > PDF document. > >> > >> I would propose that all throwed exceptions in this class > (and elsewhere > >> where applies) would use specific iTextSharp exception class that > >> provides more easily analyzed information that can be used > to translate > >> to different languages. > >> > >> Thanks, > >> Vesa Jääskeläinen Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ itextsharp-questions mailing list itextsharp-questions@... https://lists.sourceforge.net/lists/listinfo/itextsharp-questions |
| Free embeddable forum powered by Nabble | Forum Help |