Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Adapter.php
Go to the documentation of this file.
1 <?php
11 
12 class Adapter extends AbstractAdapter
13 {
22  public function translate($messageId, $locale = null)
23  {
24  $translator = $this->getOptions('translator');
25  if (is_callable($translator)) {
26  return call_user_func($translator, $messageId);
27  } else {
28  return $messageId;
29  }
30  }
31 
32  // @codingStandardsIgnoreStart
39  public function __()
40  {
41  $args = func_get_args();
42  $messageId = array_shift($args);
43  $string = $this->translate($messageId);
44  if (count($args) > 0) {
45  $string = vsprintf($string, $args);
46  }
47  return $string;
48  }
49  // @codingStandardsIgnoreEnd
50 }
translate($messageId, $locale=null)
Definition: Adapter.php:22
getOptions($optionKey=null)
Definition: Adapter.php:393