Site site = getAdminBean(request).getSite();
initSiteProfiles(form, site);
Item item = (Item) em.find(Item.class, Format.getLong(form.getItemId()));
createAdditionalInfo(getAdminBean(request), form, item);
GoogleTranslate translator = new GoogleTranslate(form.getFromLocale(), form.getToLocale());
if (!form.isSiteProfileClassDefault()) {
copyProperties(request, form, item);
}
try {
form.setItemShortDescLangFlag(true);
form.setItemDescLangFlag(true);
form.setPageTitleLangFlag(true);
form.setMetaKeywordsLangFlag(true);
form.setMetaDescriptionLangFlag(true);
form.setItemShortDescLang(translator.translate(item.getItemLanguage().getItemShortDesc()));
form.setItemDescLang(translator.translate(item.getItemLanguage().getItemDesc()));
form.setPageTitleLang(translator.translate(item.getItemLanguage().getPageTitle()));
form.setMetaKeywordsLang(translator.translate(item.getItemLanguage().getMetaKeywords()));
form.setMetaDescriptionLang(translator.translate(item.getItemLanguage().getMetaDescription()));
form.setItemAttribDetailValueLangFlag(true);
ItemAttributeDetailDisplayForm attributeDetailDisplayForm[] = form.getItemAttributeDetails();
for (int i = 0; i < attributeDetailDisplayForm.length; i++) {
attributeDetailDisplayForm[i].setItemAttribDetailValueLangFlag(true);
CustomAttribute customAttribute = CustomAttributeDAO.load(site.getSiteId(), Format.getLong(attributeDetailDisplayForm[i].getCustomAttribId()));
if (customAttribute.getCustomAttribTypeCode() != Constants.CUSTOM_ATTRIBUTE_TYPE_USER_INPUT) {
continue;
}
attributeDetailDisplayForm[i].setItemAttribDetailValueLang(translator.translate(attributeDetailDisplayForm[i].getItemAttribDetailValue()));
}
}
catch (Exception e) {
logger.error(e);
ActionMessages errors = new ActionMessages();