@Test public void testGetPageTypeLabel() { Locale.setDefault(Locale.ENGLISH); assertEquals("Normal Page", NdkAudioPageMapper.getPageTypeLabel("normalPage", Locale.getDefault())); assertEquals("NormalPage", NdkAudioPageMapper.getPageTypeLabel("", Locale.getDefault())); Locale.setDefault(new Locale("cs", "CZ")); assertEquals("Normální strana", NdkAudioPageMapper.getPageTypeLabel("normalPage", Locale.getDefault())); assertEquals("NormalPage", NdkAudioPageMapper.getPageTypeLabel("", Locale.getDefault())); }
public static String getPageTypeLabel(String pageType, Locale locale) { if (pageType == null || pageType.isEmpty()) { return NdkPageMapper.PAGE_TYPE_NORMAL; } try { return getPageTypeLabels(locale).getString(pageType); } catch (MissingResourceException ex) { LOG.warning("Missing page type resource for " + pageType + " locale " + locale); return NdkPageMapper.PAGE_TYPE_NORMAL; } }
NdkAudioPageMapper extends NdkPageMapper { public static String getPageTypeLabel(String pageType, Locale locale) { if (pageType == null || pageType.isEmpty()) { return NdkPageMapper.PAGE_TYPE_NORMAL; } try { return getPageTypeLabels(locale).getString(pageType); } catch (MissingResourceException ex) { LOG.warning("Missing page type resource for " + pageType + " locale " + locale); return NdkPageMapper.PAGE_TYPE_NORMAL; } } }
NdkAudioPageMapper extends NdkPageMapper { public static String getPageTypeLabel(String pageType, Locale locale) { if (pageType == null || pageType.isEmpty()) { return NdkPageMapper.PAGE_TYPE_NORMAL; } try { return getPageTypeLabels(locale).getString(pageType); } catch (MissingResourceException ex) { LOG.warning("Missing page type resource for " + pageType + " locale " + locale); return NdkPageMapper.PAGE_TYPE_NORMAL; } }  }
NdkAudioPageMapper extends NdkPageMapper { public static String getPageTypeLabel(String pageType, Locale locale) { if (pageType == null || pageType.isEmpty()) { return NdkPageMapper.PAGE_TYPE_NORMAL; } try { return getPageTypeLabels(locale).getString(pageType); } catch (MissingResourceException ex) { LOG.warning("Missing page type resource for " + pageType + " locale " + locale); return NdkPageMapper.PAGE_TYPE_NORMAL; } }  static ResourceBundle getPageTypeLabels(Locale locale); static String getPageTypeLabel(String pageType, Locale locale); @Override void createMods(ModsDefinition mods, Context ctx); }
NdkAudioPageMapper extends NdkPageMapper { public static String getPageTypeLabel(String pageType, Locale locale) { if (pageType == null || pageType.isEmpty()) { return NdkPageMapper.PAGE_TYPE_NORMAL; } try { return getPageTypeLabels(locale).getString(pageType); } catch (MissingResourceException ex) { LOG.warning("Missing page type resource for " + pageType + " locale " + locale); return NdkPageMapper.PAGE_TYPE_NORMAL; } }  static ResourceBundle getPageTypeLabels(Locale locale); static String getPageTypeLabel(String pageType, Locale locale); @Override void createMods(ModsDefinition mods, Context ctx);  }