protected override void OnPreRender(EventArgs e) { using (new DNNContext(this)) { try { base.OnPreRender(e); var menuStyle = GetStringSetting("MenuStyle"); if (String.IsNullOrEmpty(menuStyle)) { menu = null; return; } var menuSettings = new Settings { MenuStyle = GetStringSetting("MenuStyle"), NodeXmlPath = GetStringSetting("NodeXmlPath"), NodeSelector = GetStringSetting("NodeSelector"), IncludeContext = GetBoolSetting("IncludeContext"), IncludeHidden = GetBoolSetting("IncludeHidden"), IncludeNodes = GetStringSetting("IncludeNodes"), ExcludeNodes = GetStringSetting("ExcludeNodes"), NodeManipulator = GetStringSetting("NodeManipulator"), TemplateArguments = DDRMenu.Settings.TemplateArgumentsFromSettingString(GetStringSetting("TemplateArguments")), ClientOptions = DDRMenu.Settings.ClientOptionsFromSettingString(GetStringSetting("ClientOptions")) }; MenuNode rootNode = null; if (String.IsNullOrEmpty(menuSettings.NodeXmlPath)) { rootNode = new MenuNode( Localiser.LocaliseDNNNodeCollection( Navigation.GetNavigationNodes( ClientID, Navigation.ToolTipSource.None, -1, -1, DNNAbstract.GetNavNodeOptions(true)))); } menu = MenuBase.Instantiate(menuStyle); menu.RootNode = rootNode; menu.ApplySettings(menuSettings); menu.PreRender(); } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } } }
public void ExpectSettingDefaultLanguageToSucceed() { ExpectLocaliserToInitialise(); Assert.IsTrue(Localiser.OverrideDefaultCulture("fr")); Assert.IsTrue(Localiser.RevertToDefaultCulture()); Assert.AreEqual("fr", Localiser.CurrentLocale.Name); }
public void ExpectSwitchingToValidLanguageToWork() { ExpectLocaliserToInitialise(); Assert.IsTrue(Localiser.SwitchCulture("fr")); Assert.AreEqual("Bonjour", TestLoc.Get(TestKeys.Test.Hello)); Assert.AreEqual("Merci", TestLoc.Get(TestKeys.Test.ThankYou)); Assert.AreEqual("Au revoir", TestLoc.Get(TestKeys.Test.Goodbye)); }
// Use this for initialization void Start() { paused = false; foreach (var item in new GameObject[] { resumetext, mainmenutext }) { Localiser.LocaliseUIElement(item.GetComponent <Text>()); item.SetActive(false); } }
// Autogenerated code: please make changes to the template file and re-generate public static bool Get(int key, out string target) { if (!Localiser.GetLocalisedString(key, out target)) { target = string.Empty; return(false); } return(true); }
void Start() { foreach (var item in new GameObject[] { gameOverText, scoreText, textTryAgain, textMainMenu }) { Localiser.LocaliseUIElement(item.GetComponent <Text>()); item.SetActive(false); } formatText = scoreText.GetComponent <Text>().text; buttonTryAgain.SetActive(false); buttonMainMenu.SetActive(false); }
void Start() { s = this; rt = GetComponent <RectTransform>(); t = GetComponent <Text>(); HighscoreRecttr = Highscore.GetComponent <RectTransform>(); lang = Localiser.GetString("score"); hilang = Localiser.GetString("hiscore"); scoreDirty = true; storedHiscore = GetHighscore(); initHiscore = storedHiscore; Highscore.text = $"<size=40>{hilang}</size> {ScoreString(storedHiscore)}"; }
protected override void OnPreRender(EventArgs e) { using (new DNNContext(this)) { try { base.OnPreRender(e); menu = MenuBase.Instantiate(MenuStyle); menu.ApplySettings( new Settings { MenuStyle = MenuStyle, NodeXmlPath = NodeXmlPath, NodeSelector = NodeSelector, IncludeContext = IncludeContext, IncludeHidden = IncludeHidden, IncludeNodes = IncludeNodes, ExcludeNodes = ExcludeNodes, NodeManipulator = NodeManipulator, ClientOptions = ClientOptions, TemplateArguments = TemplateArguments }); if (String.IsNullOrEmpty(NodeXmlPath)) { menu.RootNode = new MenuNode( Localiser.LocaliseDNNNodeCollection( Navigation.GetNavigationNodes( ClientID, Navigation.ToolTipSource.None, -1, -1, DNNAbstract.GetNavNodeOptions(true)))); } menu.PreRender(); } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } } }
void Awake() { Application.runInBackground = true; largestRes = Screen.resolutions[0]; foreach (Resolution res in Screen.resolutions) { if (res.width > largestRes.width) { largestRes = res; } } autosaveLocation = Application.persistentDataPath + "/autosave.chart"; viewMode = ViewMode.Chart; editor = ChartEditor.Instance; #if !UNITY_EDITOR workingDirectory = DirectoryHelper.GetMainDirectory(); #else workingDirectory = Application.dataPath; #endif // Bass init string audioInitErr = string.Empty; if (!AudioManager.Init(out audioInitErr)) { editor.errorManager.QueueErrorMessage(audioInitErr); } LoadGameSettings(); Localiser.LocaliseScene(); localEvents = LoadCommonEvents("local_events.txt"); globalEvents = LoadCommonEvents("global_events.txt"); InputField[] allInputFields = Resources.FindObjectsOfTypeAll <InputField>(); foreach (InputField inputField in allInputFields) { inputField.gameObject.AddComponent <InputFieldDoubleClick>(); } HintMouseOver.style = hintMouseOverStyle; }
void Close(bool rebindSuccess) { this.device = null; if (!rebindSuccess && rebinder != null) { rebinder.RevertMapBeingRebound(); } rebinder = null; gameObject.SetActive(false); rebindCompleteEvent.Fire(); if (ChartEditor.Instance) { ChartEditor.Instance.uiServices.SetPopupBlockingEnabled(false); } Localiser.LocaliseScene(); }
public void Bind(DNNNodeCollection objNodes, bool localise) { var clientOptions = new List <ClientOption>(); var ignoreProperties = new List <string> { "CustomAttributes", "NavigationControl", "SupportsPopulateOnDemand", "NodeXmlPath", "NodeSelector", "IncludeContext", "IncludeHidden", "IncludeNodes", "ExcludeNodes", "NodeManipulator" }; foreach (var prop in typeof(NavigationProvider).GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance)) { if (!string.IsNullOrEmpty(prop.Name) && !ignoreProperties.Contains(prop.Name)) { var propValue = prop.GetValue(this, null); if (propValue != null) { if (propValue is bool) { clientOptions.Add(new ClientBoolean(prop.Name, propValue.ToString())); } else if (propValue is int || propValue is decimal || propValue is double) { clientOptions.Add(new ClientNumber(prop.Name, propValue.ToString())); } else { clientOptions.Add(new ClientString(prop.Name, propValue.ToString())); } } } } if (CustomAttributes != null) { foreach (var attr in CustomAttributes) { if (!string.IsNullOrEmpty(attr.Name)) { clientOptions.Add(new ClientString(attr.Name, attr.Value)); } } } if (localise) { objNodes = Localiser.LocaliseDNNNodeCollection(objNodes); } menuControl.RootNode = new MenuNode(objNodes); menuControl.SkipLocalisation = !localise; menuControl.MenuSettings = new Settings { MenuStyle = GetCustomAttribute("MenuStyle") ?? MenuStyle ?? "DNNMenu", NodeXmlPath = GetCustomAttribute("NodeXmlPath"), NodeSelector = GetCustomAttribute("NodeSelector"), IncludeContext = Convert.ToBoolean(GetCustomAttribute("IncludeContext") ?? "false"), IncludeHidden = Convert.ToBoolean(GetCustomAttribute("IncludeHidden") ?? "false"), IncludeNodes = GetCustomAttribute("IncludeNodes"), ExcludeNodes = GetCustomAttribute("ExcludeNodes"), NodeManipulator = GetCustomAttribute("NodeManipulator"), ClientOptions = clientOptions, TemplateArguments = TemplateArguments, }; }
private Program(GameData gameData, Localiser localiser) { this.gameData = gameData; this.localiser = localiser; }
/// <summary> /// Initialises the static object. /// </summary> static PluginLocalise() { _Localiser = new Localiser(typeof(VirtualRadar.Localisation.Strings)); _Localiser.AddResourceStrings(typeof(FeedFilterStrings)); }
static Menu() { Localiser.ConfigureResourceType(typeof(Menu)); }
static Status() { Localiser.ConfigureResourceType(typeof(Status)); }
static Message() { Localiser.ConfigureResourceType(typeof(Message)); }
/// <summary> /// Initialises the static object. /// </summary> static PluginLocalise() { _Localiser = new Localiser(typeof(VirtualRadar.Localisation.Strings)); _Localiser.AddResourceStrings(typeof(DatabaseEditorStrings)); }
static UI() { Localiser.ConfigureResourceType(typeof(UI)); }