-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Find out a better way for localization
- Loading branch information
heku
committed
Mar 30, 2018
1 parent
5aba78b
commit 78ab9c1
Showing
12 changed files
with
132 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema" language="zh-hans"> | ||
|
||
<Include href="EditProjectPackage.vsct" /> | ||
|
||
<Commands package="guidPackage"> | ||
<Buttons> | ||
<Button guid="guidCmdSet" id="EDIT_PROJECT_CMD_ID" priority="0x0100" type="Button"> | ||
<!--Visual Studio 2015 doesn't have such menu, we have to define a new Group--> | ||
<!--<Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_PROJECT_EDITFILE" />--> | ||
<Parent guid="guidCmdSet" id="EDIT_PROJECT_GROUP_ID" /> | ||
<Icon guid="ImageCatalogGuid" id="Open" /> | ||
<CommandFlag>DynamicVisibility</CommandFlag> | ||
<CommandFlag>DefaultInvisible</CommandFlag> | ||
<CommandFlag>TextChanges</CommandFlag> | ||
<CommandFlag>IconAndText</CommandFlag> | ||
<CommandFlag>IconIsMoniker</CommandFlag> | ||
<Strings> | ||
<ButtonText>编辑...</ButtonText> | ||
</Strings> | ||
</Button> | ||
<Button guid="guidCmdSet" id="EDIT_PROJECTS_CMD_ID" priority="0x0100" type="Button"> | ||
<Parent guid="guidCmdSet" id="EDIT_PROJECTS_GROUP_ID" /> | ||
<Icon guid="ImageCatalogGuid" id="Open" /> | ||
<CommandFlag>IconAndText</CommandFlag> | ||
<CommandFlag>IconIsMoniker</CommandFlag> | ||
<Strings> | ||
<ButtonText>编辑项目文件</ButtonText> | ||
</Strings> | ||
</Button> | ||
</Buttons> | ||
</Commands> | ||
</CommandTable> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<#@ template debug="false" hostspecific="true" language="C#" #> | ||
<#@ assembly name="System.Core" #> | ||
<#@ assembly name="System.Windows.Forms" #> | ||
<#@ import namespace="System.IO" #> | ||
<#@ import namespace="System.Resources" #> | ||
<#@ import namespace="System.Text.RegularExpressions" #> | ||
<#@ output extension=".Designer.cs" #> | ||
|
||
<# | ||
const string NameSpace = "Kool.EditProject"; | ||
const string BenchmarkLanguage = "en"; | ||
|
||
var resourceNameWithoutCulture = Path.GetFileNameWithoutExtension(Host.TemplateFile); | ||
var resourceFullNameWithoutCulture = NameSpace + "." + resourceNameWithoutCulture; | ||
#> | ||
|
||
// ------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This file was generated by T4 Template. | ||
// </auto-generated> | ||
// ------------------------------------------------------------------------------ | ||
|
||
using System.Resources; | ||
|
||
namespace <#= NameSpace#> | ||
{ | ||
/// <summary> | ||
/// A strongly-typed resource class, for looking up localized strings. | ||
/// </summary> | ||
static class <#= resourceNameWithoutCulture#> | ||
{ | ||
static readonly ResourceManager Resx = new ResourceManager("<#= resourceFullNameWithoutCulture#>", typeof(<#= resourceNameWithoutCulture#>).Assembly); | ||
|
||
<# | ||
var resx = Path.ChangeExtension(Host.TemplateFile , BenchmarkLanguage + ".resx"); | ||
using(var reader = new ResXResourceReader(resx) { UseResXDataNodes = true }) | ||
{ | ||
foreach (System.Collections.DictionaryEntry kv in reader) | ||
{ | ||
var node = (ResXDataNode)kv.Value; | ||
if (node.FileRef == null) | ||
{ | ||
var keyName = kv.Key.ToString(); | ||
var propName = Regex.IsMatch(keyName , @"^\d+") ? "_" + keyName : keyName; | ||
#> | ||
public static string <#= propName#> { get; } = Resx.GetString("<#= keyName#>"); | ||
<# | ||
} | ||
} | ||
} | ||
#> | ||
} | ||
} |
File renamed without changes.
File renamed without changes.