#3693 closed defect (fixed)
Preferences dialog take very long to show up
Reported by: | bilbo | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | latest |
Keywords: | Cc: |
Description
Preferences dialog needs several seconds to show. I investigated the issue and I've found one of the causes: every invocation of the dialog, JOSM tries to find installed locales. However it does this by calling org.openstreetmap.josm.tools.I18n.getAvailableTranslations(), which in turn enumerates all locales installed on system, then checking for each if that translation is present in the .jar. This have two disadvantages:
- Some translation can be omitted, if that locale is not installed on system
- On systems, where there are many installed locales, this search takes quite a long time (for most locales on my system there is no corresponding JOSM translation)
Since locales are embedded in the .jar, this can be solved by creating list of available locales, perhaps with some extra information (name of the language) added at compile time, so this function will just quickly return pre-made list.
Attachments (0)
Change History (4)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 15 years ago
You broke code ATM:
LanguagePreference.java:123:
getAvailableTranslations() in org.openstreetmap.josm.tools.I18n cannot be applied to (org.openstreetmap.josm.gui.progress.ProgressMonitor)
Arrays.asList(I18n.getAvailableTranslations(getProgressMonitor()))
Ticket #3981 has been marked as a duplicate of this ticket.