Changeset 29328 in osm for applications


Ignore:
Timestamp:
2013-03-03T14:05:45+01:00 (11 years ago)
Author:
simon04
Message:

JOSM/wikipedia: update dialog title when changing language (correctly handle the context)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaToggleDialog.java

    r29327 r29328  
    5252        updateTitle();
    5353    }
     54    /** A string describing the context (use-case) for determining the dialog title */
     55    String titleContext = null;
    5456    final StringProperty wikipediaLang = new StringProperty("wikipedia.lang", LanguageInfo.getJOSMLocaleCode().substring(0, 2));
    5557    final Set<String> articles = new HashSet<String>();
     
    108110
    109111    private void updateTitle() {
    110         setTitle(/* I18n: [language].Wikipedia.org: coordinates */ tr("{0}.Wikipedia.org: coordinates", wikipediaLang.get()));
     112        if (titleContext == null) {
     113            setTitle(/* I18n: [language].Wikipedia.org */ tr("{0}.Wikipedia.org", wikipediaLang.get()));
     114        } else {
     115            setTitle(/* I18n: [language].Wikipedia.org: [context] */ tr("{0}.Wikipedia.org: {1}", wikipediaLang.get(), titleContext));
     116        }
    111117    }
    112118
     
    128134                // add entries to list model
    129135                setWikipediaEntries(entries);
     136                titleContext = tr("coordinates");
    130137                updateTitle();
    131138            } catch (Exception ex) {
     
    153160                    wikipediaLang.get(), category, Main.pref.getInteger("wikipedia.depth", 3));
    154161            setWikipediaEntries(entries);
    155             setTitle(/* I18n: [language].Wikipedia.org: [category] */ tr("{0}.Wikipedia.org: {1}", wikipediaLang.get(), category));
     162            titleContext = category;
     163            updateTitle();
    156164        }
    157165    }
Note: See TracChangeset for help on using the changeset viewer.