現在WPF/XAMLでアプリケーションをビルドする必要があります。これは現在C#で行われています。
私もこのコードを書いていないので、すべてについて説明することはできません。WPF/XAMLで言語を変更する方法
ホームメニューでユーザーが選択したものにアプリの言語を変更するコードが必要です。これはC#で動作するコードです:
public static void TranslateForm(string Language, Form f)
{
try
{
string Sprachtext = string.Empty;
clstools tools = new clstools(string.Format(string.Format(clsGlobal.CONNECTION_STRING, clsGlobal.TNSNames,
clsGlobal.DBUser, clsGlobal.DBPassword)), clsGlobal.IDOPERATOR);
//caption text of the form :-)
try
{
if (f.Tag != null)
{
if (tools.IsNumeric(f.Tag.ToString()) == true)
{
Sprachtext = string.Empty;
if (tools.GetLanguageText(Convert.ToInt32(f.Tag.ToString()), Language, ref Sprachtext) == true)
{
f.Text = Sprachtext;
}
}
}
}
catch (Exception)
{
//ignore and proceed
}
foreach (Control c in f.Controls)
{
if (c.Tag != null)
{
if (string.IsNullOrEmpty(c.Tag.ToString()) == false)
{
if (tools.IsNumeric(c.Tag.ToString()) == true)
{
Sprachtext = string.Empty;
if (tools.GetLanguageText(Convert.ToInt32(c.Tag.ToString()), Language, ref Sprachtext) == true)
{
c.Text = Sprachtext;
}
}
}
}
}
}
catch (Exception)
{
//ignore
}
}
これに答える質問があれば教えてください。
また、この質問を改善するものがあれば教えてください。
var culture = "en-GB"; Thread.CurrentThread.CurrentCulture =新しいCultureInfo(カルチャ); Thread.CurrentThread.CurrentUICulture =新しいCultureInfo(カルチャ); – jannagy02