Japanese (speaking) developer needed for a bit of regex magic
ben+python at benfinney.id.au
Wed Apr 21 13:28:04 CEST 2010
Sebastian <basti at redtoad.de> writes:
> My regular expressions turn the Amazon error messages into Python
> This works fine as long as they are in English: "??? is not a valid
> value for BrowseNodeId. Please change this value and retry your
> request.", for instance, will raise an InvalidParameterValue
> exception. However, the Japanese version returns the error message
> "??? は、BrowseNodeIdの値として無効です。値を変更してから、再度リクエス
> トを実行してください。" which will not be successfully handled.
> This renders the my module pretty much useless for Japanese users.
Your problem, then, appears to be that you're attacking the issue at the
wrong layer. Parsing messages in natural language and hoping to
reconstruct a structure is going to be an exercise in frustration.
Doesn't the API have defined response codes and parameters that you can
use, instead of parsing error strings in various natural languages?
\ “Giving every man a vote has no more made men wise and free |
`\ than Christianity has made them good.” —Henry L. Mencken |
More information about the Python-list