/ReswPlus

Unleash your resw files with this Visual Studio extension: auto generation of strongly typed static properties, support of pluralization, strongly typed string formatting, etc...

Primary LanguageC#MIT LicenseMIT

ReswPlus - Advanced File Code Generator for Resw files.

Type Compatibility LanguageSupported GitHub

Now available for Visual Studio 2022

ReswPlus is a Visual Studio extension enriching your existing .resw files with many highly valuable features:

  • Access to strings via strongly typed static properties.
  • Automatically generate methods to format your strings
    • Support typed and named parameters, literal strings, string references and Macros
  • Pluralization support (for 196 languages!).
    • Support empty states when the number of items is zero.
  • Add HTML markups to your strings (bold, italic, hyperlinks, etc...)
  • Variants support
  • Generate a Markup extension to access to your strings with compile-time verification.

Supported:

  • C#, VB.Net, C++/CX and C++/WinRT.

reswplus

Resw Resw with ReswPlus Resx Android XML (for reference)
Modify UI properties via resource files (x:uid)
Generate strongly typed accessors
Generate String Formatting methods
Support Plural forms
Support 'None' state
Support HTML formatting ✅ (indirectly)
Auto-generate methods for string formatting
Support literal strings in string formatter
Support Macros in string formatter
Support String references in string formatter
Strongly typed string formatting
Support Resources in libraries
Support String variants (including genders)

📦 Guide

How to install ReswPlus - Learn how to install ReswPlus
Use ReswPlus in your project - Learn how to use ReswPlus in your projects

🔧 Features

Strongly Typed class generator

ReswPlus can generate a class exposing all strings from your .resw files as strongly typed static properties, providing a compile-time-safe way to access those strings XAML-side or code-side.

🗨 How to generate a strongly typed class

Pluralization

ReswPlus can add support of pluralization and plural forms to your localization strings. Plural forms of 196 languages are currently supported by ReswPlus.

🗨 How to add pluralization
⚙️ Support Empty States
⚙️ Languages supported

String Formatting

To simplify your ViewModels and Views, ReswPlus can directly manage the formatting of your localization and generate strongly typed methods to format your strings.

🗨 How to use String Formatting
⚙️ Named parameters
⚙️ Use String References
⚙️ Use Literal Strings
⚙️ Use Macros

Font style support using HTML tags

Unlike Android localization files, resw files don't support emphasis (bold, italic, underlined...). To address this lack, ReswPlus improves resw files and add support of emphasis using HTML tags (similar to Android).

🗨 How to use HTML formatting

Variants

ReswPlus can support many variants/versions of the same string and allow you to display the one you want based on criteria (variants to support genders, different messages depend on some criteria...)

🗨 How to use variants

.Net String formatting for C++ projects

String formatting in C++ is quite different and more complicated than in C#/VB.Net. ReswPlus provides a way to use the same string templates as you use in .Net (via String.Format) but in your C++ project, making your resource files shareable with .Net libraries and simplifying your code.

🗨 Use .Net String Formatting

Tools

In addition to features to enrich resw files, ReswPlus also provides some interesting tools to improve your productivity or make it easier to use/support resw files in your workflow and localization process.

Convert from/to Android XML files

This is very unfortunate, but not all localization tools and localization companies support recovery files. This is even more of an issue when you want to support Pluralization, as resw does not support it by default. To resolve this issue, ReswPlus now includes a converter to and from Android XML files, a format that supports string pluralization and supported by all tools available on the market.

Simply right click on the resw associated to the default language of your app and select ReswPlus > Export to Android XML format. To convert the Android files once localized, you can use the command-line tool provided with the nuget package (packages/ReswPlusLib.xxxx/Tools/ReswPlusCmd\ReswPlusCmd.exe with the following arguments xml-to-resw -i <folder path> <output path>.

If you don't want to use Visual Studio to convert your resw files to Android XML files, you can use the same command-line tool with the following arguments resw-to-xml -i <resw file path> <output file path>