Changeset 1163 in josm for trunk/src


Ignore:
Timestamp:
2008-12-22T23:20:11+01:00 (11 years ago)
Author:
stoecker
Message:

cleanup language code handling

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

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

    r1146 r1163  
    1919import java.util.LinkedList;
    2020import java.util.List;
     21import java.util.Locale;
    2122import java.util.Map;
    2223import java.util.SortedMap;
     
    523524    }
    524525
     526    static public String getLanguageCodeU()
     527    {
     528        String languageCode = Locale.getDefault().getLanguage();
     529        return languageCode.substring(0,1).toUpperCase() + languageCode.substring(1) + ":";
     530    }
     531    static public String getLanguageCode()
     532    {
     533        return Locale.getDefault().getLanguage() + ":";
     534    }
    525535}
  • trunk/src/org/openstreetmap/josm/actions/HelpAction.java

    r962 r1163  
    4646    }
    4747
    48         private String languageCode = tr("En:");
     48        private String languageCode = Main.getLanguageCodeU();
    4949        private JFrame helpBrowser = new JFrame(tr("JOSM Online Help"));
    5050        private String baseurl = Main.pref.get("help.baseurl", "http://josm.openstreetmap.de");
  • trunk/src/org/openstreetmap/josm/gui/GettingStarted.java

    r1138 r1163  
    6868            Matcher matcher = versionPattern.matcher(motdcontent);
    6969            matcher.reset();
     70            String languageCode = Main.getLanguageCodeU();
    7071            while (matcher.find()) {
    7172                int targetVersion = Integer.parseInt(matcher.group(4));
     
    9495                start = matcher.end();
    9596                if (included) {
    96                     // translators: set this to a suitable language code to
    97                     // be able to provide translations in the Wiki.
    98                     String languageCode = tr("En:");
    9997                    String url = matcher.group(1) + languageCode + matcher.group(2);
    10098                    try {
  • trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java

    r824 r1163  
    11// License: GPL. Copyright 2007 by Immanuel Scholz and others
    22package org.openstreetmap.josm.tools;
    3 
    4 import static org.openstreetmap.josm.tools.I18n.tr;
    53
    64import java.io.Reader;
     
    2321import org.xml.sax.helpers.DefaultHandler;
    2422
     23import org.openstreetmap.josm.Main;
     24
    2525/**
    2626 * An helper class that reads from a XML stream into specific objects.
     
    3030public class XmlObjectParser implements Iterable<Object> {
    3131
    32         public static final String lang = tr("En:").toLowerCase();
     32        public static final String lang = Main.getLanguageCode();
    3333        public static class Uniform<T> implements Iterable<T>{
    3434                private Iterator<Object> iterator;
Note: See TracChangeset for help on using the changeset viewer.