6,12 → 6,59 |
*/ |
package src.internationalization; |
|
|
import java.util.Locale; |
import java.text.DateFormat; |
import java.util.ResourceBundle; |
|
|
/** |
* @author swalkenh |
* |
* To change the template for this generated type comment go to |
* Window>Preferences>Java>Code Generation>Code and Comments |
* |
* status: first try |
*/ |
public class Internationalization { |
|
public static void main(String[] args) { |
Internationalization i = new Internationalization(); |
} |
|
|
public Internationalization() { |
localizeNew(); |
} |
|
|
public ResourceBundle localizeNew() { |
Locale loc = new Locale("en", ""); |
ResourceBundle texts = ResourceBundle.getBundle("src.internationalization.Texts", loc); |
|
//Testausgabe |
System.out.println(texts.getString("thisProperties")); |
|
return texts; |
} |
|
|
public ResourceBundle localize(String language) { |
Locale loc = new Locale(language, ""); |
ResourceBundle texts = ResourceBundle.getBundle("src.internationalization.Texts", loc); |
|
//Testausgabe |
System.out.println(texts.getString("thisProperties")); |
|
return texts; |
} |
|
|
public void available() { |
Locale list[] = DateFormat.getAvailableLocales(); |
for (int i = 0; i < list.length; i++) { |
System.out.println(list[i].toString() + ": " + list[i].getDisplayName()); |
} |
} |
|
} |