@Test public void testGetLanguageVariant() { assertEquals("test_en", LanguageUtils.getLanguageVariant("test", english)); assertEquals("test_en.jsp", LanguageUtils.getLanguageVariant("test.jsp", english)); assertEquals("/a/test_en.jsp", LanguageUtils.getLanguageVariant("/a/test.jsp", english)); }
public static String getLanguageVariant(String s, Language language) { int suffixPosition = s.lastIndexOf("."); String suffix = ""; if (suffixPosition > -1) { suffix = s.substring(suffixPosition); s = s.substring(0, suffixPosition); } s += "_" + language.getIdentifier() + suffix; return s; }
LanguageUtils { public static String getLanguageVariant(String s, Language language) { int suffixPosition = s.lastIndexOf("."); String suffix = ""; if (suffixPosition > -1) { suffix = s.substring(suffixPosition); s = s.substring(0, suffixPosition); } s += "_" + language.getIdentifier() + suffix; return s; } }
LanguageUtils { public static String getLanguageVariant(String s, Language language) { int suffixPosition = s.lastIndexOf("."); String suffix = ""; if (suffixPosition > -1) { suffix = s.substring(suffixPosition); s = s.substring(0, suffixPosition); } s += "_" + language.getIdentifier() + suffix; return s; } private  LanguageUtils(); }
LanguageUtils { public static String getLanguageVariant(String s, Language language) { int suffixPosition = s.lastIndexOf("."); String suffix = ""; if (suffixPosition > -1) { suffix = s.substring(suffixPosition); s = s.substring(0, suffixPosition); } s += "_" + language.getIdentifier() + suffix; return s; } private  LanguageUtils(); static Language getLanguage(Locale locale); static Language getLanguage(String languageCode); static LocalizableContent<String> addDescriptions(Node configuration,
      String tagName, Language defaultLanguage, LocalizableContent<String> o,
      boolean escape); static LocalizableContent<String> addDescriptions(Node configuration,
      String tagName, Language defaultLanguage, LocalizableContent<String> o,
      boolean escape, XPath xpath); static String getLanguageVariant(String s, Language language); static String[] getLanguageVariants(String s, Language... languages); static String getBaseVersion(String s); static Language extractLanguage(String s); static Language getPreferredLanguage(Set<Language> choices,
      HttpServletRequest request); static Language getPreferredLanguage(Localizable localizable,
      HttpServletRequest request, Site site); static Language getPreferredContentLanguage(Resource<?> resource,
      HttpServletRequest request, Site site); static Language getPreferredLanguage(HttpServletRequest request,
      Site site); static Language getPreferredLanguage(Localizable localizable,
      Language... languages); static Language getPreferredContentLanguage(Resource<?> resource,
      Language... languages); }
LanguageUtils { public static String getLanguageVariant(String s, Language language) { int suffixPosition = s.lastIndexOf("."); String suffix = ""; if (suffixPosition > -1) { suffix = s.substring(suffixPosition); s = s.substring(0, suffixPosition); } s += "_" + language.getIdentifier() + suffix; return s; } private  LanguageUtils(); static Language getLanguage(Locale locale); static Language getLanguage(String languageCode); static LocalizableContent<String> addDescriptions(Node configuration,
      String tagName, Language defaultLanguage, LocalizableContent<String> o,
      boolean escape); static LocalizableContent<String> addDescriptions(Node configuration,
      String tagName, Language defaultLanguage, LocalizableContent<String> o,
      boolean escape, XPath xpath); static String getLanguageVariant(String s, Language language); static String[] getLanguageVariants(String s, Language... languages); static String getBaseVersion(String s); static Language extractLanguage(String s); static Language getPreferredLanguage(Set<Language> choices,
      HttpServletRequest request); static Language getPreferredLanguage(Localizable localizable,
      HttpServletRequest request, Site site); static Language getPreferredContentLanguage(Resource<?> resource,
      HttpServletRequest request, Site site); static Language getPreferredLanguage(HttpServletRequest request,
      Site site); static Language getPreferredLanguage(Localizable localizable,
      Language... languages); static Language getPreferredContentLanguage(Resource<?> resource,
      Language... languages);  }