question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Special characters not supported as argument to __

See original GitHub issue

Hi,

It seems like some special characters are not supported as argument to __. They are replaced with a character code instead. For example, / is replaced with / and " is replaced with ".

Steps to reproduce :

index.js

const i18n = require('i18n')

i18n.configure({
    directory: path.join(__dirname, 'translations'),
})

console.log(i18n.__({ phrase: "test", locale: "en" }, { var: '/' }))
console.log(i18n.__({ phrase: "test", locale: "en" }, { var: '"' }))

translations/en.json

{
    "test": "{{var}}"
}

Version in package.json : "i18n": "^0.13.2"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mashpiecommented, Dec 15, 2020

please try with {{{var}}} - read https://github.com/mashpie/i18n-node#how-about-markup

It’s related to how mustache escapes any input. Tripple {{{}}} disables that.

0reactions
juicycool92commented, Jul 24, 2022

@juicycool92 you mean like https://github.com/mashpie/i18n-node#how-about-markup?

yes!.. Oof sorry for not read document properly

Read more comments on GitHub >

github_iconTop Results From Across the Web

Characters allowed in GET parameter - Stack Overflow
The characters allowed in a URI are either reserved or unreserved. Reserved characters are those characters that sometimes have special meaning, but they...
Read more >
Special characters not allowed in parameters name - Support
Hello, Would it be possible to allow the use of special characters in the parameters names ? As special I mean “?
Read more >
Errors using special characters in Access databases - Office
Lists the special characters to avoid using when you work with the database object names or the field names in all versions of...
Read more >
Using special characters for arguments with the CONNECT ...
The CONNECT statement which uses special characters in a password or any other parameter must be quoted in its final form.
Read more >
1.3.2.1.2 Using Special Characters in Parameter Values
If a parameter value contains a special character, then the special character must be preceded by a backslash or the entire parameter value...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found