Google translate API lib for DNX
parent
8632f544b5
commit
4ea4d5b795
@ -0,0 +1,118 @@
|
|||||||
|
using GoogleTranslateNET.Misc;
|
||||||
|
|
||||||
|
namespace GoogleTranslateNET
|
||||||
|
{
|
||||||
|
public enum Language
|
||||||
|
{
|
||||||
|
Unknown,
|
||||||
|
Automatic,
|
||||||
|
[StringValue("af")]
|
||||||
|
Afrikaans,
|
||||||
|
[StringValue("sq")]
|
||||||
|
Albanian,
|
||||||
|
[StringValue("ar")]
|
||||||
|
Arabic,
|
||||||
|
[StringValue("be")]
|
||||||
|
Belarusian,
|
||||||
|
[StringValue("bg")]
|
||||||
|
Bulgarian,
|
||||||
|
[StringValue("ca")]
|
||||||
|
Catalan,
|
||||||
|
[StringValue("zh")]
|
||||||
|
ChineseSimplified,
|
||||||
|
[StringValue("zh-TW")]
|
||||||
|
ChineseTraditional,
|
||||||
|
[StringValue("hr")]
|
||||||
|
Croatian,
|
||||||
|
[StringValue("cs")]
|
||||||
|
Czech,
|
||||||
|
[StringValue("da")]
|
||||||
|
Danish,
|
||||||
|
[StringValue("nl")]
|
||||||
|
Dutch,
|
||||||
|
[StringValue("en")]
|
||||||
|
English,
|
||||||
|
[StringValue("eo")]
|
||||||
|
Esperanto,
|
||||||
|
[StringValue("et")]
|
||||||
|
Estonian,
|
||||||
|
[StringValue("tl")]
|
||||||
|
Filipino,
|
||||||
|
[StringValue("fi")]
|
||||||
|
Finnish,
|
||||||
|
[StringValue("fr")]
|
||||||
|
French,
|
||||||
|
[StringValue("gl")]
|
||||||
|
Galician,
|
||||||
|
[StringValue("de")]
|
||||||
|
German,
|
||||||
|
[StringValue("el")]
|
||||||
|
Greek,
|
||||||
|
[StringValue("ht")]
|
||||||
|
HaitianCreole,
|
||||||
|
[StringValue("iw")]
|
||||||
|
Hebrew,
|
||||||
|
[StringValue("hi")]
|
||||||
|
Hindi,
|
||||||
|
[StringValue("hu")]
|
||||||
|
Hungarian,
|
||||||
|
[StringValue("is")]
|
||||||
|
Icelandic,
|
||||||
|
[StringValue("id")]
|
||||||
|
Indonesian,
|
||||||
|
[StringValue("ga")]
|
||||||
|
Irish,
|
||||||
|
[StringValue("it")]
|
||||||
|
Italian,
|
||||||
|
[StringValue("ja")]
|
||||||
|
Japanese,
|
||||||
|
[StringValue("ko")]
|
||||||
|
Korean,
|
||||||
|
[StringValue("lv")]
|
||||||
|
Latvian,
|
||||||
|
[StringValue("lt")]
|
||||||
|
Lithuanian,
|
||||||
|
[StringValue("mk")]
|
||||||
|
Macedonian,
|
||||||
|
[StringValue("ms")]
|
||||||
|
Malay,
|
||||||
|
[StringValue("mt")]
|
||||||
|
Maltese,
|
||||||
|
[StringValue("no")]
|
||||||
|
Norwegian,
|
||||||
|
[StringValue("fa")]
|
||||||
|
Persian,
|
||||||
|
[StringValue("pl")]
|
||||||
|
Polish,
|
||||||
|
[StringValue("pt")]
|
||||||
|
Portuguese,
|
||||||
|
[StringValue("ro")]
|
||||||
|
Romanian,
|
||||||
|
[StringValue("ru")]
|
||||||
|
Russian,
|
||||||
|
[StringValue("sr")]
|
||||||
|
Serbian,
|
||||||
|
[StringValue("sk")]
|
||||||
|
Slovak,
|
||||||
|
[StringValue("sl")]
|
||||||
|
Slovenian,
|
||||||
|
[StringValue("es")]
|
||||||
|
Spanish,
|
||||||
|
[StringValue("sw")]
|
||||||
|
Swahili,
|
||||||
|
[StringValue("sv")]
|
||||||
|
Swedish,
|
||||||
|
[StringValue("th")]
|
||||||
|
Thai,
|
||||||
|
[StringValue("tr")]
|
||||||
|
Turkish,
|
||||||
|
[StringValue("uk")]
|
||||||
|
Ukrainian,
|
||||||
|
[StringValue("vi")]
|
||||||
|
Vietnamese,
|
||||||
|
[StringValue("cy")]
|
||||||
|
Welsh,
|
||||||
|
[StringValue("yi")]
|
||||||
|
Yiddish
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace GoogleTranslateNET.Misc
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This attribute is used to represent a string value
|
||||||
|
/// for a value in an enum.
|
||||||
|
/// </summary>
|
||||||
|
public class StringValueAttribute : Attribute
|
||||||
|
{
|
||||||
|
public string StringValue { get; private set; }
|
||||||
|
|
||||||
|
public StringValueAttribute(string value)
|
||||||
|
{
|
||||||
|
StringValue = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
namespace GoogleTranslateNET.Objects.Error
|
||||||
|
{
|
||||||
|
public class ErrorData
|
||||||
|
{
|
||||||
|
public string Domain { get; set; }
|
||||||
|
public string Reason { get; set; }
|
||||||
|
public string Message { get; set; }
|
||||||
|
public string LocationType { get; set; }
|
||||||
|
public string Location { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
namespace GoogleTranslateNET.Objects.Error
|
||||||
|
{
|
||||||
|
public class ErrorResponse
|
||||||
|
{
|
||||||
|
public Error Error { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
namespace GoogleTranslateNET.Objects.LanguageDetection
|
||||||
|
{
|
||||||
|
public class LanguageDetection
|
||||||
|
{
|
||||||
|
public string Language { get; set; }
|
||||||
|
public bool IsReliable { get; set; }
|
||||||
|
public float Confidence { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace GoogleTranslateNET.Objects.LanguageDetection
|
||||||
|
{
|
||||||
|
public class LanguageDetectionData
|
||||||
|
{
|
||||||
|
public List<List<LanguageDetection>> Detections { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
namespace GoogleTranslateNET.Objects.LanguageDetection
|
||||||
|
{
|
||||||
|
public class LanguageDetectionResult
|
||||||
|
{
|
||||||
|
public LanguageDetectionData Data { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace GoogleTranslateNET.Objects.SupportedLanguages
|
||||||
|
{
|
||||||
|
public class SupportedLanguageData
|
||||||
|
{
|
||||||
|
public List<TranslationLanaguage> Languages { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
namespace GoogleTranslateNET.Objects.SupportedLanguages
|
||||||
|
{
|
||||||
|
public class SupportedLanguageResult
|
||||||
|
{
|
||||||
|
public SupportedLanguageData Data { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
namespace GoogleTranslateNET.Objects.SupportedLanguages
|
||||||
|
{
|
||||||
|
public class TranslationLanaguage
|
||||||
|
{
|
||||||
|
public string Language { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
namespace GoogleTranslateNET.Objects.Translation
|
||||||
|
{
|
||||||
|
public class TranslateResult
|
||||||
|
{
|
||||||
|
public TranslationData Data { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
namespace GoogleTranslateNET.Objects.Translation
|
||||||
|
{
|
||||||
|
public class Translation
|
||||||
|
{
|
||||||
|
public string TranslatedText { get; set; }
|
||||||
|
public string DetectedSourceLanguage { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace GoogleTranslateNET.Objects.Translation
|
||||||
|
{
|
||||||
|
public class TranslationData
|
||||||
|
{
|
||||||
|
public List<Translation> Translations { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
{
|
||||||
|
"version": "1.0.5-*",
|
||||||
|
"title": "Yavsc Google Translate [DNX]",
|
||||||
|
"description": "Google Translate for DNX",
|
||||||
|
"authors": [
|
||||||
|
"Paul Schneider <paul@pschneider.fr>"
|
||||||
|
],
|
||||||
|
"packOptions": {
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/pazof/yavsc"
|
||||||
|
},
|
||||||
|
"licenseUrl": "https://github.com/pazof/yavsc/blob/vnext/LICENSE",
|
||||||
|
"requireLicenseAcceptance": true,
|
||||||
|
"owners": [
|
||||||
|
"Paul Schneider <paul@pschneider.fr>"
|
||||||
|
],
|
||||||
|
"summary": "CSharp Google Tranlate API",
|
||||||
|
"projectUrl": "http://yavsc.pschneider.fr",
|
||||||
|
"tags": [
|
||||||
|
"Translation"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"tooling": {
|
||||||
|
"defaultNamespace": "Yavsc"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"Newtonsoft.Json": "9.0.1",
|
||||||
|
"Gapi.net45": "1.0.1",
|
||||||
|
"RestSharp": "103.4.0"
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"dnx451": {
|
||||||
|
"frameworkAssemblies": {
|
||||||
|
"System.ComponentModel.DataAnnotations": "4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"net46": {
|
||||||
|
"frameworkAssemblies": {
|
||||||
|
"System.ComponentModel.DataAnnotations": "4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"net461": {
|
||||||
|
"frameworkAssemblies": {
|
||||||
|
"System.ComponentModel.DataAnnotations": "4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"net452": {
|
||||||
|
"frameworkAssemblies": {
|
||||||
|
"System.ComponentModel.DataAnnotations": "4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"net451": {
|
||||||
|
"frameworkAssemblies": {
|
||||||
|
"System.ComponentModel.DataAnnotations": "4.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue