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

Wrong handling of deleting strings with comment #571

Open
42-MM opened this issue Jul 19, 2023 · 2 comments
Open

Wrong handling of deleting strings with comment #571

42-MM opened this issue Jul 19, 2023 · 2 comments

Comments

@42-MM
Copy link

42-MM commented Jul 19, 2023

Delete the German string for "Yes" with the ResX Manager.

Works well for entries without a comment. The ResX Manager deletes the <data> node:

<data name="Yes" xml:space="preserve">
   <value>Ja</value>
</data>

But when the German stings has a comment the string is set to an empty string:

<data name="Yes" xml:space="preserve">
   <value>Ja</value>
   <comment>My sample comment.</comment>
</data>

deleting of "Ja" results in:

<data name="Yes" xml:space="preserve">
   <value></value>
   <comment>My sample comment.</comment>
</data>

In this case the fallback mechanism of the resource manager does not work, because the string is an empty string but it should be null.

@tom-englert
Copy link
Collaborator

It's the same behavior as the VS internal resource editor. Any deviation from the default behavior may result in inconsistencies.

Dropping the <value> element is not an option, since then it won't compile any longer. (Error MSB3103 Invalid Resx file. System.NotImplementedException: User-facing error for bad resx that has child elements but not value)

Tried to apply xsi:nil, but that didn't work either.

Any ideas how to fix this?

@42-MM
Copy link
Author

42-MM commented Jul 24, 2023

Thanks for your investigation!

Strange, when I remove the <value> it compiles but the Visual Studio Resource Editor fails. But you are right, only removing the <value> node is not a good idea.

With a German <value> node:

grafik

After removing the <value> node:

grafik

The Visual Studio Resource Editor shows an exception:

grafik

I have no ideas for a fix.

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

2 participants