Update the locale variants from the directory path given in parameter

@param rsBrowser
the resource browser
@param path
the skin path
@param localeVariants
the set of locale variants to update
433098
private void updateLocaleVariants(ResourceBrowser rsBrowser, String path, Set<String> localeVariants) {

		Set<String> skinPaths = rsBrowser.getResourceNames(path);
		for (Iterator<String> itSkinPath = skinPaths.iterator(); itSkinPath.hasNext();) {
			String skinPath = path + itSkinPath.next();
			if (rsBrowser.isDirectory(skinPath)) {
				String skinDirName = PathNormalizer.getPathName(skinPath);
				if (LocaleUtils.LOCALE_SUFFIXES.contains(skinDirName)) {
					localeVariants.add(skinDirName);
				}
			}
		}
	}
711023
@Override
	protected Reader generateResource(String path, GeneratorContext context) {

		Reader reader = null;
		ResourceReaderHandler readerHandler = context.getResourceReaderHandler();

		String skinRootDir = getSkinRootDir(path, skinMapping.keySet());
		Map<String, VariantSet> ctxVariantSetMap = skinMapping.get(skinRootDir);

		String skinVariantPath = path.substring(skinRootDir.length());
		String[] paths = skinVariantPath.split(JawrConstant.URL_SEPARATOR);

		VariantResourceReaderStrategy strategy = getVariantStrategy(context, ctxVariantSetMap);
		Map<String, String> variantMap = null;
		do {
			variantMap = strategy.nextVariantMapConbination();
			if (variantMap != null) {
				JoinableResourceBundle bundle = context.getBundle();
				reader = getResourceReader(bundle, path, readerHandler, skinRootDir, paths, variantMap);
			}
		} while (variantMap != null && reader == null);

		return reader;
	}
556575
public void updateUserLocale(HttpServletRequest request, String localeString) {

        IUserInstance ui = userInstanceManager.getUserInstance(request);
        IUserPreferencesManager upm = ui.getPreferencesManager();
        final IUserProfile userProfile = upm.getUserProfile();
        LocaleManager localeManager = userProfile.getLocaleManager();

        if (localeString != null) {

            // build a new List<Locale> from the specified locale
            Locale userLocale = localeManagerFactory.parseLocale(localeString);
            List<Locale> locales = Collections.singletonList(userLocale);

            // set this locale in the session
            localeManager.setSessionLocales(locales);

            // if the current user is logged in, also update the persisted
            // user locale
            final IPerson person = ui.getPerson();
            if (!person.isGuest()) {
                try {
                    localeManager.setUserLocales(Collections.singletonList(userLocale));
                    localeStore.updateUserLocales(person, new Locale[] {userLocale});

                    // remove person layout framgent from session since it contains some of the data
                    // in previous
                    // translation and won't be cleared until next logout-login (applies when using
                    // RDBMDistributedLayoutStore as user layout store).
                    person.setAttribute(Constants.PLF, null);
                    upm.getUserLayoutManager().loadUserLayout(true);
                } catch (Exception e) {
                    throw new PortalException(e);
                }
            }
        }
    }
444988
function _checkBrowserInitializers(rootPath) {
  const isBrowserInitializersPresent = _checkInitializerTypeExists(rootPath, 'browser');

  if (isBrowserInitializersPresent) {
    const errorMsg = `FastBoot build no longer supports ${rootPath}/app/(instance-)?initializers/browser structure. ` +
                         `Please refer to http://ember-fastboot.com/docs/addon-author-guide#browser-only-or-node-only-initializers for a migration path.`;
    throw new Error(errorMsg);
  }
}
76633
public void switchToLocale(Locale locale) throws CmsException {

        CmsObject cms = A_CmsUI.getCmsObject();
        CmsLocaleGroupService groupService = cms.getLocaleGroupService();
        CmsLocaleGroup localeGroup = groupService.readDefaultFileLocaleGroup(m_currentRoot);
        Collection<CmsResource> resources = localeGroup.getResourcesForLocale(locale);
        if (resources.isEmpty()) {
            LOG.error(
                "Can not switch to locale "
                    + locale
                    + ": no page found in locale group of "
                    + m_currentRoot.getRootPath());
        }
        CmsResource localeVariant = resources.iterator().next();
        if (!localeVariant.isFolder()) {
            CmsResource parentFolder = cms.readParentFolder(localeVariant.getStructureId());
            if (m_comparisonLocale.equals(locale)) {
                m_comparisonLocale = m_rootLocale;
                m_rootLocale = locale;
            } else {
                m_rootLocale = locale;
            }
            updateLocaleWidgets();
            initTree(parentFolder);
        } else {
            LOG.error("locale variant should not be a folder: " + localeVariant.getRootPath());
        }
    }
