26 lines
682 B
C#
26 lines
682 B
C#
using JetBrains.Annotations;
|
|
using System;
|
|
|
|
namespace BEG.Localization
|
|
{
|
|
public interface ITranslation
|
|
{
|
|
[PublicAPI] string Key { get; }
|
|
|
|
[PublicAPI] void Get(Action<string> action, Language language, params LocalizationContext[] contexts);
|
|
}
|
|
|
|
public class SimpleTranslation: ITranslation
|
|
{
|
|
public string Key { get; }
|
|
public void Get(Action<string> action, Language language, params LocalizationContext[] contexts) => action?.Invoke(value);
|
|
|
|
private readonly string value;
|
|
|
|
public SimpleTranslation(string key, string value)
|
|
{
|
|
Key = key;
|
|
this.value = value;
|
|
}
|
|
}
|
|
} |