public static string GetTranslation(string text, string defaultValue = null)
{
if (TranslationDictionary == null) {
TranslationDictionary = new Dictionary<string, string>();
using(var reader = new StreamReader(new GZipStream(new MemoryStream(Properties.Resources.Translations, false), CompressionMode.Decompress), Encoding.UTF8)) {
string line;
reader.ReadLine();
while ((line = reader.ReadLine()) != null) {
var split = line.IndexOf('\t');
if (split < 0)
continue;
TranslationDictionary[line.Substring(0, split)] = line.Substring(split + 1);
}
}
}
return TranslationDictionary.TryGetValue(text, defaultValue);
}