Home Dashboard Directory Help
Search

Resource (.resx) editor should accommodate entering special character sequences by eradicator


Status: 

Closed
 as Won't Fix Help for as Won't Fix


1
0
Sign in
to vote
Type: Bug
ID: 782045
Opened: 3/25/2013 9:31:21 AM
Access Restriction: Public
1
Workaround(s)
view
0
User(s) can reproduce this bug

Description

The Visual Studio (2010, at least) resource editor currently provides no way to enter/edit special character sequences. For example, if one needs defines a string resource such as "Are you sure you want to delete the selected Customer(s)?", the WPF line-breaking algorithm breaks at the left parenthesis, so the string may show up word-wrapped as:

Are you sure you want to delete the selected Customer
(s)?

depending on the width of the display control.

To get it to not break on the left paren, one needs to insert a "word joiner" special character into the string, so that the actual string in the .resx is:

Are you sure you want to delete the selected Customer⁠(s)?

One can manually edit the .resx file to set up the string value as above. However it would be better if the Resource Editor allowed to do this without having to resort to manually editing it (with e.g. Notepad). The Resource Editor instead assumes you literally want "⁠" in the string so it makes the string end up being:

Are you sure you want to delete the selected Customer⁠(s)?
which of course does not display what we want.
Details
Sign in to post a comment.
Posted by eradicator on 4/4/2013 at 8:55 AM
This makes the resource editor effectively unusable, if we have any resource strings that need special sequences in them. I am not pleased with this decision to not do anything about it.
Posted by Microsoft on 4/4/2013 at 8:46 AM
Thanks for reporting this issue and using Visual Studio. Unfortunately, this issue is something we have decided not to address. Since you have identified a workaround, I will be resolving this issue as Won’t Fix. In this case, you can also use a text file as a resource to workaround the issue.

Thanks,
Cathy Sullivan
VS IDE Team
Posted by Microsoft on 3/27/2013 at 12:40 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by eradicator on 3/26/2013 at 7:15 AM
The formatting of the original message and comments are all messed up - it processed my special character sequences here instead of showing the literal sequences I typed, and it lost newlines.

Anyway,
Hopefully the screenshots make it more clear what I am talking about!
Posted by eradicator on 3/26/2013 at 7:11 AM
SIGH - the special sequences I typed into the comment were parsed as special sequences so they don't show up!
The special sequence was & # 8288; (without spaces) - let's see if this shows up!
Posted by eradicator on 3/26/2013 at 7:07 AM
Added 6 screenshots as requested.
1) ResourceEditorString.png - shows adding a resource string using the resource editor and trying to put the special ⁠ sequence into it.
2) IncorrectValue.png - shows what the resource editor actually stored in the .resx file incorrectly. Should have stored ⁠ but stored instead ⁠ (which makes the part of the string literally be displayed as "⁠" instead of being treated as the special word-joiner character that was intended, when displayed in a WPF application on a messagebox or textbox, etc).
3) ManuallyCorrectedValue.png - shows manually editing the .resx file in Notepad to put the desired word-joiner sequence in the string correctly. When edited like this, the string correctly displays in a messagebox/textbox/etc making the "(s)" joined with the "Customer" string so it doesn't split them on multiple lines when it needs to split.
4) CantSeeSpecialSequence.png - shows how the manually edited string shows up in the resource shows up in resource editor. It shows no evidence of the special sequence being in there.
5) EditedAgain.png - shows adding more text to the string resource using the resource editor.
6) EditorDroppedSpecialSequence.png - shows the resulting .resx file after adding more text. It threw away the special sequence I had put in there, making me have to manually tweak it with Notepad again!
Posted by Microsoft on 3/26/2013 at 12:47 AM
Can you create a screen shot and attach it to the bug? The easiest way to do this is to hit the PrtScn button on the keyboard, paste it into Microsoft Paint and save it as a .PNG file.
Posted by Microsoft on 3/25/2013 at 9:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by eradicator on 3/25/2013 at 9:34 AM
Workaround is to manually edit the .resx file with e.g. Notepad to type the special sequences into the string. But then one can likely not edit the string later using the resource editor or it may remove the special sequence or translate it inappropriately so one may need to forever maintain it with Notepad.
File Name Submitted By Submitted On File Size  
CantSeeSpecialSequence.png 3/26/2013 12 KB
EditedAgain.png 3/26/2013 13 KB
EditorDroppedSpecialSequence.png 3/26/2013 8 KB
ResourceEditorString.png 3/26/2013 16 KB
IncorrectValue.png 3/26/2013 8 KB
ManuallyCorrectedValue.png 3/26/2013 7 KB