@Override public void emailSuccessMessage(Context context, EPerson eperson, String fileName) throws MessagingException { try { Locale supportedLocale = I18nUtil.getEPersonLocale(eperson); Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "bte_batch_import_success")); email.addRecipient(eperson.getEmail()); email.addArgument(fileName); email.send(); } catch (Exception e) { log.warn(LogManager.getHeader(context, "emailSuccessMessage", "cannot notify user of import"), e); } }
/** * Get the i18N string. * * @param key to get the message. * @return the message found. */ protected String msg(String key) { return I18nUtil.getMessage("org.dspace.checker.ResultsLogger." + key); }
/** * Get the Locale for a specified EPerson. If the language is missing, * return the default Locale for the repository. * * @param ep Eperson * @return Locale */ public static Locale getEPersonLocale(EPerson ep) { if (ep == null) { log.error("No EPerson specified, returning default locale"); return I18nUtil.getDefaultLocale(); } String lang = ep.getLanguage(); if (StringUtils.isBlank(lang)) { log.error("No language specified for EPerson " + ep.getID()); return I18nUtil.getDefaultLocale(); } return I18nUtil.getSupportedLocale(new Locale(lang)); }
Locale supportedLocale = I18nUtil.getEPersonLocale(ep); Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "submit_archive")); String title = ""; try { title = I18nUtil.getMessage("org.dspace.workflow.WorkflowManager.untitled"); } catch (MissingResourceException e) { title = "Untitled";
.getEmail(I18nUtil.getEmailFilename( Locale.getDefault(), "internal_error")); email.addRecipient(recipient);
throw new AuthorizeException(I18nUtil.getMessage("feedback.error.forbidden")); Email email = ConfigurationManager.getEmail(I18nUtil.getEmailFilename(context.getCurrentLocale(), "feedback")); email.addRecipient(ConfigurationManager .getProperty("feedback.recipient"));
go.start(); } else { Locale supportedLocale = I18nUtil.getEPersonLocale(eperson); emailErrorMessage(eperson, I18nUtil.getMessage("org.dspace.app.itemexport.no-result", supportedLocale));
/** * Configure the action. */ public void configure(Configuration config) { if (localeValidator == null) { localeValidator = new DSpaceLocaleValidator(); } if (defaultLocale == null) { defaultLocale = I18nUtil.getDefaultLocale(); } }
/** * get the available Locales for the User Interface as defined in dspace.cfg * property xmlui.supported.locales * returns an array of Locales or null * * @return an array of supported Locales or null */ private static Locale[] getSupportedLocales() { String ll = ConfigurationManager.getProperty("xmlui.supported.locales"); if (ll != null) { return I18nUtil.parseLocales(ll); } else { Locale result[] = new Locale[1]; result[0] = I18nUtil.DEFAULTLOCALE; return result; } } }
String formFileName = I18nUtil.getInputFormsFileName(sessionLocale);
Locale epersonLocale = I18nUtil.getEPersonLocale(context.getCurrentUser()); context.setCurrentLocale(epersonLocale); Config.set(request.getSession(), Config.FMT_LOCALE, epersonLocale);
supportedLocale = I18nUtil.getSupportedLocale(sessionLocale);
Locale supportedLocale = I18nUtil.getEPersonLocale(ep); Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "submit_archive")); if (StringUtils.isBlank(title)) { try { title = I18nUtil.getMessage("org.dspace.workflow.WorkflowManager.untitled"); } catch (MissingResourceException e) { title = "Untitled";
.toString(); Locale locale = context.getCurrentLocale(); Email bean = Email.getEmail(I18nUtil.getEmailFilename(locale, isRegister ? "register" : "change_password")); bean.addRecipient(email);
recipName = I18nUtil.getMessage("org.dspace.app.webui.servlet.SuggestServlet.recipient", context); senderName = I18nUtil.getMessage("org.dspace.app.webui.servlet.SuggestServlet.sender", context); Email email = ConfigurationManager.getEmail(I18nUtil.getEmailFilename(context.getCurrentLocale(), "suggest"));
getLogger().debug("No locale found, using default"); locale = I18nUtil.getDefaultLocale();
/** * get the available Locales for the User Interface as defined in dspace.cfg * returns an array of Locales or null * * @return an array of supported Locales or null */ public static Locale[] getSupportedLocales() { ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService(); String[] locales = config.getArrayProperty("webui.supported.locales"); if (locales != null && locales.length > 0) { return parseLocales(locales); } else { Locale[] availableLocales = new Locale[1]; availableLocales[0] = DEFAULTLOCALE; return availableLocales; } }
DCInput myInputs = null; boolean myInputsFound = false; String formFileName = I18nUtil.getInputFormsFileName(locale); String col_handle = "";
Locale epersonLocale = I18nUtil.getEPersonLocale(context.getCurrentUser()); context.setCurrentLocale(epersonLocale); Config.set(request.getSession(), Config.FMT_LOCALE, epersonLocale);
language = I18nUtil.getSupportedLocale(new Locale(language)).getLanguage();