/** * Configure the action. */ public void configure(Configuration config) { if (localeValidator == null) { localeValidator = new DSpaceLocaleValidator(); } if (defaultLocale == null) { defaultLocale = I18nUtil.getDefaultLocale(); } }
/** * 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)); }
getLogger().debug("No locale found, using default"); locale = I18nUtil.getDefaultLocale();
field.getQualifier(), Item.ANY); itemService.addMetadata(context, item, field.getMetadataSchema().getName(), field.getElement(), field.getQualifier(), I18nUtil.getDefaultLocale().toString(), StringUtils.trim(title)); itemService.update(context, item);