1.1.1              国际化组件

 

Author

Contact

Jin-Chen Zhu,LangChao

zhujch@langchao.com

 

1.1.1.1           Goal

国际化组件可以将非特定语言的字符串转化成特定语言的字符串,还可以通过反射的方式将某一界面上控件的文字换成特定语言的文字。

 

1.1.1.2           Context

国际化组件的设计
1.1.1.3          
Behavior View

 

 

1.1.1.4           Structure View
国际化组件的设计

 

 

国际化组件的设计
1.1.1.5          
Other Specification

 

 

1.1.1.6           Best Practice

ResourceFactory fa = ResourceFactory.GetInstance();

            GspRM resourceManager = null;

            if (comboBox1.Text == "中文")

            {

                resourceManager = fa.GetRM("formui", "zh-cn");

                //resourceManager = fa.GetRM("aa","zh-cn");

                FormLanguageSwitchSingleton change = FormLanguageSwitchSingleton.Instance;

                change.ChangeLanguage(this, new System.Globalization.CultureInfo("zh-chs"));

            }

            else

            {

                resourceManager = fa.GetRM("formui", "en-us");

                FormLanguageSwitchSingleton change = FormLanguageSwitchSingleton.Instance;

                change.ChangeLanguage(this, new System.Globalization.CultureInfo("en-us"));

            }

            MessageBox.Show(resourceManager.GetLocalizeToken("result", "jane"));

相关文章:

  • 2021-10-20
  • 2022-12-23
  • 2021-12-24
  • 2022-12-23
  • 2021-11-15
  • 2022-12-23
  • 2021-12-15
猜你喜欢
  • 2022-02-18
  • 2021-12-27
  • 2021-07-14
  • 2021-07-11
  • 2021-09-06
  • 2022-12-23
  • 2021-10-16
相关资源
相似解决方案