Interactive Ink

How to switch language recognition?

例如:conf .setString(“lang”,“en_US”); change :: “conf .setString(”lang“,”zh_CN“);以及如何切换部分;例如:: conf .setString(”text.configuration.name“,”text“);更改::“”conf .setString(“text.configuration.name”,“text”);

在初始化之后,我试图将语言从英语切换到Chiese,所以我有另一个初始化。然后它报告:Log:包已经打开。如何切换语言?





Dear XiangJue,


thank you for your question.


Currently, you should set the language when starting the iink SDK, just after engine creation. Please refer to the below example. Also, please make sure you properly deployed the "zh_CN" language package.


Best regards,


Olivier



            try
            {
                // Initialize Interactive Ink runtime environment
                _engine = Engine.Create(MyScript.Certificate.MyCertificate.Bytes);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                Close();
                return;
            }

            // Folders "conf" and "resources" are currently parts of the layout
            // (for each conf/res file of the project => properties => "Build Action = content")
            string[] confDirs = new string[1];
            confDirs[0] = "conf";
            _engine.Configuration.SetStringArray("configuration-manager.search-path", confDirs);

            var localFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
            var tempFolder =  Path.Combine(localFolder, "MyScript", "tmp");
            _engine.Configuration.SetString("content-package.temp-folder", tempFolder);
            _engine.Configuration.SetString("lang", "zh_CN");

I'll do as you say,But  ,Why do I still recognize English after setting Chinese???   Are you answering JAVA code?

image

image


Dear XiangJue,


can you confirm you installed the corresponding Simplfied Chinese assets available for download: https://developer.myscript.com/support/recognition-assets


If so, can you please check your logs, as you should have an error message.


Best regards,


Olivier

Login or Signup to post a comment