Simply3DScan
Translator.Translate Class Reference

Public Member Functions

 Translate ()
 
string GetString (string englishString, Language language)
 Gets the translated string. More...
 

Detailed Description

Definition at line 11 of file Translate.cs.

Constructor & Destructor Documentation

Translator.Translate.Translate ( )

Definition at line 18 of file Translate.cs.

19  {
20  this.ReadGermanDictionary();
21  }

Member Function Documentation

string Translator.Translate.GetString ( string  englishString,
Language  language 
)

Gets the translated string.

Parameters
englishStringThe english string.
languageThe language.
Returns

Definition at line 49 of file Translate.cs.

50  {
51  switch (language)
52  {
53  case Language.Deutsch:
54  if(this.germanDictionary.ContainsKey(englishString))
55  return this.germanDictionary[englishString];
56  Singleton<Logger>.Instance.LogWarning($"No translation for {englishString}");
57  return englishString;
58  case Language.English:
59  return englishString;
60  default:
61  Singleton<Logger>.Instance.LogWarning($"Language not supported {language}");
62  return englishString;
63  }
64  }
Class for creating a singleton for a generic class
Definition: Singleton.cs:9
static T Instance
Gets the instance.
Definition: Singleton.cs:27

The documentation for this class was generated from the following file: