Page 1 of 1

Webapp localization

Posted: Thu Aug 18, 2016 11:48 am
by Konstantin
I use English localization on my computer so when I type English text editor checks mistakes in words rightly but when I type Russian text all words underlined as not correct.

On another computer we use Russian localization so we have opposite situation.

How can I configurate editor to support some language?

Re: Webapp localization

Posted: Thu Aug 18, 2016 12:35 pm
by cristi_talau
Hello,

You may want to set the default spellchecking language. Otherwise the server language is used.

You can do this by updating the options.xml file to set it to English for example. You basically need to add an entry like the one below:

Code: Select all


<entry>
<String>spell.check.options</String>
<spellCheckOptions>
<field name="automaticSpellCheck">
<Boolean>true</Boolean>
</field>
<field name="automaticSpellCheckContentTypes">
<String-array>
<String>text/html</String>
<String>text/nvdl</String>
<String>text/plain</String>
<String>text/properties</String>
<String>text/rng</String>
<String>text/sch</String>
<String>text/wsdl</String>
<String>text/xml</String>
<String>text/xproc</String>
<String>text/xsd</String>
<String>text/xsl</String>
</String-array>
</field>
<field name="spellCheckInComments">
<Boolean>false</Boolean>
</field>
<field name="spellCheckInAttributeValues">
<Boolean>false</Boolean>
</field>
<field name="spellCheckInText">
<Boolean>true</Boolean>
</field>
<field name="spellCheckInCDATA">
<Boolean>true</Boolean>
</field>
<field name="language">
<String>en_US</String>
</field>
<field name="caseSensitive">
<Boolean>false</Boolean>
</field>
<field name="ignoreMixedCase">
<Boolean>false</Boolean>
</field>
<field name="ignoreAcronyms">
<Boolean>true</Boolean>
</field>
<field name="ignoreDigits">
<Boolean>true</Boolean>
</field>
<field name="ignoreDuplicates">
<Boolean>false</Boolean>
</field>
<field name="ignoreURL">
<Boolean>true</Boolean>
</field>
<field name="checkPunctuation">
<Boolean>false</Boolean>
</field>
<field name="allowCompound">
<Boolean>true</Boolean>
</field>
<field name="allowPrefixes">
<Boolean>false</Boolean>
</field>
<field name="allowFileExtensions">
<Boolean>true</Boolean>
</field>
<field name="obeyLangAttributes">
<Boolean>true</Boolean>
</field>
<field name="langAttrMissingUseDefault">
<Boolean>true</Boolean>
</field>
<field name="ignoreSpellCheckElements">
<String-array>
<String>codeblock</String>
<String>codeph</String>
<String>varname</String>
<String>shortcut</String>
<String>filepath</String>
<String>parmname</String>
<String>apiname</String>
<String>uicontrol</String>
<String>screen</String>
<String>cmdname</String>
<String>syntaxdiagram</String>
<String>keyword</String>
<String>tm</String>
<String>userinput</String>
<String>synph</String>
<String>option</String>
<String>msgblock</String>
</String-array>
</field>
<field name="preferredChecker">
<Integer>1</Integer>
</field>
</spellCheckOptions>
</entry>
Best,
Cristian

Re: Webapp localization

Posted: Thu Aug 18, 2016 2:41 pm
by Konstantin
Its does not works.
I tried change local:

Code: Select all


<field name="language">
<String>en_US</String>
</field>
and turn off automaticSpellCheck:

Code: Select all


<field name="automaticSpellCheck">
<Boolean>true</Boolean>
</field>
but nothing happened.

Probably its for Webapp 18.0.1 but I use 18.0.0.6 because I can update it from maven.

Re: Webapp localization

Posted: Mon Aug 22, 2016 11:13 am
by cristi_talau
Hello,

These settings only work starting from 18.0.1. Prior to that the browser spellchecker was used, so the language used to depend on the user browser. Now, we use a server-side spell-checker that is aware of the "xml:lang" attribute and whose default language can be configured using the settings I posted here.

Best,
Cristian

