This repository has been archived on 2025-01-01. You can view files and clone it, but cannot push or open issues or pull requests.
ShiftOS_TheReturn/ShiftOS.WinForms/WFLanguageProvider.cs

50 lines
1.3 KiB
C#
Raw Normal View History

2017-01-08 09:57:10 -05:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using ShiftOS.Engine;
using ShiftOS.Objects.ShiftFS;
namespace ShiftOS.WinForms
{
public class WFLanguageProvider : ILanguageProvider
{
public string[] GetAllLanguages()
{
return JsonConvert.DeserializeObject<string[]>(Properties.Resources.languages);
}
public string GetCurrentTranscript()
{
switch (SaveSystem.CurrentSave.Language)
{
case "deutsch - in beta":
return Properties.Resources.strings_de;
default:
return getDefault();
}
}
public List<string> GetJSONTranscripts()
{
var strings = new List<string>();
strings.Add(Properties.Resources.strings_en);
strings.Add(Properties.Resources.strings_de);
return strings;
}
public void WriteDefaultTranscript()
{
Utils.WriteAllText(Paths.GetPath("english.local"), getDefault());
}
private string getDefault()
{
return Properties.Resources.strings_en;
}
}
}