skip to Main Content

I have the following in my intl_en.arb file:

"title_chef_selection": "Chef's Selection",
"@title_chef_selection": {},

And I get this error: Error: Unbalanced escape quotes. To escape a single quote ', prefix it with another single quote.(mismatched_brackets)

I followed it’s advice changing it to this:

"title_chef_selection": "Chef''s Selection",
"@title_chef_selection": {},

This shows two single quotes in Text(S.of(context).title_chef_selection)

I just tried this one:

"title_chef_selection": "Chef's Selection",
"@title_chef_selection": {},

I get this error: Invalid escape character in string.json(261), but it works and the text shows properly. Is there a different way of doing it or a way to get rid of the error?

2

Answers


  1. Single quotes need not be escaped in JSON. Only double quotes needs to be escaped. This might be due to the issue in some other line. Will you be able to share the whole code

    Login or Signup to reply.
  2. I solved disabling the Arb extension in Visual Studio Code.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search