iink SDK on Device

Answered

Unable to change language

I did try to change the language but when using the method .language() it shows me that en_US is enabled. I do not why this is the case. Could look over my implementation ?  Thanks in advance for your help!

Here ist the print out in the debugger: image


Here is the file structure 

image


Last, but not least the implementation: 

// Configure the iink runtime environment

        let configurationPath = Bundle.main.bundlePath.appending("/recognition-assets/conf")

         // Tells the engine where to load the recognition assets from.

        do {

            try engine.configuration.set(stringArray: [configurationPath],

                                         forKey: "configuration-manager.search-path"// Tells the engine where to load the recognition assets from.

        } catch {

            print("Should not happen, please check your resources assets : " + error.localizedDescription)

            return nil

        }


        // Set the temporary directory

        do {

            try engine.configuration.set(string: NSTemporaryDirectory(),

                                         forKey: "content-package.temp-folder")

        } catch {

            print("Failed to set temporary folder: " + error.localizedDescription)

            return nil

        }

         

         // Load german language

         do {

             try engine.configuration.set(string: "lang", forKey: "de_DE")

         } catch {

             print("Error while loading the german language pack")

             return nil

         }                            


Best Answer

Dear Thanh Hoang,


Thank you for your question.


I think you should reverse the key and value in your language configuration:


    try engine.configuration.set(string: "de_DE", forKey: "lang")


Please, let us know if this fixes your issue.


Best regards,


Gwenaëlle


Dear Thanh Hoang,


Glad to see you succeeded in changing your language configuration.


Thank you for your update and pointing out this error in our documentation.

We will fix it accordingly!


Best regards,


Gwenaëlle


Dear Gwenaëlle, 

thanks! It works! 

Could you update your site https://developer.myscript.com/docs/interactive-ink/2.1/ios/fundamentals/interactive-ink-runtime ? This line should be wrong, too: 

configuration.set(string: "lang", forKey: "it_IT")

Answer

Dear Thanh Hoang,


Thank you for your question.


I think you should reverse the key and value in your language configuration:


    try engine.configuration.set(string: "de_DE", forKey: "lang")


Please, let us know if this fixes your issue.


Best regards,


Gwenaëlle


1 person likes this
Login or Signup to post a comment