diff --git a/json2properties-generator/pom.xml b/json2properties-generator/pom.xml index 1207eaa..4385fc6 100644 --- a/json2properties-generator/pom.xml +++ b/json2properties-generator/pom.xml @@ -6,7 +6,7 @@ com.namics.oss.magnolia magnolia-dictionary-parent - 1.3.0 + 1.3.1 json2properties-generator diff --git a/magnolia-dictionary/pom.xml b/magnolia-dictionary/pom.xml index 76d10af..9f62164 100644 --- a/magnolia-dictionary/pom.xml +++ b/magnolia-dictionary/pom.xml @@ -6,7 +6,7 @@ com.namics.oss.magnolia magnolia-dictionary-parent - 1.3.0 + 1.3.1 magnolia-dictionary @@ -24,10 +24,6 @@ info.magnolia.site magnolia-site - - info.magnolia.site - magnolia-site-jcr - info.magnolia.publishing magnolia-publishing-core diff --git a/magnolia-dictionary/src/main/java/com/namics/oss/magnolia/dictionary/i18nsystem/DictionaryTranslationServiceImpl.java b/magnolia-dictionary/src/main/java/com/namics/oss/magnolia/dictionary/i18nsystem/DictionaryTranslationServiceImpl.java index 9181a09..2bd4f40 100644 --- a/magnolia-dictionary/src/main/java/com/namics/oss/magnolia/dictionary/i18nsystem/DictionaryTranslationServiceImpl.java +++ b/magnolia-dictionary/src/main/java/com/namics/oss/magnolia/dictionary/i18nsystem/DictionaryTranslationServiceImpl.java @@ -1,32 +1,37 @@ package com.namics.oss.magnolia.dictionary.i18nsystem; -import com.namics.oss.magnolia.dictionary.util.DictionaryUtils; import info.magnolia.cms.i18n.DefaultMessagesManager; import info.magnolia.cms.i18n.I18nContentSupport; -import info.magnolia.context.MgnlContext; import info.magnolia.i18nsystem.DefaultMessageBundlesLoader; +import info.magnolia.i18nsystem.I18nText; import info.magnolia.i18nsystem.LocaleProvider; import info.magnolia.i18nsystem.TranslationService; import info.magnolia.i18nsystem.TranslationServiceImpl; -import info.magnolia.i18nsystem.I18nText; import info.magnolia.i18nsystem.module.I18nModule; -import info.magnolia.module.site.ExtendedAggregationState; import info.magnolia.module.site.Site; import info.magnolia.module.site.SiteManager; import info.magnolia.objectfactory.ComponentProvider; import info.magnolia.objectfactory.Components; import info.magnolia.resourceloader.ResourceOrigin; -import org.apache.commons.lang3.ArrayUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; + +import java.lang.invoke.MethodHandles; +import java.util.Arrays; +import java.util.Locale; +import java.util.Objects; +import java.util.Optional; +import java.util.Properties; import javax.inject.Inject; import javax.inject.Provider; import javax.inject.Singleton; import javax.jcr.observation.EventIterator; import javax.jcr.observation.EventListener; -import java.lang.invoke.MethodHandles; -import java.util.*; + +import org.apache.commons.lang3.ArrayUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.namics.oss.magnolia.dictionary.util.DictionaryUtils; /** * @author mrauch, Namics AG @@ -131,32 +136,7 @@ private Locale getSiteFallbackLocale() { } private Optional getSiteI18n() { - try { - if (isSitePresent()) { - Site currentSite = Components.getComponent(SiteManager.class).getCurrentSite(); - return Optional.of(currentSite.getI18n()); - } - } catch (RuntimeException e) { - LOG.debug("Error while getting I18nContentSupport: '{}'", e.getMessage()); - LOG.trace("Error while getting I18nContentSupport", e); - } - return Optional.empty(); - } - - private boolean isSitePresent() { - // If a translation is requested before the site is - // set in the aggregationState, the SiteManager will - // log a warning (see info.magnolia.module.site.DefaultSiteManager.getCurrentSite). - // This happens, if the translation is requested in a - // filter which is located before the info.magnolia.multisite.filters.MultiSiteFilter. - // This is the case in Magnolia 5.7 info.magnolia.personalization.visitor.VisitorDetectorFilter. - if (MgnlContext.isWebContext()) { - return Optional.ofNullable(MgnlContext.getAggregationState()) - .filter(state -> state instanceof ExtendedAggregationState) - .map(state -> ((ExtendedAggregationState) state).getSite()) - .isPresent(); - } - return Boolean.FALSE; + return Optional.of(Components.getComponent(SiteManager.class).getCurrentSite()).map(Site::getI18n); } private Locale getFallbackLocale() { diff --git a/magnolia-dictionary/src/main/resources/META-INF/magnolia/magnolia-dictionary.xml b/magnolia-dictionary/src/main/resources/META-INF/magnolia/magnolia-dictionary.xml index 41e92a4..1cac805 100644 --- a/magnolia-dictionary/src/main/resources/META-INF/magnolia/magnolia-dictionary.xml +++ b/magnolia-dictionary/src/main/resources/META-INF/magnolia/magnolia-dictionary.xml @@ -32,23 +32,6 @@ - - - core - * - - - site - * - true - - - multisite - * - true - - - magnolia @@ -58,5 +41,4 @@ /mgnl-nodetypes/magnolia-dictionary-nodetypes.xml - \ No newline at end of file diff --git a/magnolia-dictionary/src/main/resources/mgnl-bootstrap/magnolia-dictionary/config.modules.ui-admincentral.config.appLauncherLayout.groups.edit.apps.dictionary.xml b/magnolia-dictionary/src/main/resources/mgnl-bootstrap/magnolia-dictionary/config.modules.ui-admincentral.config.appLauncherLayout.groups.edit.apps.dictionary.xml deleted file mode 100644 index 5d0b5c5..0000000 --- a/magnolia-dictionary/src/main/resources/mgnl-bootstrap/magnolia-dictionary/config.modules.ui-admincentral.config.appLauncherLayout.groups.edit.apps.dictionary.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - mgnl:contentNode - - - 52e16578-8639-41b3-b8cd-11165669923e - - - admin - - - 2013-04-19T11:29:14.524+02:00 - - - superuser - - - 2013-04-19T11:29:19.829+02:00 - - - superuser - - diff --git a/pom.xml b/pom.xml index a39572f..c1a305e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.namics.oss.magnolia magnolia-dictionary-parent - 1.3.0 + 1.3.1 pom ${project.artifactId} @@ -41,8 +41,8 @@ 3.0.2 - 5.11.0 - 5.13.0 + 5.11.1 + 5.14.1 3.11.0