Re: Webapp localization

Posted: Mon Aug 22, 2016 11:46 am
by Konstantin
Ok Thanks.
I hope you soon upload webapp 18.0.1 to maven repository

Re: Webapp localization

Posted: Thu Dec 01, 2016 4:32 pm
by Konstantin
Hello
We updated webapp to 18.1.0

This config works but we need have spell checking fore some languages in one time.
Do you have opportunity to make this or maybe make switcher between languages in editor.

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<serialized version="14.0" xml:space="preserve">
<map>
<entry>
<String>first.run.v14.0</String>
<Boolean>false</Boolean>
</entry>
<entry>
<String>author.quick.up.down.navigation</String>
<Boolean>true</Boolean>
</entry>
<entry>
<String>validation.scenarios</String>
<validationScenario-array/>
</entry>
<entry>
<String>author.show.comments</String>
<Boolean>false</Boolean>
</entry>

<entry>
<String>spell.check.options</String>
<spellCheckOptions>
<field name="automaticSpellCheck">
<Boolean>true</Boolean>
</field>
<field name="automaticSpellCheckContentTypes">
<String-array>
<String>text/html</String>
<String>text/nvdl</String>
<String>text/plain</String>
<String>text/properties</String>
<String>text/rng</String>
<String>text/sch</String>
<String>text/wsdl</String>
<String>text/xml</String>
<String>text/xproc</String>
<String>text/xsd</String>
<String>text/xsl</String>
</String-array>
</field>
<field name="spellCheckInComments">
<Boolean>false</Boolean>
</field>
<field name="spellCheckInAttributeValues">
<Boolean>false</Boolean>
</field>
<field name="spellCheckInText">
<Boolean>true</Boolean>
</field>
<field name="spellCheckInCDATA">
<Boolean>true</Boolean>
</field>
<field name="language">
<String>en_US</String>
</field>
<field name="caseSensitive">
<Boolean>false</Boolean>
</field>
<field name="ignoreMixedCase">
<Boolean>false</Boolean>
</field>
<field name="ignoreAcronyms">
<Boolean>true</Boolean>
</field>
<field name="ignoreDigits">
<Boolean>true</Boolean>
</field>
<field name="ignoreDuplicates">
<Boolean>false</Boolean>
</field>
<field name="ignoreURL">
<Boolean>true</Boolean>
</field>
<field name="checkPunctuation">
<Boolean>false</Boolean>
</field>
<field name="allowCompound">
<Boolean>true</Boolean>
</field>
<field name="allowPrefixes">
<Boolean>false</Boolean>
</field>
<field name="allowFileExtensions">
<Boolean>true</Boolean>
</field>
<field name="obeyLangAttributes">
<Boolean>true</Boolean>
</field>
<field name="langAttrMissingUseDefault">
<Boolean>true</Boolean>
</field>
<field name="ignoreSpellCheckElements">
<String-array>
<String>codeblock</String>
<String>codeph</String>
<String>varname</String>
<String>shortcut</String>
<String>filepath</String>
<String>parmname</String>
<String>apiname</String>
<String>uicontrol</String>
<String>screen</String>
<String>cmdname</String>
<String>syntaxdiagram</String>
<String>keyword</String>
<String>tm</String>
<String>userinput</String>
<String>synph</String>
<String>option</String>
<String>msgblock</String>
</String-array>
</field>
<field name="preferredChecker">
<Integer>1</Integer>
</field>
</spellCheckOptions>
</entry>

</map>
</serialized>

Re: Webapp localization

Posted: Fri Dec 02, 2016 10:25 am
by cristi_talau
Hello,

Our spell-checker is aware of the xml:lang attribute. If you set that attribute to the correct language, the spellchecker will use that language.

Changing the language in the editor can be done by setting the xml:lang attribute on the root element.

I agree that this is not an ideal user-experience, but for a better solution we need to understand your use-case.
- Do you have just a couple of files with a different language?
- Do you have different projects that use different languages?
- Do you this language as a per-user option?

Best,
Cristian