leonelquinteros / gotext

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

Remove plural default in Po Gets #8

Closed segeschecho closed 7 years ago

segeschecho commented 7 years ago

Return singular or plural (by checking N) instead of plural form by default.

GetN and GetNC functions both have plural and singular strings available and the "n" to determine which one to return.

It doesn't seem natural to expect a default plural string when it wasn't possible to translate the string.

leonelquinteros commented 7 years ago

@segeschecho Thanks for the report!

It also matches the behaviour of the original ngettext as described in the docs: https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html

... If no message catalog is found msgid1 is returned if n == 1, otherwise msgid2.

I've pushed a fix for it and make it a release soon.

segeschecho commented 7 years ago

@leonelquinteros Thank you !