/[schmitzm]/trunk/src/skrueger/i8n/Translation.java
ViewVC logotype

Diff of /trunk/src/skrueger/i8n/Translation.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 44 by alfonx, Tue Apr 14 20:23:41 2009 UTC revision 185 by alfonx, Fri Jul 3 14:36:08 2009 UTC
# Line 8  import java.util.List; Line 8  import java.util.List;
8  import java.util.Locale;  import java.util.Locale;
9    
10  import javax.swing.JComponent;  import javax.swing.JComponent;
11    import javax.swing.JTable;
12    
13  import org.apache.log4j.Logger;  import org.apache.log4j.Logger;
14    
# Line 89  public class Translation extends HashMap Line 90  public class Translation extends HashMap
90          }          }
91    
92          /**          /**
93           * Initializes a new {@link Translation} with a default translation. Other           * Initializes a new {@link Translation} with a default translation if a
94           * translations may be added later.           * simple text is passed. If a "oneLine" text is parsed, it is
95             * interpreted. Other translations may be added later - this is a HashMap<br/>
96           *           *
97           * @param defaultTranslation           * @param defaultTranslation
98           *           *
          * @deprecated SK: The concept of the default translation doesn't seem so  
          *             nice to me anymore.. I would prefer the default translation  
          *             to be set for all valid languages.  
          *  
99           * @see public Translation(List<String> languages, String           * @see public Translation(List<String> languages, String
100           *      defaultTranslation) {           *      defaultTranslation) {
101           *           *
102           */           */
103          public Translation(String defaultTranslation) {          public Translation(String defaultTranslation) {
104                  put(DEFAULT_KEY, defaultTranslation);  
105                    fromOneLine(defaultTranslation);
106    
107          }          }
108    
109          /**          /**
# Line 174  public class Translation extends HashMap Line 174  public class Translation extends HashMap
174           * @author Stefan Alfons Krüger           * @author Stefan Alfons Krüger
175           */           */
176          public String toOneLine() {          public String toOneLine() {
177                  StringBuffer oneLine = new StringBuffer();                  return I8NUtil.toOneLine(this);
                 for (String key : keySet()) {  
                         oneLine.append(key + "{" + get(key) + "}");  
                 }  
                 return oneLine.toString();  
178          }          }
179    
180          /**          /**
# Line 206  public class Translation extends HashMap Line 202  public class Translation extends HashMap
202                  // MS:                  // MS:
203                  else {                  else {
204                          if (get(DEFAULT_KEY) != null) {                          if (get(DEFAULT_KEY) != null) {
205                                  // log.debug("default lng returned, cuz the translation to "+activeLang+" was not found. Schmeiss raus martin, wenn du das mit der default trans geklärt hast.");                                  // log.debug("default lang returned, cuz the translation to "+activeLang+" was not found. Schmeiss raus martin, wenn du das mit der default trans geklärt hast.");
206                                  return get(DEFAULT_KEY);                                  return get(DEFAULT_KEY);
207                          }                          }
208    
# Line 262  public class Translation extends HashMap Line 258  public class Translation extends HashMap
258                  }                  }
259          }          }
260    
   
261  }  }

Legend:
Removed from v.44  
changed lines
  Added in v.185

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26