/** * Gets the main translation locale configured for the given root path.<p> * * @param rootPath a root path * * @return the main translation locale configured for the given path, or null if none was found */ public Locale getMainLocale(String rootPath) { CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(rootPath); if (site == null) { return null; } return site.getMainTranslationLocale(null); }
/** * Returns true if this is a potential group head, i.e. the locale of the primary resource is the main translation locale configured for the site * in which it is located.<p> * * @return true if this is a potential group head */ public boolean isPotentialGroupHead() { CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(m_primaryResource.getRootPath()); if (site == null) { return false; } Locale mainLocale = site.getMainTranslationLocale(null); if (mainLocale == null) { return false; } Locale primaryLocale = getMainLocale(); return mainLocale.equals(primaryLocale); }
if (site != null) { List<Locale> siteLocales = site.getSecondaryTranslationLocales(); mainLocale = site.getMainTranslationLocale(null); if ((siteLocales == null) || siteLocales.isEmpty()) { siteLocales = OpenCms.getLocaleManager().getAvailableLocales();
Locale mainLocale = site.getMainTranslationLocale(null); List<Locale> secondaryLocales = site.getSecondaryTranslationLocales();
&& (site.getMainTranslationLocale(null) != null);