Say Hello To Localization Manager In Rider 2020.2
Hello friends, or should we say こんにちは (Kon’nichiwa)? We have some excellent news for our multilingual Rider developers. Localization Manager, which previously appeared in ReSharper, is now available to all Rider users. We can build multi-cultural .NET applications, with the localizable resources using the new feature.
To get started with the Localization Manager, we first need to add a resource file. In this post, we’ll be using a
Greetings.resx file along with a
Greetings.ja-jp.resx to hold our Japanese translations.
To open the resource editor, we can use Go to Action (Ctrl+Shift+A) and search for "Localization Manager." Once open, we can see the layout. On the left-hand pane, we can see our project along with all of our resource files and their target culture. On the right-hand side, is our editor pane. In the editor pane, we can add new resources, edit existing ones, and see cultural values side by side.
Adding Resources using Localization Manager
We’ll start by adding a new localized resource to use in our code.
Great! We’ve added our first localized value using the localization manager editor.
Adding Resources from the Text Editor
Like other features in Rider, many of the same GUI actions can be performed via quick-fixes and suggestions directly from our code. When adding a string literal to our code, Rider will suggest localizing the value by adding it to our resource file.
We can use the context action to move the string literal into a resource for quick and efficient operation.
Quick actions also allow us to open the editor window from any existing resource found in our code. With the cursor over our resource string, we can invoke the action Edit with Localization Manager to open the tool window and highlight the current value.
Adding a Culture using the Localization Manager
Translations are like potato chips (or crisps if you’re British) – you can’t just have one. We can add more cultures from the editor window using the "+" icon located in the left-hand pane’s toolbar. Thankfully, Maarten is a native Belgian and agreed to help me translate my app.
Note how we got code completion for various culture codes, and how a new resource file
Labels.de-BE.resx was created.
The localization manager will help us manage our resource files, cultures, and localized values. Using the editor, We can use the filters and search to scope the editor grid to the cultures we are working with. This is especially useful as we begin to handle more cultures.
Import/Export Localized Values
Commonly, we need to lean on professional translators to get the nuances and idioms of a language correct. Translators work with tools like Google Sheets and Microsoft Excel to edit spreadsheets and are unlikely to be using a tool like Rider. Luckily for us, Rider supports importing and exporting localized values into a CSV format.
Spotting Missing Translations
From within the Localization Manager tool window, we can easily spot missing translations for localized values as the cell is highlighted with a different color.
We can also use the editor toolbar to filter to missing values, show comments, and navigate to resource files.
When editing a
.resx file, we can see the resource topology and whether the value is overriding a parent resource value.
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.
Knowing what resources are being utilized helps us clean up resources we may no longer require. Knowing whether a resource is used is also useful for our next feature.
Refactoring Resources: Rename and Safe Delete
Adding resources can be simple, especially when using the Localization Manager. Removing and refactoring can cause breakage and hours of lost productivity… If you aren’t using Rider, that is.
The localization features in Rider allow us to Safe Delete resources. Rider will verify a resource can be deleted without breaking our existing code using the same analysis tools we all know and love.
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.
Software is about changing people’s lives, and with the Localization Manager, we can reach more folks. As always, thank you for reading. ありがとうございました (Arigatōgozaimashita).
Download Rider 2020.2 now! We hope you give it a try, and we would love to hear what you think about the new Localization manager!
Subscribe to Blog updates
Thanks, we've got you!
Another Look into the Future with Rider’s Predictive Debugger
In the 2023.2 release cycle, we’ve introduced the Predictive Debugger in ReSharper, which gives you predictions about code paths and variables beyond the current execution pointer. We’ve written extensively about its advantages compared to alternative debugging strategies like thorough thinking, log…
The Developer Ecosystem in 2023: Key Trends for C#
We’ve captured insights from 26,348 developers worldwide in our annual Developer Ecosystem Survey 2023. This recap focuses on C# and .NET, but you can see what’s trending in other languages as well. Enjoy the results and commentary, and let us know what you think! Top Discoveries We know t…
The ReSharper 2023.3 Release Candidate Is Now Available
Get a preview of all the latest features and improvements set to be shipped with the next major ReSharper and .NET tools releases by downloading the Release Candidate builds that have just landed. Here are the major improvements in each of the new builds: The ReSharper 2023.3 Release Can…
The Rider 2023.3 Release Candidate Is Now Available
There’s only a few days left before the next major release for Rider! Don’t feel like waiting? Get a sneak peek of Rider 2023.3 now by downloading the Release Candidate build that has just landed on our website. The Release Candidate build contains all of the notable changes that we’ve introduc…