Ghost1372

everything can be handy

StringsPropertyGenerator

Use this generator to create a class containing all keys and values from the Resources.resw file or any resw file which has Resources keyword in its name.(eg: Resources.Error.resw)

This generator reads the Resources\en-US\resources.resw file and extracts each key.
The result is a generated class similar to the following:

The generator locates the .resw files by filtering for en-US\Resources, so make sure your .resw file is placed inside the en-US folder and has a Resources in its name. Otherwise, the generator will not be able to find it.

How To Use it?

Just add an AdditionalFiles entry to your .csproj.

1
2
3
4
<ItemGroup>
<AdditionalFiles Include="Strings\en-US\Resources.resw" />
<!-- OR <AdditionalFiles Include="Strings\en-US\Resources.Error.resw" /> -->
</ItemGroup>

Namespace

You can define your own namespace by adding a property to a PropertyGroup.

1
2
3
<PropertyGroup>
<StringsNamespace>myStringsNamespace</StringsNamespace>
</PropertyGroup>

Result

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public sealed partial class Strings
{

/// <summary>
/// </summary>
/// <remarks>
/// e.g.: <b>Al-Anwar is an open-source software for reading and reciting the Holy Quran.</b>
/// </remarks>
public const string AboutUsSettingPage_About_Description = "AboutUsSettingPage_About/Description";

/// <summary>
/// </summary>
/// <remarks>
/// e.g.: <b>AlAnvar</b>
/// </remarks>
public const string AboutUsSettingPage_About_Header = "AboutUsSettingPage_About/Header";

/// <summary>
/// </summary>
/// <remarks>
/// e.g.: <b>Related Links</b>
/// </remarks>
public const string AboutUsSettingPage_RelatedLink_Text = "AboutUsSettingPage_RelatedLink/Text";

/// <summary>
/// </summary>
/// <remarks>
/// e.g.: <b>Release notes</b>
/// </remarks>
public const string AboutUsSettingPage_ReleaseNote_Content = "AboutUsSettingPage_ReleaseNote/Content";
}
0%