Skip to content

Commit

Permalink
escape html on adminhtml form + added placeholders on missing text
Browse files Browse the repository at this point in the history
  • Loading branch information
michalis committed Oct 24, 2023
1 parent bfc322d commit 63d7f10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@ protected function _prepareForm()

$fieldset->addField('fallback', 'note', [
'label' => 'Fallback text from another module',
'text' => $model->getFallback() ?? '<i>no fallback text</i>',
'text' => '<code style="background-color: #f4f4f4; padding: 5px; display: block; margin: 10px 0;">'.($model->getFallback() ?? '<i>no fallback text</i>').'</code>',
]);

$fieldset->addField('view_text', 'note', [
'label' => 'Text that needs translation',
'text' => $model->getText(),
'text' => '<code style="background-color: #f4f4f4; padding: 5px; display: block; margin: 10px 0;">'.$this->escapeHtml($model->getText()).'</code>',
]);

$fieldset->addField('new_text', 'text', [
'name' => 'new_text',
'label' => $this->_getHelper()->__('Enter Translation'),
'value' => $model->getTranslation(),
'value' => $model->getTranslation() ?? $model->getText(),
'required' => true
]);

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "m-michalis/om-translator",
"type": "magento-module",
"license": "GPL-3.0",
"version": "0.1.3",
"version": "0.1.4",
"homepage": "https://github.com/m-michalis/om-translator",
"description":"The \"Translation Management\" module simplifies translation tasks in OpenMage by providing an efficient way to create and update missing and existing translations from various modules. This module offers a user-friendly grid/edit dashboard in the Admin panel, allowing you to manage translations with ease. Additionally, it can detect and capture missing translations when browsing the frontend.",
"keywords": [
Expand Down

0 comments on commit 63d7f10

Please sign in to comment.