leonelquinteros / gotext

Go (Golang) GNU gettext utilities package
Other
434 stars 58 forks source link

Add variants of Get functions with existence checks #41

Closed golightlyb closed 4 years ago

golightlyb commented 4 years ago

Currently, a translation that doesn't exist just defaults to the passed message ID.

It can be helpful to be able to catch these missing cases e.g. to save to a log.

This PR implements variants ending in 'E' like GetE, GetNE.

This wasn't implemented at the package-level scope, because for quick translations like that the extra flexibility probably isn't needed.