2020-01-26 19:06:50 -05:00
|
|
|
|
using SharedLibraryCore.Interfaces;
|
2018-04-22 16:04:18 -04:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace SharedLibraryCore.Localization
|
|
|
|
|
{
|
|
|
|
|
public class Layout
|
|
|
|
|
{
|
|
|
|
|
public string LocalizationName { get; set; }
|
2020-01-26 19:06:50 -05:00
|
|
|
|
public TranslationLookup LocalizationIndex { get; set; }
|
2018-05-05 16:36:26 -04:00
|
|
|
|
|
|
|
|
|
public Layout(Dictionary<string, string> set)
|
|
|
|
|
{
|
2020-01-26 19:06:50 -05:00
|
|
|
|
LocalizationIndex = new TranslationLookup()
|
2018-05-05 16:36:26 -04:00
|
|
|
|
{
|
|
|
|
|
Set = set
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-26 19:06:50 -05:00
|
|
|
|
public class TranslationLookup : ITranslationLookup
|
2018-05-05 16:36:26 -04:00
|
|
|
|
{
|
|
|
|
|
public Dictionary<string, string> Set { get; set; }
|
|
|
|
|
|
|
|
|
|
public string this[string key]
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (!Set.TryGetValue(key, out string value))
|
2018-08-28 17:32:59 -04:00
|
|
|
|
{
|
2018-09-13 21:00:41 -04:00
|
|
|
|
return key;
|
2018-08-28 17:32:59 -04:00
|
|
|
|
}
|
2018-05-05 16:36:26 -04:00
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-22 16:04:18 -04:00
|
|
|
|
}
|
2018-05-05 16:36:26 -04:00
|
|
|
|
|
2018-04-22 16:04:18 -04:00
|
|
|
|
}
|