Ignore:
Timestamp:
2013-04-29T17:25:45+02:00 (13 years ago)
Author:
stoecker
Message:

use 3 step wiki loading fallback, cleanup handling of language fallbacks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java

    r5886 r5915  
    5050import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
    5151import org.openstreetmap.josm.tools.ImageProvider;
     52import org.openstreetmap.josm.tools.LanguageInfo.LocaleType;
    5253import org.openstreetmap.josm.tools.OpenBrowser;
    5354import org.openstreetmap.josm.tools.Utils;
     
    261262                relativeHelpTopic,
    262263                Locale.getDefault().getDisplayName(),
    263                 getHelpTopicEditUrl(buildAbsoluteHelpTopic(relativeHelpTopic)),
    264                 getHelpTopicEditUrl(buildAbsoluteHelpTopic(relativeHelpTopic, Locale.ENGLISH))
     264                getHelpTopicEditUrl(buildAbsoluteHelpTopic(relativeHelpTopic, LocaleType.DEFAULT)),
     265                getHelpTopicEditUrl(buildAbsoluteHelpTopic(relativeHelpTopic, LocaleType.ENGLISH))
    265266        );
    266267        loadTopic(message);
     
    294295     */
    295296    protected void loadRelativeHelpTopic(String relativeHelpTopic) {
    296         String url = HelpUtil.getHelpTopicUrl(HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic));
     297        String url = HelpUtil.getHelpTopicUrl(HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic, LocaleType.DEFAULTNOTENGLISH));
    297298        String content = null;
    298299        try {
    299300            content = reader.fetchHelpTopicContent(url, true);
    300301        } catch(MissingHelpContentException e) {
    301             url = HelpUtil.getHelpTopicUrl(HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic, Locale.ENGLISH));
     302            url = HelpUtil.getHelpTopicUrl(HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic, LocaleType.BASELANGUAGE));
    302303            try {
    303304                content = reader.fetchHelpTopicContent(url, true);
    304305            } catch(MissingHelpContentException e1) {
    305                 this.url = url;
    306                 handleMissingHelpContent(relativeHelpTopic);
    307                 return;
     306                url = HelpUtil.getHelpTopicUrl(HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic, LocaleType.ENGLISH));
     307                try {
     308                    content = reader.fetchHelpTopicContent(url, true);
     309                } catch(MissingHelpContentException e2) {
     310                    this.url = url;
     311                    handleMissingHelpContent(relativeHelpTopic);
     312                    return;
     313                } catch(HelpContentReaderException e2) {
     314                    e2.printStackTrace();
     315                    handleHelpContentReaderException(relativeHelpTopic, e2);
     316                    return;
     317                }
    308318            } catch(HelpContentReaderException e1) {
    309319                e1.printStackTrace();
    310                 handleHelpContentReaderException(relativeHelpTopic,e1);
     320                handleHelpContentReaderException(relativeHelpTopic, e1);
    311321                return;
    312322            }
Note: See TracChangeset for help on using the changeset viewer.