@Test public void shouldntAddTranslationKeysForPluginIfLocalesAreEmpty() throws Exception { String pluginIdentifier = "plugin"; locales = mockStringSet(new HashSet<String>()); given(translationService.getLocales()).willReturn(localesMap); given(localesMap.keySet()).willReturn(locales); translationModuleOverrideUtil.addTranslationKeysForPlugin(pluginIdentifier, basenames); }
public void addTranslationKeysForPlugin(final String pluginIdentifier, final Set<String> basenames) { for (String locale : translationService.getLocales().keySet()) { Map<String, String> translations = Maps.newHashMap(); for (Resource resource : getPropertiesResources(basenames, locale)) { translations.putAll(getTranslationsFromProperties(resource)); } customTranslationManagementService.addCustomTranslations(pluginIdentifier, locale, translations); } }
TranslationModuleOverrideUtil { public void addTranslationKeysForPlugin(final String pluginIdentifier, final Set<String> basenames) { for (String locale : translationService.getLocales().keySet()) { Map<String, String> translations = Maps.newHashMap(); for (Resource resource : getPropertiesResources(basenames, locale)) { translations.putAll(getTranslationsFromProperties(resource)); } customTranslationManagementService.addCustomTranslations(pluginIdentifier, locale, translations); } } }
TranslationModuleOverrideUtil { public void addTranslationKeysForPlugin(final String pluginIdentifier, final Set<String> basenames) { for (String locale : translationService.getLocales().keySet()) { Map<String, String> translations = Maps.newHashMap(); for (Resource resource : getPropertiesResources(basenames, locale)) { translations.putAll(getTranslationsFromProperties(resource)); } customTranslationManagementService.addCustomTranslations(pluginIdentifier, locale, translations); } }  }
TranslationModuleOverrideUtil { public void addTranslationKeysForPlugin(final String pluginIdentifier, final Set<String> basenames) { for (String locale : translationService.getLocales().keySet()) { Map<String, String> translations = Maps.newHashMap(); for (Resource resource : getPropertiesResources(basenames, locale)) { translations.putAll(getTranslationsFromProperties(resource)); } customTranslationManagementService.addCustomTranslations(pluginIdentifier, locale, translations); } }  boolean shouldOverride(); void addTranslationKeysForPlugin(final String pluginIdentifier, final Set<String> basenames); void removeTranslationKeysForPlugin(final String pluginIdentifier); }
TranslationModuleOverrideUtil { public void addTranslationKeysForPlugin(final String pluginIdentifier, final Set<String> basenames) { for (String locale : translationService.getLocales().keySet()) { Map<String, String> translations = Maps.newHashMap(); for (Resource resource : getPropertiesResources(basenames, locale)) { translations.putAll(getTranslationsFromProperties(resource)); } customTranslationManagementService.addCustomTranslations(pluginIdentifier, locale, translations); } }  boolean shouldOverride(); void addTranslationKeysForPlugin(final String pluginIdentifier, final Set<String> basenames); void removeTranslationKeysForPlugin(final String pluginIdentifier);  }