blueasysoft / resx-json-typescript-converter

A small tool to generate json-files and a ready-to-use resource manager in typescript from c# *.resx-files.
Other
2 stars 5 forks source link

Do not escape single quotes #5

Closed lexesj closed 11 months ago

lexesj commented 12 months ago

If the translation in the resx contained a single quote, the output json file will contain the single quotes but escaped. I believe this is not intended. This PR removes the escaping of the single quotes.

For example...

Input resx:

<?xml version="1.0" encoding="utf-8"?>
<root>
  <data name="SingleQuoteTranslation" xml:space="preserve">
    <value>This has a 'quote' in  the translation.</value>
  </data>
</root>

Output json:

{
  "en-US": {
    "SingleQuoteTranslation": "This has a \\'quote\\' in  the translation."
  }
}

After applying the fix, the quotes are no longer escaped.

Output json:

{
  "en-US": {
    "SingleQuoteTranslation": "This has a 'quote' in  the translation."
  }
}
lheasysoft commented 11 months ago

Hi @lexesjan

thanks a lot for your PR. It's currently under review and i hope to accept it and update the npm package tomorrow.

lheasysoft commented 11 months ago

Just to notify you: We published the changes in the new 1.0.4 version of the package on npm yesterday. Thanks again for your contribution.

lexesj commented 11 months ago

Aweosme, thank you so much!