Closed elusiveunit closed 4 years ago
Note, that it will deviate behavior of gettext from GNU-one.
I'm not too familiar with GNU gettext unfortunately, how is it handled there? Adding a translation for the default locale that's just the same strings?
To be honest, I've never used native GNU Gettext (only their xgettext), so I've studied it through their documentation.
As far as I've understood, in gettext
there is no means to set default locale, since it will be always defined by OS.
It might be worth to go through my notes in this issue https://github.com/alexanderwallin/node-gettext/issues/31
I see! As discussed in your linked issue, it seems locale and message handling is already quite different from GNU gettext and must be so due to different environments. I feel that adding something that isn't really relevant to native gettext anyway should be fine.
Hi @alexanderwallin :v:
would it be possible to have this patch reviewed? We're using your lib in Nextcloud and see many warnings when the lang is set to English as we don't provide translations for the source language (ref #49).
I'm happy to help with the integration if this library is still actively maintained.
Cheers
Holy moly, now this one was left in the attic. Of course we should have this!
Thanks a lot :rocket:
Renamed it to sourceLocale
and published 2.1.0
Not a user here, just came from Google search results for "gettext non-English default". I'm curious, do you support more than two plural forms in ngettext? Assuming that you have ngettext but I can't imaging how would it work otherwise.
Because gettext
developers refused to support non-English defaults https://savannah.gnu.org/bugs/index.php?49598
Since the strings defined in the source are likely in the default language, one should be able use that locale without errors.
setLocale
doesn't have to warn about missing translaitons.I feel that this should be a constructor option rather than a method like
setLocale
, since changing it dynamically shouldn't be needed. This made the tests a bit awkward though, do you want them structured some other way? I'm not really used to OOP testing.