protected override void HandleDownstreamVirtualCompanionExecutionContext(IVirtualCompanionExecutionContext context) { if (!context.TryGetTextInputFeature("en", out _)) { var features = context.GetFeatures <TextInputFeature>(); var textValue = features?.FirstOrDefault()?.Text; // translate text value context.AddTextInputFeature("en", "Hello World"); } }
public static bool TryGetTextInputFeature(this IVirtualCompanionExecutionContext context, string culture, out string text) { var cultureInfo = CultureInfo.GetCultureInfo(culture); return(context.TryGetTextInputFeature(cultureInfo, out text)); }