IBR.StringResourceBuilder2011 V1.6 Release 1 (Build 22)
Below you'll find:
- Description
- Hints (source code)
- License
- Copyright Notices
- Screenshots
- Revision History
Feedback and ratings are highly appreciated. Otherwise I'll never know if I'm doing it right. Thank you.
If you find a faulty functionality, I ask you to give a detailed description (with screenshots) on my GitHub page.
Thank you for your support.
Description
The String Resource Builder is a tool to support easy localization of code. It is created for Visual Studio 2015 / 2017 to extract string literals from source code (C# and VB.NET) and put them into resource files (ResX), replacing the string literal by its resource call (also an using alias will be created).
All string literals are listed in a tool window with a suggested placeholder for the resource created from its text (hint: it is at this stage not tested for use with non-ASCII characters, though some filtering of 'illegal' characters is done. I recommend programming in English). The placeholder may be edited beforehand. Duplicates of placeholders will be recognized and the user will be questioned if he wants to use the already existing resource.
Per default for each source file one resource file will be created, thus it will be easy to share forms or classes between different solutions including their localizations. A resource file is named with the original source file name whose extension is replaced by ".Resources.resx" (e.g. "frmMain.cs" -> "frmMain.Resources.resx" plus its designer file, in VB.NET likewise).
Optional a global resource file can be specified in the settings. It can be named to your likes (a path will be ignored and an extension would be replaced by ".Resources.resx"). It is stored in the project's "Properties" (VB: "My Project") directory if exists, otherwise in the project root.
The tool is started via the Tools menu:
For a 'description' of the buttons in the tool window please refer to the tool tips.
There are some settings for reducing the amount of string literals to be found (see also screenshots below):
- "Ignore strings with # characters or less": string literals with the given amount of characters (or less) will not be listed.
- "Ignore white space strings": string literals containing nothing but white space or tabulator characters (in this case "\t" is not considered a white space because in code it consists of two characters) will not be listed.
- "Ignore number strings": string literals containing nothing but leading/trailing white space characters and numbers (also decimal numbers) will not be listed.
- "Ignore verbatim strings": verbatim string literals (preceded by @ character, C#) will not be listed.
- "Use global resource file SRB_Strings.Resources.resx": all string resources will be stored into the resource file with the given name (blank for the standard global resource file) placed into the Properties directory of the project or if not available in the project root.
- "Don't use resource alias like using SRB_Strings_Res = ...; or using GlbRes = ...;": only available when "Use global resource file" is ticked.
- "Ignore these Strings": string literals found in this list (exact match) will not be listed.
- "Ignore Strings containing these strings": string literals containing one of the the given sub-strings will not be listed.
- "Ignore these Methods or Functions": string literals within the given methods or functions (at the moment the names are class-independent, may be subject to change by preceding the class name) will not be listed.
- ToDo: "Ignore Arguments of these Methods or Functions": string literals within the calling arguments of the given methods or functions will not be listed.
Hints
Important: I discontinued support of IDEs before VS2015 because I'm no longer able to test it. If you need to use an older version, please use my GitHub site for retrieval (link see bottom of this topic).
There is an unsolved problem with VS2015 and the Xamarin extension installed (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Xamarin) where a newly created resource file in a WinForms project will have no designer tool in the solution. The only way has been to delete this directory.
This tool is not tested with character sets other than used in English and German, thus one should first try it with a backup copy of a corresponding solution (for localization I recommend programming in English as neutral language).
When the tool window is open, editing the source will result in a refresh of the listed string literals (re-parsing of the affected code), which is automatically done after key strokes, which may lead to unexpected behavior using the mouse to position the caret or copy&paste or move per drag&drop (I tried hard to avoid this, though). It is recommended to close the String Resource Builder tool window if not used or while coding (especially for big source files).
The source code (and also older versions) can be found at GitHub: https://github.com/Dany-R/IBR.StringResourceBuilder2011
See also Revision History below.
License
- Source code files are governed by the MIT LICENSE (MIT) (INCLUDED IN PACKAGE).
- Binary files are governed by MSDN CODE GALLERY BINARY LICENSE (INCLUDED IN PACKAGE).
Copyright Notices
Microsoft Visual Studio 2017 is Copyright (c) 2016 Microsoft Corporation, All Rights Reserved.
Microsoft Visual Studio 2015 is Copyright (c) 2015 Microsoft Corporation, All Rights Reserved.
Visual Studio 2010 SDK is Copyright (c) 2010 Microsoft Corporation, All Rights Reserved.
VSPackage Builder is Copyright (c) 2010 Microsoft Corporation, All Rights Reserved.
class GreyableImage.ImageGrayer Copyright (c) 2008 Alexey Potapov, All Rights Reserved.
All other code is Copyright (c) 2006-2017, Daniel Ruehmer, All Rights Reserved.
Screenshots
Main application
Settings window "Options" tab
Settings window "Strings" tab
Settings window "Methods & Functions" tab
Revision History
V1.6 R1 (22) [2017-06-30]
- Fixed: Issue with expression bodied properties no longer being parsed.
- Fixed: Missing standard resources for Help/About dialog of Visual Studio.
- New: Provide revision history as release notes in "Extensions and Updates".
- New: Option not to use the resource class using alias for global resources. Thanks to isaksavo.
V1.5 R3 (21) [2017-05-21]
- Fixed: Crash when parsing expression bodied properties due to a bug seen in VS2017 V15.2 (26430.6, maybe earlier) as stated here. But now, these property getters are ignored as long as the EnvDTE is not fixed to give proper start and end points.
- Changed: Source code now hosted on GitHub.
- Changed: Using Nuget project.json instead of packages.config. Using the following packages (and their dependencies):
- "EnvDTE100": "10.0.1"
- "Microsoft.VisualStudio.Shell.14.0": "14.3.25407"
- "Microsoft.VSSDK.Vsixsigntool": "15.0.26201"
- New: Using Visual Studio 2017 V15.2 (26430.6).
V1.5 R2 (20) [2016-12-13]
- Changed: Manifest changed to support only VS2015 and later from now on (unable to test earlier versions).
If you need to use an older version, please use my CodePlex site for retrieval. - New: Using Visual Studio 2017 RC.
- New: extension.vsixmanifest updated for Visual Studio 2017 (V15.0).
- New: VSIX and DLL signed now.
V1.5 R1 (19) [2016-02-27]
- Fixed: Handling new C#6 features (thanks to Urs.Meili):
- Expression bodied properties, functions and indexers.
- Interpolated strings ($"...") -> ignored completely.
- Fixed: Selecting the resources grid when unfocused was jumping weirdly.
- Changed: Using .NET Framework V4.5.2.
- New: Using Visual Studio 2015 (using result of VSPackage Builder without the extension as it sadly exists only for VS2010).
- New: Uses NuGet Packages:
- Microsoft.VisualStudio.Shell.14.0
- Microsoft.VisualStudio.Shell.Interop.12.0
- Because this version has been built with VS2015, it is not clear, whether the extension runs in versions VS2010, VS2012 or VS2013 (though VS2013 seems to work fine when VS2015 is installed as well).
If you need to revert to an older version, please use my CodePlex site for retrieval.
V1.3 R7 (18) [2015-08-07]
- New: extension.vsixmanifest updated for Visual Studio 2015 (V14.0).
V1.3 R6 (17) [2014-01-12]
- New: extension.vsixmanifest updated for Visual Studio 2013 (V12.0).
- New: Option to use verbatim string literals (preceded by @ character) as "ignore" filter criteria. Thanks to Jean-Yves G. for the suggestion.
V1.3 R5 (16) [2013-07-10]
- Fixed: VS2012: Broken behavior for automatically checking out ResX. Thanks to Piggy.
- Fixed: VS2012: Make selection background blue even when DataGrid is unfocused.
V1.3 R4 (15) [2012-12-30]
- Fixed: Wrong column number parsed in single line function (e.g. get/set). Thanks to Game.Dev.
- Fixed: Global resource file for VB did not work (should be in directory "My Project" instead of "Properties").
V1.3 R3 (14) [2012-10-03]
- Fixed: Undo did incorrectly change the line numbers in table.
- Changed: Removed automatic resource name indexing.
- Changed: Ignore number strings now also ignores decimal numbers (" 1234.56 ").
- Improved: Some more information on the settings window.
V1.3 R2 (13) [2012-09-14]
- Fixed: "Making" a string resource left the table of string literals blank (due to "improvement" in Build 11).
- Improved: Sped up inserting resource call when "making" a string resource.
V1.3 R1 (12) [2012-09-12]
- New: Option to store all string resources in one resource file global to the project (not solution).
V1.2 R4 (11) [2012-07-21]
- Improved: Rescan while editing no longer with timer and complete but direct and selective (only what has been changed) -> partly more responsive.
- Reworked: Code generators (VSPackage Builder) cleaned up (spaces no tabs, result code formatted to my likes).
V1.2 R3 (9) [2012-06-27]
- Fixed: Handling empty string literals (locations behind did not match).
- Fixed: Closing and reopening tool window with same editor window active did not rescan.
- Fixed: Rescan did not look for nearest string resource (mark in table and mark next string literal when cursor in same line).
- Fixed: After editing the next string literal in same line has been marked.
V1.2 R2 (7) [2012-06-11]
- New: extension.vsixmanifest updated for Visual Studio 2012 (V11.0).
V1.2 R1 (6) [2012-06-09]
- New: Initial release for Visual Studio 2010.
.