How can I get Resharper to shove format strings into the resource file? I have a MessageBox dialog that displays dynamic information like so:
MessageBox.Show(
string.Format(
"You have purchased '{0}' ({1}). Currently, the value of {0} is {2:C}/ share.",
stock.Symbol, stock.CompanyName, stock.ValuePerShare), Resources.FrmMain_btnVoting_Click_Vote_Purchase, MessageBoxButtons.OK, MessageBoxIcon.Information);
Note that the caption was easily localized to a resource file by Resharper, but I can't even get the option for the message body. Does the format markup automatically make this string non-localizable? I wouldn't think so. I'd hate to have to write my own code to work with the resource file if I can figure out how to make Resharper just send it there like it did for the other string.
If you want to localize the message you can use the Move To Resource refactoring by pressing Ctrl+R, Ctrl+O after cursor was set on message string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With