Ignore:
Timestamp:
2009-03-24T14:49:19+01:00 (16 years ago)
Author:
stoecker
Message:

fixed language handling for web access

File:
1 edited

Legend:

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

    r1509 r1512  
    6767         */
    6868        protected byte[] updateData() {
    69             String motd = "";
    70             String baseurl = Main.pref.get("help.baseurl", "http://josm.openstreetmap.de");
    71             WikiReader wr = new WikiReader(baseurl);
    72             String vers = "";
    73             String languageCode = Main.getLanguageCodeU();
    74             try {
    75                 motd = wr.read(baseurl + "/wiki/"+languageCode+"StartupPage");
    76             } catch (IOException ioe) {
    77                 try {
    78                     motd = wr.read(baseurl + "/wiki/StartupPage");
    79                 } catch (IOException ioe2) {
    80                     motd = "<html>" + styles + "<body><h1>" +
    81                         "JOSM - " + tr("Java OpenStreetMap Editor") +
    82                         "</h1>\n<h2 align=\"center\">(" +
    83                         tr("Message of the day not available") +
    84                         ")</h2></html>";
    85                 }
     69            String motd = new WikiReader().readLang("StartupPage");
     70            if(motd.length() == 0)
     71            {
     72                motd = "<html>" + styles + "<body><h1>" +
     73                "JOSM - " + tr("Java OpenStreetMap Editor") +
     74                "</h1>\n<h2 align=\"center\">(" +
     75                tr("Message of the day not available") +
     76                ")</h2></html>";
    8677            }
    87             motd = motd.replace("<!-- VERSION -->", tr("- running version is {0}",
    88             AboutAction.getVersionString()));
     78            else
     79            {
     80                motd = motd.replace("<!-- VERSION -->", tr("- running version is {0}",
     81                AboutAction.getVersionString()));
     82            }
    8983            // Save this to prefs in case JOSM is updated so MOTD can be refreshed
    9084            Main.pref.putInteger("cache.motd.html.version", myVersion);
Note: See TracChangeset for help on using the changeset viewer.