stevencohn / ResxTranslator

Automates the translation of resx files using throttled access to the Google Translation API
MIT License
20 stars 5 forks source link

EDIT comment not working #7

Open scottdorman opened 5 months ago

scottdorman commented 5 months ago

This may be due to newer versions of Visual Studio, but it appears that the "EDIT" comment support isn't working anymore. In Visual Studio 2022 (running community edition, and haven't tested this in any other versions or editions), comments are stored in the regex XML as all lowercase, so the Contains("EDIT") calls always return false.

This affects the following call sites:

https://github.com/stevencohn/ResxTranslator/blob/725492d1c7b75cca136c37ec1d64ff53f9169947/Translator.cs#L358 https://github.com/stevencohn/ResxTranslator/blob/725492d1c7b75cca136c37ec1d64ff53f9169947/Translator.cs#L481

and may also affect the REGEX at https://github.com/stevencohn/ResxTranslator/blob/725492d1c7b75cca136c37ec1d64ff53f9169947/Translator.cs#L468

If you retarget this to .NET 5.0+, you can use an overload on Contains that takes a StringComparison parameter.

scottdorman commented 5 months ago

I can manually edit the XML to change the comment to uppercase, which works around the issue but is counterproductive.

stevencohn commented 4 months ago

Sorry I just saw this. I keep VS updated and haven't seen this but I'll take a look. Thanks