|
1 | 1 | <img src="https://user-images.githubusercontent.com/1226538/56482508-6fbd2d00-6479-11e9-8fc0-b20d5f3171ad.png" height="80" />
|
2 | 2 |
|
3 |
| -# ReswPlus - Advanced File Code Generator for Resw files. |
| 3 | +# ReswPlus - Advanced Code Generator for `.resw` Files |
4 | 4 | 
|
5 | 5 | 
|
6 |
| - |
| 6 | + |
7 | 7 | 
|
8 | 8 |
|
9 |
| -_**Now available as a source generator**_ |
| 9 | +_**Now available as a Source Generator!**_ |
10 | 10 |
|
11 |
| -**ReswPlus** is a C# Source Generator for Visual Studio that enhances your existing `.resw` files with a wide range of powerful features: |
| 11 | +**ReswPlus** is a C# Source Generator for Visual Studio that enhances `.resw` files with a powerful set of features: |
12 | 12 |
|
13 |
| -- **Strongly typed static properties** for accessing strings. |
| 13 | +- **Strongly typed static properties** for safer and more efficient string access. |
14 | 14 | - **Automatic generation of string formatting methods**, supporting:
|
15 | 15 | - Typed and named parameters, literal strings, string references, and macros.
|
16 | 16 | - **Pluralization support** for *196 languages*, including handling empty states when the item count is zero.
|
17 |
| -- **Variant support** for managing multiple string versions. |
| 17 | +- **Variant support** for managing multiple versions of a string. |
18 | 18 | - **Generation of a markup extension** for accessing strings with **compile-time verification**.
|
19 | 19 |
|
| 20 | +## ✅ Feature Comparison |
20 | 21 |
|
21 |
| -Supported: |
22 |
| -- C# |
23 |
| - |
24 |
| -| | Resw | Resw with ReswPlus | Resx | Android XML (for reference) | |
25 |
| -|-------------------------------------------------|------|-----------------|------|-------------| |
26 |
| -| Modify UI properties via resource files (x:uid) | ✅ | ✅ | | | |
27 |
| -| Generate strongly typed accessors | | ✅ | ✅ | ✅ | |
28 |
| -| Generate String Formatting methods | | ✅ | | | |
29 |
| -| Support Plural forms | | ✅ | | ✅ | |
30 |
| -| Support 'None' state | | ✅ | | | |
31 |
| -| Auto-generate methods for string formatting | | ✅ | | | |
32 |
| -| Support literal strings in string formatter | | ✅ | | | |
33 |
| -| Support Macros in string formatter | | ✅ | | | |
34 |
| -| Support String references in string formatter | | ✅ | | | |
35 |
| -| Strongly typed string formatting | | ✅ | | | |
36 |
| -| Support Resources in libraries | | ✅ | ✅ | | |
37 |
| -| Support String variants (including genders) | | ✅ | | | |
38 |
| - |
39 |
| -## 📦 Guide |
40 |
| -⚡ [How to install ReswPlus](https://github.com/reswplus/ReswPlus/wiki/How-to-install-ReswPlus) - Learn how to install ReswPlus<br> |
41 |
| -⚡ [Use ReswPlus in your project](https://github.com/reswplus/ReswPlus/wiki/Use-ReswPlus-in-my-project) - Learn how to use ReswPlus in your projects |
| 22 | +| Feature | Resw | Resw + ReswPlus | Resx | Android XML (for reference) | |
| 23 | +|-----------------------------------------------|------|-----------------|------|-------------| |
| 24 | +| Modify UI properties via resource files (x:uid) | ✅ | ✅ | | | |
| 25 | +| Generate strongly typed accessors | | ✅ | ✅ | ✅ | |
| 26 | +| Generate string formatting methods | | ✅ | | | |
| 27 | +| Support pluralization | | ✅ | | ✅ | |
| 28 | +| Support empty states | | ✅ | | | |
| 29 | +| Auto-generate string formatting methods | | ✅ | | | |
| 30 | +| Support literal strings in formatters | | ✅ | | | |
| 31 | +| Support macros in formatters | | ✅ | | | |
| 32 | +| Support string references in formatters | | ✅ | | | |
| 33 | +| Strongly typed string formatting | | ✅ | | | |
| 34 | +| Support resources in libraries | | ✅ | ✅ | | |
| 35 | +| Support string variants (e.g., gender-based) | | ✅ | | | |
| 36 | + |
| 37 | +## 📦 Getting Started |
| 38 | + |
| 39 | +⚡ [How to Install ReswPlus](https://github.com/reswplus/ReswPlus/wiki/How-to-install-ReswPlus) – Step-by-step installation guide. |
42 | 40 |
|
43 | 41 | ## 🔧 Features
|
44 |
| -### Strongly Typed class generator |
45 |
| -_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._ |
46 | 42 |
|
47 |
| -🗨 [How to generate a strongly typed class](https://github.com/reswplus/ReswPlus/wiki/Features:-Strongly-typed-properties) |
48 |
| -### Pluralization |
49 |
| -_ReswPlus can add support of pluralization and plural forms to your localization strings. Plural forms of 196 languages are currently supported by ReswPlus._ |
| 43 | +### Strongly Typed Class Generator |
| 44 | +ReswPlus generates a class that exposes all strings from your `.resw` files as **strongly typed static properties**, ensuring **compile-time safety** in both XAML and C#. |
50 | 45 |
|
51 |
| -🗨 [How to add pluralization](https://github.com/reswplus/ReswPlus/wiki/Features:-Pluralization-support)<br> |
52 |
| -⚙️ [Support Empty States](https://github.com/reswplus/ReswPlus/wiki/Features:-Pluralization---Empty-states)<br> |
53 |
| -⚙️ [Languages supported](https://github.com/reswplus/ReswPlus/wiki/Languages-supported-for-pluralization) |
54 |
| -### String Formatting |
55 |
| -_To simplify your ViewModels and Views, ReswPlus can directly manage the formatting of your localization and generate strongly typed methods to format your strings._ |
| 46 | +🗨 [How to Generate a Strongly Typed Class](https://github.com/reswplus/ReswPlus/wiki/Features:-Strongly-typed-properties) |
56 | 47 |
|
57 |
| -🗨 [How to use String Formatting](https://github.com/reswplus/ReswPlus/wiki/Features:-String-Formatting)<br> |
58 |
| -⚙️ [Named parameters](https://github.com/reswplus/ReswPlus/wiki/Features:-Named-parameters-for-String-Formatting)<br> |
59 |
| -⚙️ [Use String References](https://github.com/reswplus/ReswPlus/wiki/Features:-String-References-in-String-Formatting)<br> |
60 |
| -⚙️ [Use Literal Strings](https://github.com/reswplus/ReswPlus/wiki/Features:-Literal-Strings-in-String-Formatting)<br> |
61 |
| -⚙️ [Use Macros](https://github.com/reswplus/ReswPlus/wiki/Features:-Macros-in-String-Formatting) |
| 48 | +### Pluralization Support |
| 49 | +Easily add **pluralization** support for *196 languages*, including correct handling of **empty states** when the count is zero. |
62 | 50 |
|
63 |
| -### Font style support using HTML tags |
64 |
| -_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)._ |
| 51 | +🗨 [How to Add Pluralization](https://github.com/reswplus/ReswPlus/wiki/Features:-Pluralization-support) |
| 52 | +⚙️ [Handling Empty States](https://github.com/reswplus/ReswPlus/wiki/Features:-Pluralization---Empty-states) |
| 53 | +⚙️ [Supported Languages](https://github.com/reswplus/ReswPlus/wiki/Languages-supported-for-pluralization) |
65 | 54 |
|
66 |
| -🗨 [How to use HTML formatting](https://github.com/reswplus/ReswPlus/wiki/Features:-HTML-Formatting) |
| 55 | +### String Formatting |
| 56 | +ReswPlus simplifies ViewModels and Views by handling string formatting directly and generating **strongly typed methods**. |
| 57 | + |
| 58 | +🗨 [How to Use String Formatting](https://github.com/reswplus/ReswPlus/wiki/Features:-String-Formatting) |
| 59 | +⚙️ [Named Parameters](https://github.com/reswplus/ReswPlus/wiki/Features:-Named-parameters-for-String-Formatting) |
| 60 | +⚙️ [Using String References](https://github.com/reswplus/ReswPlus/wiki/Features:-String-References-in-String-Formatting) |
| 61 | +⚙️ [Using Literal Strings](https://github.com/reswplus/ReswPlus/wiki/Features:-Literal-Strings-in-String-Formatting) |
| 62 | +⚙️ [Using Macros](https://github.com/reswplus/ReswPlus/wiki/Features:-Macros-in-String-Formatting) |
67 | 63 |
|
68 |
| -### Variants |
69 |
| -_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...)_ |
| 64 | +### String Variants |
| 65 | +ReswPlus allows multiple variants of a string based on different criteria, such as **gender-based messages** or other conditions. |
70 | 66 |
|
71 |
| -🗨 [How to use variants](https://github.com/reswplus/ReswPlus/wiki/Features:-Variants) |
| 67 | +🗨 [How to Use Variants](https://github.com/reswplus/ReswPlus/wiki/Features:-Variants) |
72 | 68 |
|
73 | 69 | ## Tools
|
74 | 70 | 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.
|
75 | 71 |
|
76 | 72 | ### Convert from/to Android XML files
|
77 |
| -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. |
| 73 | +Unfortunately, not all localization tools and companies support `.resw` files. This becomes even more problematic when dealing with pluralization, as `.resw` does not support it by default. |
| 74 | + |
| 75 | +To address this, **ReswPlus** includes a converter for **seamless conversion between `.resw` and Android XML**, a format that supports string pluralization and is widely compatible with existing localization tools. |
78 | 76 |
|
79 | 77 | 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>`.
|
80 | 78 |
|
|
0 commit comments