I'm working in a python library that is going to be used by Brazilians, the official speak language here is Portuguese! Basically, I want to get the Exception messages in portuguese, for example:
Instead of get...
>>> float('A')
ValueError: could not convert string to float: A
I wanna get this...
>>> float('A')
ValueError: não é possível converter a string para um float: A
Is there any way to do it?
try
andexcept
clause where you then literally display your own (portugese) message – Protolithicexcept
is definitely not the way to go if the goal is all the Errors. I do think that Python strongly discourages this level of localization however. – Protolithic$LANGUAGE
, such as bash, GNU coreutils (cp
,rm
,ls
, etc), even--help
is translated, so why not Python? – Diligentgettext
module to i18n software, why doesn't it use such tools to i18n itself? – Diligent