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 |
|
|
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 |
/** |
/** |
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 |
/** |
/** |
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 |
|
|
258 |
} |
} |
259 |
} |
} |
260 |
|
|
|
|
|
261 |
} |
} |