New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow loading language-* module as plugins in application #9447
base: master
Are you sure you want to change the base?
feat: allow loading language-* module as plugins in application #9447
Conversation
There are many language modules LanguageTool project provided. It is benefitical that langaugetool allow language-* module to be loaded dynimically before calling languagetool core functions. Currently language list is built in static context. This is proposal that the creation of languages list is happended when requested. This allows application to load language-* modules after its launch. Signed-off-by: Hiroshi Miura <miurahr@linux.com>
An enhancement is requested in application, OmegaT project https://sourceforge.net/p/omegat/feature-requests/1714/ |
…nguage-modules Signed-off-by: Hiroshi Miura <miurahr@linux.com>
bcb07d0
to
d94b567
Compare
@@ -283,7 +285,7 @@ public static Language getLanguageForLocale(Locale locale) { | |||
return firstFallbackLanguage; | |||
} | |||
} | |||
for (Language aLanguage : languages) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why getLanguageForLocale(Locale locale)
exclude dynamic language module?
@@ -42,11 +42,8 @@ public final class Languages { | |||
private static final String PROPERTIES_KEY = "languageClasses"; | |||
private static final Language NOOP_LANGUAGE = new NoopLanguage(); | |||
|
|||
private static final List<Language> languages = getAllLanguages(); | |||
private static final List<Language> dynLanguages = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dynLanguages
updated but never read.
There are many language modules LanguageTool project provided. It is benefitical that langaugetool allow language-* module to be loaded dynimically before calling languagetool core functions.
Currently language list is built in static initialization context.
This is a proposal that the creation of languages list is happened when requested. This allows applications to load language-* modules after a launch of the application, aka. classLoader load them after static initialization.