title: How to set Russian Language over Locale in android? Android App Localization
body: <p>My app supports 3 languages (English, German, Russian). I use for language settings a LocaleHelper class and set language as follows:</p>
  
  <pre><code>lateinit var alert: AlertDialog
                  val options = arrayOf(
                      resources.getString(R.string.en_lang),
                      resources.getString(R.string.de_lang),
                      resources.getString(R.string.ru_lang))
                  val dialogBuilder = AlertDialog.Builder(this, R.style.AboutAlertDialogStyle)
                  dialogBuilder.setTitle(resources.getString(R.string.app_language))
                      .setSingleChoiceItems(options, position) { _, which -&gt;
                          when {
                              options[which] == resources.getString(R.string.en_lang) -&gt; {
                                  LocaleHelper.setLocale(baseContext, "en").resources
                                  alert.dismiss()
                                  recreate()
                              }
                              options[which] == resources.getString(R.string.de_lang) -&gt; {
                                  LocaleHelper.setLocale(baseContext, "de").resources
                                  alert.dismiss()
                                  recreate()
                              }
                              else -&gt; {
                                  LocaleHelper.setLocale(baseContext, "ru").resources
                                  alert.dismiss()
                                  recreate()
                              }
                          }
                      }
                      .setNegativeButton(resources.getString(R.string.cancel)) { dialog, _ -&gt;
                          dialog.cancel()
                      }
                  alert = dialogBuilder.create()
                  alert.show()
  </code></pre>
  
  <p>Everything works fine for English and German. But doesn't for Russian one.
  I also changed the input for Locale in the LocaleHelper class according to the first answer of this <a href="https://stackoverflow.com/questions/10931238/localization-for-russian-in-android">post</a> as follows:</p>
  
  <pre><code>public static Context setLocale(Context context, String language) {
          persist(context, language);
          Configuration configuration;
          Resources resources;
          Locale locale = null;
  
          if (language.equals("ru")) {
              locale = new Locale(language, "RU");
              Locale.setDefault(locale);
          }
  
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.N) {
              configuration = context.getResources().getConfiguration();
              configuration.setLocale(locale);
              configuration.setLayoutDirection(locale);
              return context.createConfigurationContext(configuration);
          }
  
          locale = new Locale(language);
          Locale.setDefault(locale);
          resources = context.getResources();
          configuration = resources.getConfiguration();
          configuration.locale = locale;
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.JELLY_BEAN_MR1)
              configuration.setLayoutDirection(locale);
          resources.updateConfiguration(configuration, resources.getDisplayMetrics());
          return context;
      }
  </code></pre>
  
  <p>How can I get it run for Russian language. When the user selects it, the app changes the language to English instead.</p>
  
  <p>Many thanks in advance!</p>