In the latest ReSharper 2019.3 Early Access Preview (EAP), we have added a new Localization Manager to assist you in localizing applications. It lets you view and edit localizable resources in a single grid, helping you add/edit/rename localizable strings and spot missing localized values.
More than enough for a blog post, so let’s dive in!
We can open the Localization Manager from the Extensions | ReSharper | Windows | Localization Manager menu, or use Go to Action (Ctrl+Shift+A and search for “Localization Manager”).
From here, we can see our solution’s resource files (.resx) and their contents – all in one grid. If we have multiple resource files, their resources will be merged into this grid as well, helping us speed up the localization process.

Granted, the above screenshot doesn’t show a lot yet, so let’s make things more interesting!
Adding resources using the Localization Manager
We’ll start with adding a new localized resource and use it in our code.

Great! We now know how we can add and edit existing localized values from the toolbar.
Adding resources from the editor
How can we convert existing string literals into resources? Well, once we have a resource file in our project, ReSharper will show a suggestion for string literals in our code base, informing us they can be localized.

We can use the context actions (Alt+Enter) to move this string literal into a resource, or use the Move to Resource refactoring (Ctrl+R, O) to quickly convert a string literal into a resource!

We can also use the context action Edit with Localization Manager (Alt+Enter) to open the tool window and select the current resource and its localized versions.

Adding a culture using the Localization Manager
Back in the Localization Manager, let’s add a new culture, say nl-BE, which happens to be my mother tongue. We can do this from the toolbar.

Note how we got code completion for various culture codes, and how a new resource file Labels.nl-BE.resx was created.
Filtering resources
The Localization Manager will display all of our resource files, cultures, and localized values. We can use the filters and search to scope the editor grid to what we want to work with. This ranges from the various resource files in our solution to the cultures to show, which is especially useful if there are a lot of supported cultures in your application.

Import/Export localized values
In case other people are providing translations, resources from the Localization Manager can be imported and exported using CSV files, and copy/pasting from Google Sheets or Microsoft Excel is possible as well.
Spotting missing translations
From the Localization Manager tool window, we can easily spot missing translations and localized values: they will be displayed in a different color.

Note that by clicking the warning icon in the toolbar, we can filter the grid to only show missing localized values.
As a reminder, we can also use ReSharper’s context actions (Alt+Enter) while editing a .resx file to override a resource in a different culture, as well as inspect which cultures already override the selected resource.

Spotting unused resources
When Solution-Wide Analysis (SWA) is enabled, the Localization Manager will scan our entire solution for usages of resources. Resources that are in use are rendered in bold, while unused resources are not.

Having this information allows us to clean-up resources we may have used in the past but aren’t using anymore. If would like to double check whether a resource can be removed safely, there’s the Safe Delete refactoring which we will cover next.
Refactoring resources: Rename and Safe Delete
So far, we have seen how we can add and edit resource values. But how can we rename a resource? And how do we safely delete a resource, making sure it’s no longer being used in our application? The Localization Manager comes with two refactorings that do exactly that!
From the toolbar, we can click the Rename resource button and provide a new name. When we continue, ReSharper will rename our resource across all cultures (and .resx files), and update all usages in the code in one go.

With Safe Delete, ReSharper will verify a resource can be deleted without breaking existing code. It will tell us when there are usages left, so we can take action.

We can also refactor resources from the editor, either from inside a resource file or from our code, by either using the Rename/Delete refactorings directly, or using Refactor This… (Ctrl+Shift+R).

Note that we can also move and inline resources from here.
Download ReSharper 2019.3 EAP now! We would love to hear what you think about the new Localization Manager!
Finally!! Great stuff and thank the team for me!
Perfect, I’m looking forward. Good job guys.
Awesome! Will this be available for Rider as well?
Yes, it will, in one of the future releases next year.
This is absolutely beautiful! Seriously!
Per chance, is there the possibility of JSON support for localizing web assets on the product roadmap?
Yes, we plan to fully support asp.net localization scenarios including JSON
Hello,
I am working with WinForms and it thinks that I should translate images as well.
Those are also project resources, but should probably be excluded.
Hello,
Yep, we already implemented additional filter, and we will release it in 2019.3.1 with some other fixes.
Yes, I agree with Dmitri. Please add some filter so we would able to include only text.
Nice addition. If the Move to Resource could allow input for all the cultures, it would be useful. It would allow to enter the translations as there are created.
Can it sort the RESX file alphabetically by key? Our team currently uses the ResX Manager VS extension for this but I would love to jump ship.
Do you mean file group key or resource name?
Now it sorting resources by name, but we plan to add “Sort by Group” mode in one of future bugfix releases.
Great addition to the ReSharper toolset! I love it so far, but I’ve noticed a small downside to it. For big resource files, the manager becomes really slow (while it tries to read resources, Visual Studio freezes completely).
Is there any plan to “page” the resources shown in the manager? It would be very useful to show something like 200 entries at a time and change pages when needed while still being able to make a global search.
Hi, Eric!
It already uses paging and data virtualization, but has bug which can cause such freezes.
We already fixed it and will ship it in one of next bugfix releases of 2019.3.
If you want to test fixed version with your resource files feel free to contact me (andrew.vasilyev[at]jetbrains[dot]com) and i will send you private build.
A really useful feature – Thanks
For any missing cultures could you get it to fetch the translation from Google or others? That would be the icing on the cake so to speak
Thanks for the feedback! Feel free to vote for this issue – https://youtrack.jetbrains.com/issue/RSRP-475407