Plesk UI supports a wide range of languages. While supporting all of
them is not a requirement for certification, we recommend you to
localize your extension into at least the most popular languages (to
determine those, use common sense and consider your target audience) to
increase the number of your extension’s potential users. Also, if your
extension integrates not only into the administrator’s panel, but into
the customer’s panel as well, you should consider localizing your
extension into a wider range languages.
To localize the UI of your extension, use the
pm_Locale
helper.
All locale keys must be stored in the locale file
(plib/resources/locales/<locale-code>.php, for example,
plib/resources/locales/en-US.php):
<?php
$messages = [
'pageTitle' => 'My localized extensions',
'controllerMessage' => 'Message from controller',
'viewMessage' => 'Message shown in view',
];
Once stored, locale keys can be used in a controller to pass it to view:
public function indexAction()
{
$this->view->pageTitle = $this->lmsg('pageTitle');
$this->view->message = $this->lmsg('controllerMessage');
}
Or directly in view (index.phtml):
<h3><?php echo <…