We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm using counterpart together with react translate and I am using it as such:
import counterpart from 'counterpart'; counterpart.translate('TOOLTIP_CHECKBOX')
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?
The text was updated successfully, but these errors were encountered:
@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.
Sorry, something went wrong.
Thanks for responding so quickly, @yanndinendal !
See also #2 and #23. It's a sprintf quirk.
Ok, thanks!
No branches or pull requests
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?
The text was updated successfully, but these errors were encountered: