Text

Answered

Problem using two configuration together

Hi Team,

I have one page on android and it uses 3 fragments on that.

My conf file is as below. In two of the fragments I have initialized myscript engine with "text". In one of the fragments I have initialized myscript engine with "custom"

However the myscript engine is only picking up the custom configuration in all the 3 fragments

Am i doing something wrong?

Regards,

Piyush

Bundle-Version: 1.0

Bundle-Name: en_US

Configuration-Script:

 AddResDir ../resources/

Name: text

Type: Text

Configuration-Script:

 AddResource en_US/en_US-ak-cur.res

 AddResource en_US/en_US-lk-text.res

 EnableAlienCharacters

 SetTextListSize 1

 SetWordListSize 5

 SetCharListSize 1


Name: custom

Type: Text

Configuration-Script:

 AddResource en_US/en_US-ak-cur.res

 AddResource en_US/en_US-lk-grm.res

 AddResource en_US/custom_list.res

 EnableAlienCharacters

 SetTextListSize 1

 SetWordListSize 5

 SetCharListSize 1


Best Answer

Dear Piyush,

Thank you for your question.

Currently, you can set the configuration at 2 levels, either at the "engine level" or at the "editor level".

The engine level is the way we proceed in the getStarted sample we provide:
Configuration conf = engine.getConfiguration();
String confDir = "zip://" + getPackageCodePath() + "!/assets/conf";
conf.setStringArray("configuration-manager.search-path", new String[]{confDir});
String tempDir = getFilesDir().getPath() + File.separator + "tmp";
conf.setString("content-package.temp-folder", tempDir);
conf.setString("lang","zh_CN");
conf.setString("mode","text");


=>If proceeding this way, all the editors you will create will have the same configuration

For the editor level, you shall proceed as follows:
Configuration conf = editor.getConfiguration();
conf.setString("lang","zh_CN");
conf.setString("mode","text");


In your case, based on the above, I guess you are using several editors? In that case, you understand you shall proceed at the editor level.

Best regards,

Olivier

1 Comment

Answer

Dear Piyush,

Thank you for your question.

Currently, you can set the configuration at 2 levels, either at the "engine level" or at the "editor level".

The engine level is the way we proceed in the getStarted sample we provide:
Configuration conf = engine.getConfiguration();
String confDir = "zip://" + getPackageCodePath() + "!/assets/conf";
conf.setStringArray("configuration-manager.search-path", new String[]{confDir});
String tempDir = getFilesDir().getPath() + File.separator + "tmp";
conf.setString("content-package.temp-folder", tempDir);
conf.setString("lang","zh_CN");
conf.setString("mode","text");


=>If proceeding this way, all the editors you will create will have the same configuration

For the editor level, you shall proceed as follows:
Configuration conf = editor.getConfiguration();
conf.setString("lang","zh_CN");
conf.setString("mode","text");


In your case, based on the above, I guess you are using several editors? In that case, you understand you shall proceed at the editor level.

Best regards,

Olivier