Quantcast
Channel: ResX Resource Manager
Viewing all articles
Browse latest Browse all 2435

Updated Wiki: Documentation

$
0
0

Installation

Visual Studio Extension

Use the Visual Studio Extension Manager (search for RESX), install from the Visual Studio Galery, or download the binaries and double click the ResXManager.VSIX.vsix

Standalone

Run the ClickOnce installer from the Downloads page.

Usage

Visual Studio Extension

ResX Resource Manager Extension can be found in the Tools and in the View|Other Windows menus of Visual Studio. The window will show all ResX based resources in the active solution. Navigating to a resource in the Solution Explorer will automatically select the resource in the ResX Resource Manager. If you are using an integrated SCM, files will be checked out as you type.

Extension.png

Standalone

Start the ResX Resource Manager and select a directory (usually the solutions directory) in the applications main menu. The window will show all ResX based resources in the directory and all sub directories. It will simply group the resources by the nearest project file in the directory tree; no solution will be parsed, so if you don't have a clean directory, orphan or stale copies of resource or project files will appear in the list as well.

Standalone.png

All versions

When you select a resource file, all entries and their translations will be displayed in an editable grid. The first column displays the resource key, the second column the neutral resource, continued by one column per localized language.
You can add new languages and easily add translations by simply typing the localized string in the new columns that appear in the ResX Resource Manager. All entries will be created as you type.

Empty, untranslated entries are marked red, so they are easy to find; you can also sort the columns by clicking the header of any column to move all empty entries to the top. This project has integrated the Data Grid Extensions, so you can simply filter columns to search the view for something special to translate or verify.

Detect code references

DetectCodeReferences.png

This feature helps finding orphan strings that are no longer used. If enabled it shows a new column beside the key, displaying the count of possible references to this key found in code. If you hover the mouse over the column, a tool tip shows the location and context of the detected reference.
The engine does not fully parse the source code, but is using a simple text look up algorithm searching for several patterns like ResourceFile.ResourceKey or ResourceFile->ResourceKey; it may also count references in commented code, or maybe other occurrences of any of the patterns, so even if a resources count is greater than zero it may not be used.
On the other hand it will not find indirect references like ResourceFile["ResourceKey"] or even ResourceFile["Resource" + "Key"]. So be aware that a count of zero is no guarantee that this resource is not used; e.g. resources of localized WinForms controls always have a count of zero!

The patterns the algorithm is looking for are:
- Class.Key (e.g. .cs, .vb, .xaml, .cshtml)
- Class::Key (e.g. c++)
- <%$ Resources: Class, Key &> (e.g. .aspx)
- Class.ResourceManager.GetString("Key") (e.g. indirect look up in .cs or .vb)
- both typeof(Class) and "Key" on the same line (e.g. in attributes like [Required(ErrorMessageResourceType = typeof(Class), ErrorMessageResourceName = "Key")], or MyClass.MyLookUpResource("Key", typeof(Class))
- both <Class> and "Key" on the same line (e.g. generic look up method like MyClass.MyLookUpResource<Class>("Key")

Only patterns that appear on a single line are detected. Patterns that span more than one line are not detected.

Invariant strings

Invariant.png

Entries that do not need a translation even though they are stored in a resource file can be marked as invariant. They are not highlighted red when empty but will show up in grey, and they do not appear when the "show only lines with missing strings" filter is activated.

Show only columns of interest

ChooseColumns.png

You can select what columns are visible, to hide languages or comments you're currently not working on.

Copy & Paste or directly export to Excel

CopyPasteExport.png

You can copy and paste selected rows or directly export entire resource tables to an Excel file if you prefer editing in another editor or want to send it in a generic format to your translator. When pasting back or importing Excel files also subsets are supported; you can remove any of the language or comment columns or text rows, only the header row and the first column are mandatory.

Cut and paste are only available if you have selected a single resource file on the left - otherwise it would be ambiguous in which file to add or replace the items.


Note: This tool instantly saves the changes as soon as you leave a cell in the data grid. There is no save button, and undo is limited to the local undo of the grid's cell. If you are using Source Control Management, this is no limitation, since you will anyhow verify the changes before checking in. If you don't use an SCM, I would strongly recommend starting to use one ;-)



Viewing all articles
Browse latest Browse all 2435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>