Closed sleepy-angio closed 7 years ago
@sleepy-angio : Yes, the %
should be escaped as it's the format placeholder (https://en.wikipedia.org/wiki/Printf_format_string#Format_placeholder_specification).
So you should write %%
instead (https://en.wikipedia.org/wiki/Printf_format_string#Type_field) (to "[print] a literal % character").
So:
const TOOLTIP_CHECKBOX = "About 25%% of people...";
and the double percent should be kept as-is in all translations.
Thanks for responding so quickly, @yanndinendal !
See also #2 and #23. It's a sprintf quirk.
Ok, thanks!
I'm using counterpart together with react translate and I am using it as such:
import counterpart from 'counterpart';
counterpart.translate('TOOLTIP_CHECKBOX')
if the TOOLTIP_CHECKBOX equals "About 25% of people..." the %-character will cause
SyntaxError: [sprintf] unexpected placeholder
Anybody know how to solve this?