1148305
def _updateVariantAnnotationSets(self, variantFile, dataUrl):
        
        # TODO check the consistency of this between VCF files.
        if not self.isAnnotated():
            annotationType = None
            for record in variantFile.header.records:
                if record.type == "GENERIC":
                    if record.key == "SnpEffVersion":
                        annotationType = ANNOTATIONS_SNPEFF
                    elif record.key == "VEP":
                        version = record.value.split()[0]
                        # TODO we need _much_ more sophisticated processing
                        # of VEP versions here. When do they become
                        # incompatible?
                        if version == "v82":
                            annotationType = ANNOTATIONS_VEP_V82
                        elif version == "v77":
                            annotationType = ANNOTATIONS_VEP_V77
                        else:
                            # TODO raise a proper typed exception there with
                            # the file name as an argument.
                            raise ValueError(
                                "Unsupported VEP version {} in '{}'".format(
                                    version, dataUrl))
            if annotationType is None:
                infoKeys = variantFile.header.info.keys()
                if 'CSQ' in infoKeys or 'ANN' in infoKeys:
                    # TODO likewise, we want a properly typed exception that
                    # we can throw back to the repo manager UI and display
                    # as an import error.
                    raise ValueError(
                        "Unsupported annotations in '{}'".format(dataUrl))
            if annotationType is not None:
                vas = HtslibVariantAnnotationSet(self, self.getLocalId())
                vas.populateFromFile(variantFile, annotationType)
                self.addVariantAnnotationSet(vas)
978336
void updateResourceInfo(final String path) {

        m_resourceInfoPanel.clear();
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(path)) {
            m_resourceInfoPanel.setVisible(false);
            if (m_hasImage) {
                removeStyleName(I_CmsLayoutBundle.INSTANCE.galleryFieldCss().hasImage());
                m_imagePreview.setInnerHTML("");
            }
        } else {
            m_resourceInfoPanel.getElement().getStyle().clearDisplay();
            if (m_hasImage) {
                addStyleName(I_CmsLayoutBundle.INSTANCE.galleryFieldCss().hasImage());
            }
            CmsRpcAction<CmsResultItemBean> action = new CmsRpcAction<CmsResultItemBean>() {

                @Override
                public void execute() {

                    getGalleryService().getInfoForResource(path, m_configuration.getLocale(), this);
                }

                @Override
                protected void onResponse(CmsResultItemBean result) {

                    displayResourceInfo(result);
                }
            };
            action.execute();
        }
        fireResize();
    }
885706
private void addToLocaleList(List localeList, List<Locale> locales) {
        if (locales != null) {
            for (Locale locale : locales) {
                if (locale != null && !localeList.contains(locale)) localeList.add(locale);
            }
        }
    }
452706
private void installLocaleProvider() {
        LocaleProvider.setProvider(new LocaleProvider() {
            public Locale get() {
                Locale locale=null;
                StaplerRequest req = Stapler.getCurrentRequest();
                if(req!=null)
                    locale = req.getLocale();
                if(locale==null)
                    locale = Locale.getDefault();
                return locale;
            }
        });
    }
