airbnb / polyglot.js

Give your JavaScript the ability to speak many languages.
http://airbnb.github.io/polyglot.js
BSD 2-Clause "Simplified" License
3.71k stars 208 forks source link

Interpolations of "$$" output a single "$" #128

Closed woahdae closed 5 years ago

woahdae commented 5 years ago

Steps to reproduce:

polyglot = new Polyglot()
polyglot.phrases["a %{foo}"] = "b %{foo}"
polyglot.t("a %{foo}", {foo: '$$'}) // incorrectly returns "b $"

Any combination of interpolating consecutive dollar signs will return Math.ceil(n/2) dollar signs in the resulting string.

woahdae commented 5 years ago

Crap, I thought I was on the latest version, not true. Latest version does not have this issue. Sorry.