1
0
mirror of synced 2024-11-28 09:20:53 +01:00
OpenTaiko/TJAPlayer3/Components/CLocalizationData.cs

31 lines
795 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace TJAPlayer3
{
internal class CLocalizationData
{
[JsonProperty("strings")]
private Dictionary<string, string> Strings = new Dictionary<string, string>();
public CLocalizationData()
{
Strings = new Dictionary<string, string>();
}
public string GetString(string defaultsDefault)
{
string _lang = CLangManager.fetchLang();
if (Strings.ContainsKey(_lang))
return Strings[_lang];
else if (Strings.ContainsKey("default"))
return Strings["default"];
return defaultsDefault;
}
}
}