Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Change a language on demand (Read 5142 times)
Annes
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Jun 4th, 2018
Change a language on demand
Jun 4th, 2018 at 2:50pm
Print Post  
Hello,

I have a question about changing language manually.
I'm working on an application multilanguage and the issue is when a user choose a language from the list of language availble; at this time the language of keyboard must be changed. I tried to find the action thats help me to change the language of MindFusion virtual keyboard on demand but I didn't find it Sad.

Thank you in advance.
Sincerly,
Annes
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3204
Joined: Oct 19th, 2005
Re: Change a language on demand
Reply #1 - Jun 5th, 2018 at 5:24am
Print Post  
Hi,

If only for your own process, setting keyboard.InputLocale should change the language too.

If StandAlone mode is enabled the keyboard follows active application's current language and InputLocale automatically updates to reflect it once you activate another app. If you need to change external app's input language, you should be able to by sending WM_INPUTLANGCHANGEREQUEST Windows message to the application's main window like PostMessage(hWnd, WM_INPUTLANGCHANGEREQUEST, INPUTLANGCHANGE_FORWARD, MYLOCALE);

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Annes
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Jun 4th, 2018
Re: Change a language on demand
Reply #2 - Jun 5th, 2018 at 11:26am
Print Post  
Thak you. For the context of the application I just need to change the InputLanguageManager.Current.CurrentInputLanguage. With this change I do my job.

Sincerly,
Annes
  
Back to top
 
IP Logged
 
Annes
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Jun 4th, 2018
Re: Change a language on demand
Reply #3 - Jul 18th, 2018 at 3:16pm
Print Post  
I have another problem. You find bellow the code that I use it in code-behind to change the keyboard language:

Code
Select All
<Grid x:Name="GridKeyboard" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

        <vk:VirtualKeyboard x:Name="KeyboardVirtual" HorizontalAlignment="Left" VerticalAlignment="Top" InputLocale="{Binding InputLocale,ElementName=wKeyboard}"/>



    </Grid>
 



Code
Select All
public partial class KeyboardMiniMind_Window : UserControl, INotifyPropertyChanged
    {
        public KeyboardMiniMind_Window()
        {
            InitializeComponent();
            KeyboardVirtual.InputLocale = LanguageLocalizerApp.SelectedLanguage;
            KeyboardMindFusionVM vm = this.DataContext as KeyboardMindFusionVM;
            KeyboardVirtual.TemplateLayout = vm.GetCustomLayout();
            DataContext = vm;
        }
 



This change the keyboard language, but I change also the keyboard system language. In the context of my application, I must not change system keyboard lanaguage.

Could you please find another way for changing the keyabord language without changing system keyboard language.

Thank you.

Sincerely,
Annes
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint