-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLanguageCodeToLocation.cs
48 lines (46 loc) · 2.18 KB
/
LanguageCodeToLocation.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
namespace AppraisalBot
{
public static class LanguageCodeToLocation
{
public static string LookUp(Microsoft.ProjectOxford.Vision.Contract.OcrResults ocrResults)
{
return LookUp(ocrResults.Language);
}
public static string LookUp(string languageCode)
{
// List of languages from: https://westus.dev.cognitive.microsoft.com/docs/services/56f91f2d778daf23d8ec6739/operations/56f91f2e778daf14a499e1fc
// Also see Microsoft.ProjectOxford.Vision.Contract.LanguageCodes
switch (languageCode)
{
case "unk": return null; // unknown
case "zh-Hans": return "China"; //(ChineseSimplified)
case "zh-Hant": return "China";//(ChineseTraditional)
case "cs": return "Czechia";//(Czech)
case "da": return "Denmark"; //(Danish)
case "nl": return "Netherlands"; //(Dutch)
case "en": return "United States"; //(English)
case "fi": return "Finland"; //(Finnish)
case "fr": return "France"; //(French)
case "de": return "Germany"; //(German)
case "el": return "Greece"; //(Greek)
case "hu": return "Hungary"; //(Hungarian)
case "it": return "Italy"; //(Italian)
case "ja": return "Japan"; //(Japanese)
case "ko": return "Korea"; //(Korean)
case "nb": return "Norway"; //(Norwegian)
case "pl": return "Poland"; //(Polish)
case "pt": return "Portugal"; //(Portuguese,
case "ru": return "Russia"; //(Russian)
case "es": return "Mexico"; //(Spanish)
case "sv": return "Sweden"; //(Swedish)
case "tr": return "Turkey"; //(Turkish)
case "ar": return "Pakistan"; //(Arabic)
case "ro": return "Romania"; //(Romanian)
case "sr-Cyrl": return "Serbia"; //(SerbianCyrillic)
case "sr-Latn": return "Serbia"; //(SerbianLatin)
case "sk": return "Slovakia"; //(Slovak)
}
return null;
}
}
}