PyHamcrest icon indicating copy to clipboard operation
PyHamcrest copied to clipboard

Sketch an implementation of I18N.

Open domi41 opened this issue 4 years ago • 6 comments

Related: #143

  • Using global. (help!)
  • The locales files are in src/hamcrest/core/locale.py for now. What to do with them?

More commits will follow.

Expected behavior:

If locale is set and translation exists, replace. Otherwise, do nothing.

This way we don't have to support all locales from the get-go, nor do we need to 100% support each locale.

DO NOT MERGE

domi41 avatar Apr 30 '20 08:04 domi41

Coverage Status

Coverage remained the same at 0.0% when pulling c907ad7f30b9be42e07a4570004dea1ebbe6b962 on domi41:hack-i18n into 632840d9ffe7fd4e9ea9ad6ac1db9ff3871cb984 on hamcrest:master.

coveralls avatar Apr 30 '20 08:04 coveralls

Coverage Status

Coverage remained the same at 0.0% when pulling eb4d2bd987da12f81bb92ccde1fe74340794805e on domi41:hack-i18n into 632840d9ffe7fd4e9ea9ad6ac1db9ff3871cb984 on hamcrest:master.

coveralls avatar Apr 30 '20 08:04 coveralls

Should we use gettext ?

domi41 avatar Apr 30 '20 12:04 domi41

Should we use python-i18n ?

domi41 avatar Apr 30 '20 12:04 domi41

python-i18n looks reasonable - but do wait for some input from @offbyone before putting too much time into this, I suggest.

brunns avatar Apr 30 '20 12:04 brunns

OTOH, using gettext would avoid adding an additional runtime dependency. A complete guide to i18n in Python looks like a reasonable approach.

brunns avatar Apr 30 '20 12:04 brunns