I have an issue with automatic internationalization in java, using netbeans. In actionListener I am chaging locale with this:

String s = (String)langBox.getSelectedItem();
switch(s){
    case "Čeština":
        BP_evolution.language = "cs";
        BP_evolution.currentLocale = new Locale(BP_evolution.language);
        break;
    case "English":
        BP_evolution.language = "en";
        BP_evolution.currentLocale = new Locale(BP_evolution.language);
        break;
}


Actually, the issue is, that I don't know what function should I call for switching language in my application. I am using Java SE and Swing. Like I already said, ResourceBundle has been created automatically.


Question: PySpark reduceByKey? to add Key/Tuple
Answer: I'm much more familiar with Spark in Scala, so there may be better ways than Counter to count the characters in the iterable produced by groupByKey, but here's an option:

from collections import Counter

rdd = sc.parallelize([(13, 'D'), (14, 'T'), (32, '6'), (45, 'T'), (47, '2'), (48, '0'), (49, '2'), (50, '0'), (51, 'T'), (53, '2'), (54, '0'), (13, 'A'), (14, 'T'), (32, '6'), (45, 'A'), (47, '2'), (48, '0'), (49, '2'), (50, '0'), (51, 'X')]) 
rdd.groupByKey().mapValues(lambda x: Counter(x)).collect()

[(48, Counter({'0': 2})),
 (32, Counter({'6': 2})),
 (49, Counter({'2': 2})),
 (50, Counter({'0': 2})),
 (51, Counter({'X': 1, 'T': 1})),
 (53, Counter({'2': 1})),
 (13, Counter({'A': 1, 'D': 1})),
 (45, Counter({'A': 1, 'T': 1})),
 (14, Counter({'T': 2})),
 (54, Counter({'0': 1})),
 (47, Counter({'2': 2}))]