forked from I2P_Developers/i2p.i2p
NDT: Fix locale, spoof OS, fix log init
This commit is contained in:
@ -208,7 +208,7 @@ public class NDTConstants {
|
|||||||
* */
|
* */
|
||||||
public static void initConstants(String paramStrLang, String paramStrCountry) {
|
public static void initConstants(String paramStrLang, String paramStrCountry) {
|
||||||
try {
|
try {
|
||||||
Locale locale = new Locale(paramStrLang, paramStrCountry);
|
Locale locale = new Locale(paramStrLang);
|
||||||
_rscBundleMessages = ResourceBundle.getBundle(TCPBW100_MSGS,
|
_rscBundleMessages = ResourceBundle.getBundle(TCPBW100_MSGS,
|
||||||
locale);
|
locale);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -117,6 +117,7 @@ import javax.swing.SpinnerNumberModel;
|
|||||||
*/
|
*/
|
||||||
import com.vuze.plugins.mlab.tools.ndt.swingemu.*;
|
import com.vuze.plugins.mlab.tools.ndt.swingemu.*;
|
||||||
|
|
||||||
|
import net.i2p.I2PAppContext;
|
||||||
import net.i2p.util.Addresses;
|
import net.i2p.util.Addresses;
|
||||||
import net.i2p.util.Log;
|
import net.i2p.util.Log;
|
||||||
|
|
||||||
@ -294,7 +295,7 @@ public class Tcpbw100 extends JApplet implements ActionListener {
|
|||||||
|
|
||||||
// I2P
|
// I2P
|
||||||
private String _displayStatus = "";
|
private String _displayStatus = "";
|
||||||
private final Log _log = new Log(Tcpbw100.class);
|
private final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(Tcpbw100.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* public static void main for invoking as an Application
|
* public static void main for invoking as an Application
|
||||||
@ -806,7 +807,13 @@ public class Tcpbw100 extends JApplet implements ActionListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
_localeObj = new Locale(_sLang, _sCountry);
|
String lang = I2PAppContext.getGlobalContext().getProperty("routerconsole.lang");
|
||||||
|
if (lang != null) {
|
||||||
|
_localeObj = new Locale(lang);
|
||||||
|
_sLang = lang;
|
||||||
|
} else {
|
||||||
|
_localeObj = Locale.getDefault();
|
||||||
|
}
|
||||||
_resBundDisplayMsgs = ResourceBundle.getBundle(NDTConstants.TCPBW100_MSGS,
|
_resBundDisplayMsgs = ResourceBundle.getBundle(NDTConstants.TCPBW100_MSGS,
|
||||||
_localeObj);
|
_localeObj);
|
||||||
|
|
||||||
@ -2402,14 +2409,14 @@ public class Tcpbw100 extends JApplet implements ActionListener {
|
|||||||
// characters respectively
|
// characters respectively
|
||||||
_log.warn("USERAGENT " + getUserAgent());
|
_log.warn("USERAGENT " + getUserAgent());
|
||||||
paramProtoObj.send_json_msg(MessageType.TEST_MSG,
|
paramProtoObj.send_json_msg(MessageType.TEST_MSG,
|
||||||
(NDTConstants.META_CLIENT_OS + ":" + System
|
(NDTConstants.META_CLIENT_OS + ":" + /* System
|
||||||
.getProperty("os.name")).getBytes());
|
.getProperty("os.name") */ "Linux").getBytes());
|
||||||
paramProtoObj.send_json_msg(MessageType.TEST_MSG,
|
paramProtoObj.send_json_msg(MessageType.TEST_MSG,
|
||||||
(NDTConstants.META_BROWSER_OS + ":" + UserAgentTools
|
(NDTConstants.META_BROWSER_OS + ":" + UserAgentTools
|
||||||
.getBrowser(getUserAgent())[2]).getBytes());
|
.getBrowser(getUserAgent())[2]).getBytes());
|
||||||
paramProtoObj.send_json_msg(MessageType.TEST_MSG,
|
paramProtoObj.send_json_msg(MessageType.TEST_MSG,
|
||||||
(NDTConstants.META_CLIENT_KERNEL_VERSION + ":" + System
|
(NDTConstants.META_CLIENT_KERNEL_VERSION + ":" + /* System
|
||||||
.getProperty("os.version")).getBytes());
|
.getProperty("os.version") */ "4.15.0-38-generic").getBytes());
|
||||||
paramProtoObj.send_json_msg(MessageType.TEST_MSG,
|
paramProtoObj.send_json_msg(MessageType.TEST_MSG,
|
||||||
(NDTConstants.META_CLIENT_VERSION + ":" + NDTConstants.VERSION).getBytes());
|
(NDTConstants.META_CLIENT_VERSION + ":" + NDTConstants.VERSION).getBytes());
|
||||||
paramProtoObj.send_json_msg(MessageType.TEST_MSG,
|
paramProtoObj.send_json_msg(MessageType.TEST_MSG,
|
||||||
|
Reference in New Issue
Block a user