{"id":16974052,"url":"https://github.com/opportunityliu/resourcegenerator","last_synced_at":"2026-05-11T16:02:18.971Z","repository":{"id":65414289,"uuid":"83205748","full_name":"OpportunityLiu/ResourceGenerator","owner":"OpportunityLiu","description":"A tool to generate classes for UWP string resources.","archived":false,"fork":false,"pushed_at":"2019-05-26T04:12:36.000Z","size":567,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-01T19:21:53.200Z","etag":null,"topics":["localization","resjson","resource-management","resw","uwp"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpportunityLiu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-26T12:09:49.000Z","updated_at":"2024-05-03T11:39:16.000Z","dependencies_parsed_at":"2023-01-23T10:55:12.032Z","dependency_job_id":null,"html_url":"https://github.com/OpportunityLiu/ResourceGenerator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OpportunityLiu/ResourceGenerator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpportunityLiu%2FResourceGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpportunityLiu%2FResourceGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpportunityLiu%2FResourceGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpportunityLiu%2FResourceGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpportunityLiu","download_url":"https://codeload.github.com/OpportunityLiu/ResourceGenerator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpportunityLiu%2FResourceGenerator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32902254,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["localization","resjson","resource-management","resw","uwp"],"created_at":"2024-10-14T01:04:33.950Z","updated_at":"2026-05-11T16:02:18.955Z","avatar_url":"https://github.com/OpportunityLiu.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ResourceGenerator\nA tool to generate classes for UWP string resources.\n\n[![NuGet](https://img.shields.io/nuget/v/Opportunity.ResourceGenerator.svg)](https://www.nuget.org/packages/Opportunity.ResourceGenerator/)\n[![Build status](https://ci.appveyor.com/api/projects/status/m9bn4ub78r62aw1e?svg=true)](https://ci.appveyor.com/project/OpportunityLiu/resourcegenerator)\n\n## How-To\n\n1.  **Install package**\n\n    To install this package, execute following command in \n    [package manager console](https://docs.nuget.org/docs/start-here/using-the-package-manager-console).\n    ```powershell\n    Install-Package Opportunity.ResourceGenerator\n    ```\n    \n1.  **Create config file**\n\n    To create default config file of ResourceGenerator, execute following command.  \n    ```powershell\n    New-Config Resources/Strings\n    ```\n    You can also specify paths other than `Resources/Strings`.   \n    Use `-Project \u003cProjectName\u003e` to create config file in project other than default project.    \n    \n1.  **Edit config file**\n\n    After step 2, you'll get a `.resgenconfig` file with following content.  \n    ```js\n    {\n      \"`$schema\": \"https://raw.githubusercontent.com/OpportunityLiu/ResourceGenerator/master/resgenconfig.json?version=1.4.0\",\n      // Path for resource files (*.resw \u0026 *.resjson).\n      // Default value is \"/Strings\".\n      \"ResourcePath\": \"/Strings\",\n\n      // Default language of resources, will be detected automatically if unset.\n      //\"SourceLanguagePath\": \"en-Us\",\n\n      // Namespace for resource visitor class.\n      // Default value is \"\u003cProjectDefaultNamespace\u003e\".\n      //\"LocalizedStringsNamespace\": \"MyNamespace\",\n\n      // Namespace for resource visitor interfaces.\n      // Default value is \"\u003cProjectDefaultNamespace\u003e.ResourceInfo\".\n      //\"InterfacesNamespace\": \"MyNamespace.ResourceInfo\",\n\n      // Modifier for resource visitor class and interfaces.\n      \"Modifier\": \"internal\",\n\n      // Specifies whether this project is the default project or not.\n      // Determines if it is necessary to contains project name in the resource path.\n      \"IsDefaultProject\": true,\n\n      // Regard resource strings whose name starts with '$' as format string.\n      // Default value is false.\n      //\"IsFormatStringEnabled\": true,\n\n      // Format function used for format strings, must be replaceble with string.Format.\n      //\"FormatStringFunction\": \"string.Format\",\n\n      // Excluded resource paths.\n      //\"Exclude\": [],\n\n      // Included resource paths, has higher priority than Exclude.\n      //\"Include\": [],\n\n      // Specifies whether the tool generates code that is debuggable.\n      \"DebugGeneratedCode\": false\n    }\n    ```  \n    Edit this file to control properties of generated classes.  \n    \n1.  **Generate resource class**\n\n    Run following command to generate resource class.  \n    ```powershell\n    Convert-Resource -Project \u003cProjectName\u003e\n    ```   \n    To generate resource classes in all projects, run `Convert-Resource` without arguments.\n\nIf you edited your resource file (`.resw` \u0026 `.resjson`), re-generate resource classes as the last step.\n\n## Features\n\nTakes following `.resjson` file as an example:\n```js\n//File `Resources.resjosn`:\n{\n  \"AppName\": \"TestName\",\n  \"ContentTextBox\": {\n    \"Header\": \"Header\",\n    \"Text\": \"Content\",\n    \"ToolTipService/ToolTip\": \"A simple text box.\"\n  },\n  \"$FileNotFound\": \"Line {line:g}: Can not find file with name \\\"{name}\\\" in \\\"{path}\\\"\"\n}\n```\n\n1.  **Nested resource strings** (`.` in `.resw` file or `/` in `.resjson` file)\n    \n    For example, you can visit the tool tip (`\"A simple text box.\"`) via expression `Strings.Resources.ContentTextBox.ToolTipService.ToolTip`.\n    \n1.  **Format resource strings** (resource strings whose name starts with a `$`)\n\n    To enable this feature, you should set `IsFormatStringEnabled` to `true` in `.resgenconfig` file.  \n    You can find a generated function `string Strings.Resources.FileNotFound(object line, object name, object path)` for format strings.\n\n1.  **Dynamic visit support**\n\n    You should use a pair of parentheses to end visiting with a string result.  \n    Dynamic version of the first example looks like following:  \n    ```cs\n    string tooltip = Strings.Resources.ContentTextBox.ToolTipService.ToolTip;\n    dynamic resources = Strings.Resources;\n    string tooltip1 = (string)resources.ContentTextBox.ToolTipService.ToolTip();\n    string tooltip2 = (string)resources.ContentTextBox[\"ToolTipService\"].ToolTip();\n    string tooltip3 = (string)resources.ContentTextBox[\"ToolTipService/ToolTip\"]();\n    ```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopportunityliu%2Fresourcegenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopportunityliu%2Fresourcegenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopportunityliu%2Fresourcegenerator/lists"}