private static void UpdateCurrentThreadCulture(int value) { Thread.CurrentThread.CurrentUICulture = new CultureInfo(LocalizationConverter.Convert(value)); Thread.CurrentThread.CurrentCulture = new CultureInfo(LocalizationConverter.Convert(value)); }
public CommandWindow(ICondition condition) { InitializeComponent(); Condition = condition; Title = new LocalizationConverter().Convert(Condition, null, null, null) as string; Initialize(condition, condition.GetType()); }
public CommandWindow(ICommand command) { InitializeComponent(); Command = command; Title = new LocalizationConverter().Convert(Command, null, null, null) as string; Initialize(command, command.GetType()); }
private void convertIndividualProteinNode(XElement proteinNode) { var membraneLocation = EnumHelper.ParseValue <MembraneLocation>(proteinNode.GetAttribute("membraneLocation")); var tissueLocation = EnumHelper.ParseValue <TissueLocation>(proteinNode.GetAttribute("tissueLocation")); var intracellularVascularEndoLocation = EnumHelper.ParseValue <IntracellularVascularEndoLocation>(proteinNode.GetAttribute("intracellularVascularEndoLocation")); var localization = LocalizationConverter.ConvertToLocalization(tissueLocation, membraneLocation, intracellularVascularEndoLocation); proteinNode.AddAttribute("localization", localization.ToString()); _converted = true; }
public void Data_with_prefix_should_be_empty() { DISetup.SetupContainer(); var locManager = new Mock <ILocalizationManager>(); locManager.Setup(s => s.GetResource(It.Is <string>(s => s == "prefix.test"))).Returns("test localization"); DISetup.Container.RegisterInstance(locManager.Object); var converter = new LocalizationConverter(); var result = converter.Convert("test 2", null, "prefix", null); result.Should().BeNull(); }
private Localization retrieveLocalizationFrom(SnapshotExpressionProfile snapshot, SnapshotContext snapshotContext) { if (!snapshotContext.IsV9FormatOrEarlier) { return(ModelValueFor(snapshot.Localization)); } //reset ot ensure we update all parameters var intracellularVascularEndoLocation = ModelValueFor(snapshot.IntracellularVascularEndoLocation); var tissueLocation = ModelValueFor(snapshot.TissueLocation); var membraneLocation = ModelValueFor(snapshot.MembraneLocation); return(LocalizationConverter.ConvertToLocalization(tissueLocation, membraneLocation, intracellularVascularEndoLocation)); }
private async Task <List <Sound> > GetPackagedSoundsAsync() { if (_packagedSoundCache == null) { StorageFolder appInstalledFolder = Windows.ApplicationModel.Package.Current.InstalledLocation; StorageFolder assets = await appInstalledFolder.GetFolderAsync("Assets"); StorageFile dataFile = await assets.GetFileAsync(DataFileName); using Stream dataStream = await dataFile.OpenStreamForReadAsync(); var sounds = await JsonSerializer.DeserializeAsync <List <Sound> >(dataStream); foreach (var s in sounds) { s.Name = LocalizationConverter.ConvertSoundName(s.Name); } _packagedSoundCache = sounds; } return(_packagedSoundCache.ToList()); }
public LocalizationBinding(string path) : base(path) { Converter = new LocalizationConverter(); }
public static CultureInfo GetCurrentCulture() { return(new CultureInfo(LocalizationConverter.Convert(culture))); }
public string GetText(int lang) { return(SystemNewsLocalized.First(l => l.Language == LocalizationConverter.Convert(lang)).NewsContentText); }
public string GetTopic(int lang) { return(SystemNewsLocalized.First(l => l.Language == LocalizationConverter.Convert(lang)).Header); }