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