That's when there are no translations installed (english). Here you go:
Code:
def reverse_lookup(translated_string):
if not hasattr(_.__self__, '_catalog'):
return translated_string
if not hasattr(reverse_lookup, 'cache'):
reverse_lookup.cache = {v: k for k, v _.__self__._catalog.items()}
ans = reverse_lookup.cache.get(translated_string, translated_string)
if isinstance(ans, tuple):
ans = ans[1]
return
this handles no translations and also plural forms. And yes the docs of gettext are useless for this, read the source of the gettext.py module instead, its pretty simple.