android: Set preferred language for remediation instructions
authorTobias Brunner <tobias@strongswan.org>
Fri, 12 Jun 2015 12:14:46 +0000 (14:14 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 28 Jul 2015 11:27:32 +0000 (13:27 +0200)
src/frontends/android/jni/libandroidbridge/charonservice.c
src/frontends/android/src/org/strongswan/android/logic/CharonVpnService.java

index 98287ce..5b4d649 100644 (file)
@@ -406,6 +406,10 @@ static void initiate(settings_t *settings)
 {
        private_charonservice_t *this = (private_charonservice_t*)charonservice;
 
+       lib->settings->set_str(lib->settings,
+                                               "charon.plugins.tnc-imc.preferred_language",
+                                               settings->get_str(settings, "global.language", "en"));
+
        this->creds->clear(this->creds);
        DESTROY_IF(this->service);
        this->service = android_service_create(this->creds, settings);
index a1e8ffc..a79d9f8 100644 (file)
@@ -23,6 +23,7 @@ import java.security.cert.CertificateEncodingException;
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Locale;
 
 import org.strongswan.android.data.VpnProfile;
 import org.strongswan.android.data.VpnProfileDataSource;
@@ -217,6 +218,7 @@ public class CharonVpnService extends VpnService implements Runnable
                                                {
                                                        Log.i(TAG, "charon started");
                                                        SettingsWriter writer = new SettingsWriter();
+                                                       writer.setValue("global.language", Locale.getDefault().getLanguage());
                                                        writer.setValue("connection.type", mCurrentProfile.getVpnType().getIdentifier());
                                                        writer.setValue("connection.server", mCurrentProfile.getGateway());
                                                        writer.setValue("connection.username", mCurrentProfile.getUsername());