Skip to content
New issue

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

Error: [sprintf] % #2

Closed
dmmalam opened this issue Apr 2, 2014 · 1 comment
Closed

Error: [sprintf] % #2

dmmalam opened this issue Apr 2, 2014 · 1 comment

Comments

@dmmalam
Copy link

dmmalam commented Apr 2, 2014

Hey, nice library.

How do I escape a % in the actual string, ie

c=require('counterpart')
c.registerTranslations('en', {'hello':'100%'})
c('hello')

Error: [sprintf] %
    at Function.str_format.parse (~/code/counterpart/node_modules/sprintf/lib/sprintf.js:233:11)
    at str_format (~/code/counterpart/node_modules/sprintf/lib/sprintf.js:77:48)
    at interpolate (~/code/counterpart/index.js:219:10)
    at translate (~/code/counterpart/index.js:140:13)
    at repl:1:2
    at REPLServer.self.eval (repl.js:112:21)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.EventEmitter.emit (events.js:117:20)
    at Interface._onLine (readline.js:202:10)
    at Interface._line (readline.js:531:8)
@dmmalam
Copy link
Author

dmmalam commented Apr 2, 2014

ah, it's just %%, standard sprintf.

@dmmalam dmmalam closed this as completed Apr 2, 2014
dtygel pushed a commit to coletivoEITA/counterpart that referenced this issue May 15, 2017
Change default separator to uncommon character instead of common dot (.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant