1 18 19 package org.apache.jmeter.gui.action; 20 import java.awt.Component ; 21 import java.awt.event.ActionEvent ; 22 import java.util.HashSet ; 23 import java.util.Locale ; 24 import java.util.Set ; 25 26 import org.apache.jmeter.util.JMeterUtils; 27 import org.apache.jorphan.logging.LoggingManager; 28 import org.apache.log.Logger; 29 30 33 public class ChangeLanguage implements Command 34 { 35 private static final Set commands = new HashSet (); 36 public final static String CHANGE_LANGUAGE = "change_language"; 37 private Logger log = LoggingManager.getLoggerForClass(); 38 39 static 40 { 41 commands.add(CHANGE_LANGUAGE); 42 } 43 44 47 public void doAction(ActionEvent e) 48 { 49 Locale loc = new Locale (((Component ) e.getSource()).getName(), ""); 50 log.debug("Changing language to " + loc.getLanguage()); 51 JMeterUtils.setLocale(loc); 52 } 53 54 57 public Set getActionNames() 58 { 59 return commands; 60 } 61 } 62 | Popular Tags |