I am using the maven dependency for LanguageTool in my pom.xml with the artifactId of language-all.
I have upgraded from LanguageTool 4.8 from 4.9.
I am now getting the following error in my app: No appropriate language found, not even en-US. Supported languages: [Arabic, Arabic (Algeria)]
Before, in v4.8, LanguageTool handled all the other languages.
Not sure it is related, but I noticed that the language-module.properties file has only got the following: languageClasses=org.languagetool.language.Arabic,org.languagetool.language.AlgerianArabic
Having said that in v4.8 it only seemed to contain the English languages but it still worked for all of the other languages: languageClasses=org.languagetool.language.English,org.languagetool.language.AmericanEnglish,org.languagetool.language.BritishEnglish,org.languagetool.language.AustralianEnglish,org.languagetool.language.CanadianEnglish,org.languagetool.language.NewZealandEnglish,org.languagetool.language.SouthAfricanEnglish
Hi, I don’t know of any change related to this in 4.9. There should be several language-module.properties files, each containing the class references for its language. Where exactly did you find the language-module.properties file that only contains Arabic?
The code in LT is this: Enumeration<URL> propertyFiles = Language.class.getClassLoader().getResources(PROPERTIES_PATH);. So we look for all files named language-module.properties and consider them. If there’s only one, and that one has only Arabic, LT won’t work for English. I’m not sure why it used to work before. Are you sure there’s no exception thrown anywhere that you might miss?
Given Arabic's alphabetic position, it’s possible that somewhere along the line an array variable has been miscast into a singular variable. (instead of getting the array of module.properties files, you get only the first entry of the array … only question is, where does it happen?)
We use the maven shade plugin which packages our app in an “uber jar”.
I think there may be an issue where we are messing up the module.properties file when we are packaging our app.
I will investigate and update this thread when I have discovered more info.