Closed yanndinendal closed 8 years ago
I added support for $ npm test
, because it took me a while to find how to launch the tests as I didn't see the Makefile. ^^
@yanndinendal I'm happy to accept this but could you add another assertion to your test for when the key looks like foo..bar
?
Thanks @martinandert. :)
I wrote the tests, but I'm not sure that's the expected result: a70bba1.
I will try to only keep the last trailing dot in a new patch.
@martinandert : ok, now that looks better: 2a9fb3f. :)
What do you think?
And the final squashed commit: 891cc57.
Thanks! I've just released a new patch version. Enjoy!
@martinandert : Great! Thanks. :)
We use gettext-style translation keys (the translation key is the full text in the source lang), but prefixed with the default Counterpart's separator (
.
), so we encountered a bug when a translation key is a sentence that ends with a dot. The translation is never found.As I saw in the code that it might have been intentional to treat the last separator as a real superfluous separator, this PR implements this with an option. But if you are ok to always keep the last dot (or other separator) as being part of the key, I can remove that setting (
_registry.keepTrailingDot
).If you want to keep this as a setting and are ok with this PR, I can add a getter and a setter like you do for other
_registry
params. Also, I'm open to other suggestions for that param's name.I added a test, but I was not sure if it was the right place, tell me if it's ok like this.