1

In vendor\magento\module-contact\Controller\Index\Post.php

They are using \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation

$this->inlineTranslation->suspend();
$this->inlineTranslation->resume();

When is the purpose, options & when I have to use in my Custom Post form & where?

1 Answer 1

1

Those functions are set/change the status of In-line translation.

public function suspend($status = false)
{
    if ($this->storedStatus === null) {
        $this->storedStatus = $this->isEnabled;
        $this->isEnabled = $status;
    }
}


public function resume($status = true)
{
    $this->isEnabled = !$status ? $status : $this->storedStatus;
    $this->storedStatus = null;
}

If the in-line translation is allowed or is set true public function isAllowed() string will translated accordingly.

3
  • It means it only used for Multiple Language?
    – Jackson
    Commented Sep 21, 2016 at 4:28
  • Yes, for reference /vendor/magento/framework/Translate/Inline/State.php Commented Sep 21, 2016 at 4:29
  • This the part of Language fall back at in-ling translation. Commented Sep 21, 2016 at 5:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.