PyHamcrest icon indicating copy to clipboard operation
PyHamcrest copied to clipboard

Internationalization (I18N)

Open domi41 opened this issue 4 years ago • 2 comments

Hello !

Any plans for I18N of hamcrest ?

      Assertion Failed: 
      Expected: <32>
           but: was <2>

I see that some of the tests rely on parsing the error message in english.

Are there any pitfalls or caveats I should be aware of? Suggestions of L10N implementation? (like the format of the language files)

Rationale for I18N

Behavior-Driven with Gherkin feature files, using hamcrest for assertions in steps. The output of the runner will be read by everyone, including the informatically illiterate and monoglot.

domi41 avatar Apr 30 '20 04:04 domi41

Interesting idea - but I'm not sure we would have the community support to provide and maintain the translations. If anyone has any ideas, I'm all ears.

brunns avatar Apr 30 '20 05:04 brunns

The Assertion Failed message comes from the AssertionError itself, right? I can't find useful information on how to I18N python's built-in exceptions.

Should we use our own, extended AssertionError ? Is there another way ?

domi41 avatar Apr 30 '20 09:04 domi41