Signed-off-by: lilium-saber <WR364999428@hotmail.com>
GDN
lilium-saber 2 years ago
parent 39dc0745a6
commit 9d00379e3a

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WpfApp1.translationKey
{
abstract class TranslateApiStr
{
public abstract List<String> OutputTranslationS(String id);
public abstract List<String> OutputTranslationName();
}
abstract class TranslationApiInt
{
public abstract List<String> OutputTranslationI(int id);
}
}

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WpfApp1.translationKey
{
class TranslationPrivateIn
{
private String pathTemp = "../translationResource/";
private String txtPath = "../translationResource/ListPrivate.txt";
public void InputTranslationPrivate(String name, String id, String key)
{
pathTemp = pathTemp + name + ".txt";
StreamWriter sw = new StreamWriter(pathTemp);
StreamWriter sw2 = new StreamWriter(txtPath);
InputTranslationId(id,sw);
InputTranslationKey(key,sw);
sw2.WriteLine(name);
sw.Close();
sw2.Close();
}
public void InputTranslationId(String id, StreamWriter sw)
{
sw.WriteLine(id);
}
public void InputTranslationKey(String key, StreamWriter sw)
{
sw.WriteLine(key);
}
}
}

@ -0,0 +1,87 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WpfApp1.translationKey
{
class translationPrivateOut : TranslateApiStr
{
private String name;
private String path = "../translationResource/";
private String txtPath = "../translationResource/ListPrivate.txt";
translationPrivateOut()
{ }
private String getTranslationPrivateApi(StreamReader sr)
{
String temp = sr.ReadLine();
if(temp != null)
{
return temp;
}
else
{
return "ERROR";
}
}
private String getTranslationPrivateKey(StreamReader sr)
{
String temp = sr.ReadLine();
if (temp != null)
{
return temp;
}
else
{
return "ERROR";
}
}
public override List<String> OutputTranslationS(String id)
{
this.name = id;
this.path = this.path + this.name + ".txt";
StreamReader sr = new StreamReader(this.path);
var temp = new List<String> { };
temp.Add(this.getTranslationPrivateApi(sr));
temp.Add(this.getTranslationPrivateKey(sr));
sr.Close();
return temp;
}
public override List<String> OutputTranslationName()
{
List<String> temp = new List<String> { };
StreamReader sr = new StreamReader(this.txtPath);
String temp2 = sr.ReadLine();
if (temp2 == null)
{
temp.Add("ERROR");
}
else
{
while (temp2 != null)
{
temp.Add(temp2);
temp2 = sr.ReadLine();
}
}
sr.Close();
return temp;
}
}
}

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WpfApp1.translationKey
{
class translationPublic : TranslationApiInt
{
public override List<String> OutputTranslationI(int id)
{
var temp = new List<String> { };
switch (id)
{
case 0://讯飞
{
temp.Add("");//APISecret
temp.Add("");//APIKey
break;
}
case 1://百度
{
temp.Add("");//APIAppid
temp.Add("");//APIKey
break;
}
case 2://google
{
temp.Add("");//NULL,空
temp.Add("");//APIKey
break;
}
}
return temp;
}
}
}
Loading…
Cancel
Save