title: Android. Espresso. How to check that text is shown in a specific language without hard code strings?
body: <p>I need to check my fragment when I change the app language.
  Here is my Android Espresso test:</p>
  
  <pre><code> @Test
      public void changeLanguages() {
          Resources resources = context.getResources();
          String[] appLanguages = resources.getStringArray(R.array.app_lang_codes);
          for (int index = 0; index &lt; appLanguages.length; index++) {
              String currentLang = appLanguages[index];
              Locale currentLocale = new Locale(currentLang);
              if (currentLocale.equals(AppLanguageService.getLocaleRO(context))) {
                  // click Romanian
                  onView(withId(R.id.containerLanguageRO)).perform(click());
  
                  onView(withId(R.id.textViewSelectLanguage)).check(matches(withText("Selecți limba")));
              } else if (currentLocale.equals(AppLanguageService.getLocaleEN(context))) {
                  // click English
                  onView(withId(R.id.containerLanguageEN)).perform(click());
  
                  onView(withId(R.id.textViewSelectLanguage)).check(matches(withText("Select language")));
              } 
          }
      }
  </code></pre>
  
  <p>Ant it's working fine. OK!</p>
  
  <p>But as you can see I need to hard code the string for a specific language for the test.
  "<strong>Selecți limba</strong>" and "<strong>Select language</strong>". And I think it's not good. </p>
  
  <p>Is it possible to not use hard code strings to check that text is shown in a specific language?</p>