title: Language Change Locale in "Kotlin "Programming As locale works in Java Fine but in Kotlin language not working
body: <p>I am working on kotlin language in my application and facing some difficulties regarding Changing Locale. As what i have do i have created one global class i.e on java and on this class i have wrote code of Language change locale code and that language code function i am calling to base application class of my project that is in Kotlin.</p>
  
  <p>Here is my source code :</p>
  
  <p>Global class (Java Code)</p>
  
  <pre><code> public void changelanguage(Context context) {
      Locale locale = Locale.getDefault();
      Locale.setDefault(locale);
      System.out.println("GlobalLocale" +locale.toString());
      Configuration config = new Configuration();
      config.locale = locale;
      context.getResources().updateConfiguration(config,
              context.getResources().getDisplayMetrics());
  
  }  
  </code></pre>
  
  <p>Base Application Class Code:(Kotlin)</p>
  
  <pre><code>class CrashApplicationClass : Application() {
  
  val TAG = CrashApplicationClass::class.java.simpleName
  lateinit var sDefSystemLanguage: String
  val gc = GlobalClass.getInstance()
  
  override fun onCreate() {
      // TODO Auto-generated method stub
  
      // ACRA.init(this)
      super.onCreate()
  
      instance = this
  
      gc.changelanguage(baseContext)
      println("Languagekotlin" +  gc.changelanguage(baseContext))
      println("kotlininstance" + instance)
     // sDefSystemLanguage = Locale.getDefault().language
  }
  
  
  val requestQueue: RequestQueue? = null
      get() {
          if (field == null) {
              return Volley.newRequestQueue(applicationContext)
          }
          return field
      }
  
  fun &lt;T&gt; addToRequestQueue(request: Request&lt;T&gt;, tag: String) {
      request.tag = if (TextUtils.isEmpty(tag)) TAG else tag
      requestQueue?.add(request)
  }
  
  fun &lt;T&gt; addToRequestQueue(request: Request&lt;T&gt;) {
      request.tag = TAG
      requestQueue?.add(request)
  }
  
  fun cancelPendingRequests(tag: Any) {
      if (requestQueue != null) {
          requestQueue!!.cancelAll(tag)
      }
  }
  
  
  companion object {
       val TAG = CrashApplicationClass::class.java.simpleName
  
      @get:Synchronized var instance: CrashApplicationClass? = null
  
          private set
  }
  </code></pre>
  
  <p>}</p>
  
  <p>As whats going in code here , I have print logs in java class log the language properly gets : 
  System.out.println("GlobalLocale" +locale.toString());</p>
  
  <p>but on CrashApplication class log :
  println("Languagekotlin" +  gc.changelanguage(baseContext)) -> 
  i am getting "Kotlin.Unit"
  And also language not changed getting proper locale in java but don't know Kotlin class is not getting it returns "Kotlin.Unit"</p>
  
  <p>And also on Manifest i have set : android:configChanges="locale"
  Any one have idea about language change in Kotlin. Plz share.</p>