public string GetVariable(string name, string locale = null)
{
NameValueCollection variable;
if (!this.Variables.TryGetValue(name, out variable))
return null;
var result = variable["default"];
if (locale != null && this.Locales.ContainsKey(locale))
{
var localeInfo = this.Locales[locale];
foreach (string localeName in localeInfo.ResourceNames)
{
if (variable[localeName] != null)
{
result = variable[localeName];
break;
}
}
}
return result;
}