How to use Resharper to localize XAML strings

I use Reshaper 5.1.1 to extract strings to resource files in my Silverlight app. I want to be able to extract strings in my XAML (like Content or Text properties) - but the Move option under Resharper is never enabled when I am viewing XAML. It does not identify possible text strings for extraction.

I have done extensive searching but can't seem to find much about R# and localizing XAML files. Is it possible, and how can I enable it? (I checked all my settings and there's nothing about XAML and resources).



Thanks
12 comments
Comment actions Permalink

ReSharper 'Move to resource' is available in XAML only for WPF application.

0
Comment actions Permalink

Wow, is that right? I thought it was for XAML, not WPF. Any idea if Silverlight will be supported - localizing my SL was one of the prime reasons I wanted to buy R#...

0
Comment actions Permalink

SL doesn't have x:static markup extension and Microsoft suggests to use Bindig to StaticResource with custom NONSTATIC wrapper around generated by custom tool STATIC wrapper. IMHO the best solution - create custom tool that will generate NONSTATIC wrapper for resx file like this. I added issue into our bug tracker RSRP-200040

0
Comment actions Permalink

Thanks for your quick response - I'd really like to see XAML Silverlight localization support ASAP...

0
Comment actions Permalink

Hi,

I'm trying to establish the localization process for the application we're currently developing and Resharper seems mighty powerful for this.

I'm struggling with exporting strings that are hardcoded in WPF XAML files to resource files. When the string is selected, CTRL+SHIFT+R is being clicked and Move to resource being selected, the localization window shows up displaying 'Error while initializing' 'This project does not contain an available resource file. From the c# code everything works fine.
Can you tell me what I'm missing in order to have the needed resource files being imported?

0
Comment actions Permalink

A WPF project (or referenced project) should have PUBLIC resource. Open .resx file by "Managed Resources Editor" and set "Access Modifier" to "Public".

0
Comment actions Permalink

Thanks a lot for the quick reply, that was it! Changing the visibility from internal to public made the trick.
Now it doesn't make sense to me why the access to internal resource files from c# code works, but not from the XAML part which belongs to the same class as the c# part. I'd rather keep the resource visibility to internal; no need to expose them. Is this intended behaviour?

0
Comment actions Permalink

We use x:static markup extension for binding to a resource item. Unfortunately x:static works only with public types.

0
Comment actions Permalink

I think I've encountered a bug

The following examples are real cases encountered while localizing my app.

If exporting string to resource from c# code, the propsed name looks like this:
'VMessageFiltering_messageDetailView_RequestEditingOperation_There_are_no_more_requests_to_be_manually_corrected_after_this_one'

exported from XAML like that:
'MessageFilteringInfoViewSipMessageDetail_???_Request locked by'
Notice the spaces in the name? If next is being clicked an invalid resource name is being created, but can't be used.

It seems special characters aren't being replaced when exporting to resource from XAML

0
Comment actions Permalink

Hi,

Can you tell me if this is going to be in the R# 6.0 beta or EAP builds? Thanks

0
Comment actions Permalink

Hello Rodney,

We're currently discussing if this problem can be addressed in ReSharper
6.0. I will let you know as soon as we come to a conclusion. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi,

Can you tell me if this is going to be in the R# 6.0 beta or EAP
builds? Thanks

---
Original message URL:
http://devnet.jetbrains.net/message/5291746#5291746



0
Comment actions Permalink

Thanks, I really hope it will be - there is not many other products that can do this...

0

Please sign in to leave a comment.