コード例 #1
0
    private void OnDropDownChanged(int index)
    {
        Dropdown.OptionData option = dropdown.options[index];
        string       value         = option.text;
        LanguageType lang          = (LanguageType)Enum.Parse(typeof(LanguageType), value);

        LocalizationManager.ChangeLanguage(lang);
    }
コード例 #2
0
    public override void OnInspectorGUI()
    {
        EditorGUI.BeginChangeCheck();
        DrawDefaultInspector();

        string path = LocalizationManager.DirectoryPath;

        if (EditorGUI.EndChangeCheck())
        {
            LocalizationManager.ChangeLanguage(LocalizationManager.currentLanguage);
        }

        if (path != "")
        {
            if (!Directory.Exists(Application.dataPath + path))
            {
                EditorGUILayout.LabelField("TekkTech: Pfad existiert nicht.");
            }
        }

        LocalizationManager.newLanguage = (Languages)EditorGUILayout.EnumPopup(LocalizationManager.newLanguage, GUILayout.Width(EditorGUIUtility.currentViewWidth / 2f));

        GUI.enabled = LocalizationManager.currentLanguage != LocalizationManager.newLanguage && LocalizationManager.LanguageFileExists(LocalizationManager.newLanguage);

        string buttonText = "Switch Language";

        if (!LocalizationManager.LanguageFileExists(LocalizationManager.newLanguage))
        {
            buttonText = "Language File doesn't exist. Just load it.";
        }

        if (GUILayout.Button(buttonText))
        {
            LocalizationManager.ChangeLanguage(LocalizationManager.newLanguage);
        }
        GUI.enabled = true;
        GUILayout.Space(30);
    }
コード例 #3
0
ファイル: PxWeb.Master.cs プロジェクト: stefguggisberg/PxWeb
        protected void Page_Init(object sender, EventArgs e)
        {
            if (!PXWeb.Settings.Current.Selection.StandardApplicationHeadTitle)
            {
                HeadTitle = Server.HtmlEncode(GetLocalizedString("PxWebApplicationTitle"));
            }

            if (DoNotUseBreadCrumb())
            {
                Page.Controls.Remove(this.breadcrumb1);
            }

            //Add eventhandlers
            LinkManager.RegisterEnsureQueries(new EnsureQueriesEventHandler(LinkManager_EnsureQueries));

            if (PxUrlObj.Language != null)
            {
                if (!(LocalizationManager.CurrentCulture.Name == PxUrlObj.Language))
                {
                    if (PxUrlObj.Database != null)
                    {
                        DatabaseInfo dbi = null;
                        dbi = PXWeb.Settings.Current.General.Databases.GetDatabase(PxUrlObj.Database);

                        if (dbi.Type == DatabaseType.CNMM)
                        {
                            PCAxis.Web.Core.Management.PaxiomManager.PaxiomModelBuilder = null;
                            PCAxis.Web.Core.Management.PaxiomManager.PaxiomModel        = null;
                        }
                    }
                    LocalizationManager.ChangeLanguage(PxUrlObj.Language);
                }
            }
            else
            {
                string lang = PXWeb.Settings.Current.General.Language.DefaultLanguage;
                LocalizationManager.ChangeLanguage(lang);

                List <LinkManager.LinkItem> linkItems = new List <LinkManager.LinkItem>();
                //linkItems.Add(new LinkManager.LinkItem(PxUrlObj.Language, lang));
                linkItems.Add(new LinkManager.LinkItem(PxUrl.LANGUAGE_KEY, lang));

                //Replaced Request.Url.AbsolutePath with Request.AppRelativeCurrentExecutionFilePath
                //so that the links will be right even if the site is running without UserFriendlyURL
                string url = PCAxis.Web.Core.Management.LinkManager.CreateLink(Request.AppRelativeCurrentExecutionFilePath, linkItems.ToArray());
                Response.Redirect(url);
            }

            ////Add eventhandlers
            //LinkManager.EnsureQueries += new LinkManager.EnsureQueriesEventHandler(LinkManager_EnsureQueries);
            _imagesPath = PXWeb.Settings.Current.General.Paths.ImagesPath;
            _logoPath   = PXWeb.Settings.Current.General.Site.LogoPath;
            LoadPageContent();

            if (!IsPostBack)
            {
                if (!DoNotUseBreadCrumb())
                {
                    InitializeBreadcrumb();
                }


                if (PXWeb.Settings.Current.Navigation.ShowNavigationFlow)
                {
                    InitializeNavigationFlow();
                }
            }

            if (!DoNotUseBreadCrumb())
            {
                breadcrumb1.GetMenu = GetMenu;
            }

            //navigationFlowControl.GetMenu = GetMenu;
        }
コード例 #4
0
 private void OnBtnClick(LanguageType lang)
 {
     LocalizationManager.ChangeLanguage(lang);
 }
コード例 #5
0
 public void SetLanguageToKeys()
 {
     LocalizationManager.ChangeLanguage(Language.Keys);
 }
コード例 #6
0
 public void SetLanguageToFrench()
 {
     LocalizationManager.ChangeLanguage(Language.FrenchTest);
 }
コード例 #7
0
 public void SetLanguageToEnglish()
 {
     LocalizationManager.ChangeLanguage(Language.EnglishUS);
 }