using System.Globalization;
using Valg.EVA.Skanning.Resources;
using Valg.EVA.Skanning.Resources.Language;

namespace Valg.EVA.Skanning.UserInterfaceElements.Language
{
    public class LanguageManager : ViewModelBase, ILanguageManager
    {
        public void SetGuiLanguage(string language)
        {
            var cultureInfo = new CultureInfo(language);
            LanguageString.Culture = cultureInfo;
            ScanLanguageString.Culture = cultureInfo;
            VerifyLanguageString.Culture = cultureInfo;
            JobManagementLanguageString.Culture = cultureInfo;
            LanguageResource.Initialize(cultureInfo);

            PublishEvent<LanguageChangedEvent, LanguageChangedEventArgs>(new LanguageChangedEventArgs());
        }
    }
}

