This internal method is used as a callback for when the translation
service or its locale changes. Also applies the translation to all
contained sections.

@see com.dlsc.formsfx.model.structure.Group ::translate
175381
public void translate(TranslationService translationService) {
    if (translationService == null) {
      description.setValue(descriptionKey.getValue());
      return;
    }

    if (!Strings.isNullOrEmpty(descriptionKey.get())) {
      description.setValue(translationService.translate(descriptionKey.get()));
    }
  }
463561
public static function setLocale($locale)
    {
        static::getDefaultLocale();
        Locale::setDefault($locale);
        if (isset(static::$_collection)) {
            static::translators()->setLocale($locale);
        }
    }
1281779
void switchLocale(final String locale) {

        if (locale.equals(m_locale)) {
            return;
        }
        m_locale = locale;
        m_basePanel.clear();
        destroyForm(false);
        final CmsEntity entity = m_entityBackend.getEntity(m_entityId);
        m_entityId = getIdForLocale(locale);
        // if the content does not contain the requested locale yet, a new node will be created
        final boolean addedNewLocale = !m_contentLocales.contains(locale);
        if (m_registeredEntities.contains(m_entityId)) {
            unregistereEntity(m_entityId);
        }
        if (addedNewLocale) {
            loadNewDefinition(m_entityId, entity, new I_CmsSimpleCallback<CmsContentDefinition>() {

                public void execute(final CmsContentDefinition contentDefinition) {

                    setContentDefinition(contentDefinition);
                    renderFormContent();
                    setChanged();

                }
            });
        } else {
            loadDefinition(m_entityId, entity, new I_CmsSimpleCallback<CmsContentDefinition>() {

                public void execute(CmsContentDefinition contentDefinition) {

                    setContentDefinition(contentDefinition);
                    renderFormContent();
                }
            });
        }
    }
1281732
public function actionUpdateAll()
    {
        
        // Scan the locales folder for languages in the wwextension and
        // launch actionUpdate for each of them.

    	// Get the list of languages that will be updated.
		$locales = $this->getLanguageList();

		// We now identified locales to be updated.
    	$this->outVerbose("Languages '" . implode(',', $locales) . "' will be updated for extension '" . $this->options['extension'] . "'.");
    	foreach ($locales as $l) {
    		$this->options['language'] = $l;
    		$this->checkUpdateInput();
    		$this->actionUpdate();
    		
    		$this->outVerbose("");
    	}
        
    }
552810
public function onImportTranslations()
    {
        $this->onTranslationList();
        $this->breadcrumbs->register('translations-import', function($breadcrumbs) {
            $breadcrumbs->parent('translations');
            $breadcrumbs->push('Import translations');
        });
        $this->shareOnView('translations-import');
    }
217056
protected function translateCategory(Locale $locale, CategoryInterface $category, $name)
    {
        /**
         * @var $translation \WellCommerce\Bundle\CategoryBundle\Entity\CategoryTranslation
         */
        $translation = $category->translate($locale->getCode());
        $slug        = $this->getLocaleSlug($locale, $name);
        $translation->setName($name);
        $translation->setSlug($slug);
        $category->mergeNewTranslations();
    }
867873
private void initializeCategoryTranslation() {
    flatCategoriesLst.forEach(category -> {
      translationServiceProperty().addListener((observable, oldValue, newValue) -> {
        category.translate(newValue);
        // listen for i18n changes in the TranslationService for this Category
        newValue.addListener(() -> category.translate(newValue));
      });
    });
  }
969355
public function locale(string $locale): SectionTwigExtension
    {
        $this->options[ReadOptions::LOCALE] = $locale;

        return $this;
    }
1018500
public function setTranslations() {
        $locales      = $this->getLocales();
        $translations = [];

        foreach($locales as $locale => $options) {
            $path = $this->getFileFullPath($locale);

            $contents = Support\get_file_contents($path);

            $translations[$locale] = $contents;
        }

        $this->translations = $this->loaded = $translations;

        return $this;
    }
701296
protected function setCurrentTranslation($fallback = false)
    {
        if (!($this->currentTranslation instanceof LayoutTranslation) || $this->currentTranslation->getLang() != $this->locale) {
            $i = 0;
            $end = count($this->translations);
            $found = false;

            while ($i<$end && !$found) {
                $found = ($this->translations[$i]->getLang() == $this->locale);
                $i++;
            }

            if ($found) {
                $this->currentTranslation = $this->translations[$i-1];
            } else {
                if($fallback && $this->getDefaultLocale()) {
                    $this->setLocale($this->getDefaultLocale());
                    $this->setCurrentTranslation();
                } else {
                    throw new NoTranslationException($this->locale, sprintf('No "%s" translation for layout "%s".', $this->locale, $this->reference));
                }
            }
        }
    }