32008
function CrosswalkDir(path) {

    this._path = path;
    this._root = "./";

    var versionFilePath = Path.join(path, "VERSION");
    if (ShellJS.test("-f", versionFilePath)) {
        this._version = Version.createFromFile(versionFilePath);
    } else {
        this._version = Version.createFromPath(path);
    }

    if (!this._version) {
        throw new Error("Failed to determine crosswalk version");
    }
}
273531
def update_browsers(self, *args, **kwargs):
        
        sel = self.prjbrws.selected_indexes(0)
        if not sel:
            return
        prjindex = sel[0]
        if not prjindex.isValid():
            prj = None
        else:
            prjitem = prjindex.internalPointer()
            prj = prjitem.internal_data()
        self.set_project_banner(prj)
        releasetype = self.get_releasetype()
        self.update_shot_browser(prj, releasetype)
        self.update_asset_browser(prj, releasetype)
1097078
public function setLocalPath(string $localPath = null)
    {
        if (null === $localPath) {
            $localPath = $this->defaultLocalPath();
        }
        $this->localPath = $localPath;
    }
1187378
private void setValueForOtherLocales(CmsObject cms, I_CmsXmlContentValue value, String requiredParent) {

        if (!value.isSimpleType()) {
            throw new IllegalArgumentException();
        }
        for (Locale locale : getLocales()) {
            if (locale.equals(value.getLocale())) {
                continue;
            }
            String valuePath = value.getPath();
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(requiredParent) || hasValue(requiredParent, locale)) {
                ensureParentValues(cms, valuePath, locale);
                if (hasValue(valuePath, locale)) {
                    I_CmsXmlContentValue localeValue = getValue(valuePath, locale);
                    localeValue.setStringValue(cms, value.getStringValue(cms));
                } else {
                    int index = CmsXmlUtils.getXpathIndexInt(valuePath) - 1;
                    I_CmsXmlContentValue localeValue = addValue(cms, valuePath, locale, index);
                    localeValue.setStringValue(cms, value.getStringValue(cms));
                }
            }
        }
    }
1309291
public void setLocaleManager(CmsLocaleManager localeManager) {

        m_localeManager = localeManager;
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_CONFIG_I18N_FINISHED_0));
        }
    }
709953
protected function updateSinglePageSelection(
        array &$structureArray,
        PropertyMetadata $property,
        $localeSource,
        $localeDestination
    ) {
        if (!array_key_exists($property->getName(), $structureArray) || !$structureArray[$property->getName()]) {
            return;
        }

        $targetDocumentDestination = $this->getTargetDocumentDestination(
            $structureArray[$property->getName()],
            $localeSource,
            $localeDestination
        );

        if (!$targetDocumentDestination) {
            return;
        }

        $structureArray[$property->getName()] = $targetDocumentDestination->getUuid();
    }
437586
public void setLocale(Locale locale) {

        getStateHelper().put(PropertyKeys.locale, locale);
        // Make sure to appraise the EL of this switch in Locale.
        FacesContext.getCurrentInstance().getELContext().setLocale(locale);

    }
122136
protected void addBookmark(String path, Locale locale, boolean enabled, I_CmsXmlContentValue value) {

        // add the locale (since the locales are a set adding them more then once does not matter)
        addLocale(locale);

        // add a bookmark to the provided value
        m_bookmarks.put(getBookmarkName(path, locale), value);

        Set<Locale> sl;
        // update mapping of element name to locale
        if (enabled) {
            // only include enabled elements
            sl = m_elementLocales.get(path);
            if (sl != null) {
                sl.add(locale);
            } else {
                Set<Locale> set = new HashSet<Locale>();
                set.add(locale);
                m_elementLocales.put(path, set);
            }
        }
        // update mapping of locales to element names
        Set<String> sn = m_elementNames.get(locale);
        if (sn == null) {
            sn = new HashSet<String>();
            m_elementNames.put(locale, sn);
        }
        sn.add(path);
    }