InformationModel.LookupTranslation(localizedText)
引数の
NamespaceIndex
および TextId
プロパティに基づいて、キーと関連付けられた翻訳を読み取ります。LocaleId
および、セッションロケールに基づいて値が割り当てられている LocalizedText
オブジェクトの Text
のプロパティを返します。LocalizedText LookupTranslation(LocalizedTextlocalizedText);
引数
- localizedText(LocalizedText)
- TextIdとNamespaceIndexプロパティが対象のキーを識別する C# オブジェクト。
戻り値
- LocalizedText
- TextおよびLocaleIdプロパティが、指定されたキーとセッション ロケールに基づいて値が割り当てられる C# オブジェクト。
例
次の例は、要求された翻訳文字列を含む
LocalizedText
タイプの translation
オブジェクトを Key1
キーと関連付けて返す API を示しています。API 引数は、その TextId
プロパティを定義するコンストラクタを使用して作成された LocalizedText
オブジェクトです。この
translation
オブジェクトは、セッションロケールに基づいてラベルの label1
テキストを設定するために使用されます。var myLocalizedText = new LocalizedText("Key1"); var translation = InformationModel.LookupTranslation(myLocalizedText); var label1 = Owner.Get<Label>("Label1"); label1.Text = "Translation: " + translation.Text;
ご質問やご意見