376337
function () {
          for (var key in translationIds) {
            if (translationIds.hasOwnProperty(key) && translationIds[key] !== undefined) {
              updateTranslation(key, translationIds[key], scope, scope.interpolateParams, scope.defaultText, scope.translateNamespace);
            }
          }
        }
595684
function translate() {
      var offset = this.move * this.percentage;

      if (!this.$refs.stripContainer) return;

      if (offset < 0) {
        offset = 0;
      }
      if (offset > this.maxOffset) {
        offset = this.maxOffset;
      }
      this.currentOffset = offset;
      return {
        transform: this.config.translate + '(' + offset + 'px)'
      };
    }
52889
public static void translate(Struct sct) {
	Iterator<Entry<Key, Object>> it = sct.entryIterator();
	Entry<Key, Object> e;
	Object value;
	while (it.hasNext()) {
	    e = it.next();
	    value = e.getValue();
	    if (value instanceof String) {
		sct.setEL(e.getKey(), translate((String) value));
	    }
	}
    }
49608
public function addTranslation(LayoutTranslation $translation)
    {
        $this->translations->add($translation);
        $translation->setLayout($this);
    }
1108220
public function translateInstance()
    {

        $instance = $this->getCurrentInstance();

        $formContainer = new tao_actions_form_Translate($this->getCurrentClass(), $instance);
        $myForm = $formContainer->getForm();

        if ($this->hasRequestParameter('target_lang')) {

            $targetLang = $this->getRequestParameter('target_lang');

            if(in_array($targetLang, tao_helpers_I18n::getAvailableLangsByUsage($this->getResource(tao_models_classes_LanguageService::INSTANCE_LANGUAGE_USAGE_DATA)))){
                $langElt = $myForm->getElement('translate_lang');
                $langElt->setValue($targetLang);
                $langElt->setAttribute('readonly', 'true');

                $trData = $this->getClassService()->getTranslatedProperties($instance, $targetLang);
                foreach($trData as $key => $value){
                    $element = $myForm->getElement(tao_helpers_Uri::encode($key));
                    if(!is_null($element)){
                        $element->setValue($value);
                    }
                }
            }
        }

        if($myForm->isSubmited()){
            if($myForm->isValid()){

                $values = $myForm->getValues();
                if(isset($values['translate_lang'])){
                    $datalang = $this->getSession()->getDataLanguage();
                    $lang = $values['translate_lang'];

                    $translated = 0;
                    foreach($values as $key => $value){
                        if(preg_match("/^http/", $key)){
                            $value = trim($value);
                            $property = $this->getProperty($key);
                            if(empty($value)){
                                if($datalang != $lang && $lang != ''){
                                    $instance->removePropertyValueByLg($property, $lang);
                                }
                            }
                            else if($instance->editPropertyValueByLg($property, $value, $lang)){
                                $translated++;
                            }
                        }
                    }
                    if($translated > 0){
                        $this->setData('message', __('Translation saved'));
                    }
                }
            }
        }

        $this->setData('myForm', $myForm->render());
        $this->setData('formTitle', __('Translate'));
        $this->setView('form.tpl', 'tao');
    }
681443
public static final void translate (Group group, Vector3d v) {

		for (Atom atom : group.getAtoms()) {
			translate(atom,v);
		}
		for (Group altG : group.getAltLocs()) {
			translate(altG, v);
		}
	}
509927
function () {
            var wrapper = this,
              translateX = wrapper.translateX || 0,
              translateY = wrapper.translateY || 0,
              scaleX = wrapper.scaleX,
              scaleY = wrapper.scaleY,
              inverted = wrapper.inverted,
              rotation = wrapper.rotation,
              element = wrapper.element,
              transform;

            // flipping affects translate as adjustment for flipping around the group's axis
            if (inverted) {
                translateX += wrapper.attr('width');
                translateY += wrapper.attr('height');
            }

            // Apply translate. Nearly all transformed elements have translation, so instead
            // of checking for translate = 0, do it always (#1767, #1846).
            transform = ['translate(' + translateX + ',' + translateY + ')'];

            // apply rotation
            if (inverted) {
                transform.push('rotate(90) scale(-1,1)');
            } else if (rotation) { // text rotation
                transform.push('rotate(' + rotation + ' ' + (element.getAttribute('x') || 0) + ' ' + (element.getAttribute('y') || 0) + ')');
            }

            // apply scale
            if (defined(scaleX) || defined(scaleY)) {
                transform.push('scale(' + pick(scaleX, 1) + ' ' + pick(scaleY, 1) + ')');
            }

            if (transform.length) {
                element.setAttribute('transform', transform.join(' '));
            }
        }