mirror of
https://github.com/nsnail/ns-ext.git
synced 2025-07-02 01:48:16 +08:00
@ -1,5 +1,8 @@
|
||||
<#@ template language="C#" #>
|
||||
<#@ output encoding="utf-8" extension="resx" #>
|
||||
<#@ import namespace="System.IO" #>
|
||||
<#@ import namespace="System.Linq" #>
|
||||
<#@ import namespace="System.Text.RegularExpressions" #>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
|
||||
@ -25,15 +28,12 @@
|
||||
</value>
|
||||
</resheader>
|
||||
<#
|
||||
var regex = new System.Text.RegularExpressions.Regex(@"^\d", System.Text.RegularExpressions.RegexOptions.Compiled);
|
||||
foreach (var file in System.IO.Directory.GetFiles("../assets/res/", "*.ln"))
|
||||
var regex = new Regex(@"^\d", RegexOptions.Compiled);
|
||||
foreach (var line in Directory.GetFiles("../assets/res/", "*.ln").SelectMany(x => File.ReadLines(x)).Distinct())
|
||||
{
|
||||
foreach (var line in System.IO.File.ReadLines(file))
|
||||
{
|
||||
#>
|
||||
<data name="<#= regex.IsMatch(line) ? "_" : "" #><#= line #>" xml:space="preserve"><value><#= line #></value></data>
|
||||
<#
|
||||
}
|
||||
}
|
||||
#>
|
||||
</root>
|
Reference in New Issue
Block a user