-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.0] Translate stages via language files #21506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
3940166
0af8bae
e827c3e
ddf6681
6f0199a
a709ca0
422c1df
9da4a31
ebfea2b
8519f9f
1dc9611
9d0ba73
d0cb812
f984b17
59ae2a2
796e7f9
228e057
f2038ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,8 +11,8 @@ | |
| */ | ||
| defined('_JEXEC') or die; | ||
|
|
||
| use Joomla\CMS\Language\Text; | ||
| use Joomla\CMS\HTML\HTMLHelper; | ||
| use Joomla\CMS\Language\Text; | ||
| use Joomla\CMS\Router\Route; | ||
| use Joomla\CMS\Session\Session; | ||
| use Joomla\CMS\Factory; | ||
|
|
@@ -23,6 +23,8 @@ | |
| $user = Factory::getUser(); | ||
| $userId = $user->id; | ||
|
|
||
| $lang = Factory::getLanguage(); | ||
|
||
|
|
||
| $listOrder = $this->escape($this->state->get('list.ordering')); | ||
| $listDirn = $this->escape($this->state->get('list.direction')); | ||
| $saveOrderingUrl = ''; | ||
|
|
@@ -119,11 +121,11 @@ | |
| <th scope="row"> | ||
| <?php if ($canEdit) : ?> | ||
| <?php $editIcon = '<span class="fa fa-pencil-square mr-2" aria-hidden="true"></span>'; ?> | ||
| <a href="<?php echo $edit; ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape(addslashes($item->title)); ?>"> | ||
| <?php echo $editIcon; ?><?php echo $item->title; ?> | ||
| <a href="<?php echo $edit; ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape(addslashes(Text::_($item->title))); ?>"> | ||
| <?php echo $editIcon; ?><?php echo $this->escape(Text::_($item->title)); ?> | ||
| </a> | ||
| <?php else: ?> | ||
| <?php echo $item->title; ?> | ||
| <?php echo $this->escape(Text::_($item->title)); ?> | ||
| <?php endif; ?> | ||
| </th> | ||
| <td class="text-center"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,9 @@ | |
| use Joomla\CMS\Factory; | ||
| use Joomla\CMS\Form\FormHelper; | ||
| use Joomla\CMS\Workflow\Workflow; | ||
| use Joomla\CMS\Form\Field\ListField; | ||
|
||
| use Joomla\CMS\HTML\HTMLHelper; | ||
| use Joomla\CMS\Language\Text; | ||
| use Joomla\Utilities\ArrayHelper; | ||
|
|
||
| FormHelper::loadFieldClass('list'); | ||
|
|
@@ -62,7 +65,7 @@ public function setup(\SimpleXMLElement $element, $value, $group = null) | |
| /** | ||
| * Method to get a list of options for a list input. | ||
| * | ||
| * @return array An array of JHtml options. | ||
| * @return array An array of HTMLHelper options. | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
|
|
@@ -128,13 +131,13 @@ function ($item) use ($user, $extension) | |
|
|
||
| $workflowName = $db->setQuery($query)->loadResult(); | ||
|
|
||
| $default = [\JHtml::_('select.option', '', $workflowName)]; | ||
| $default = [HTMLHelper::_('select.option', '', Text::_($workflowName))]; | ||
|
|
||
| $options = array_merge(parent::getOptions(), $items); | ||
|
|
||
| if (count($options)) | ||
| { | ||
| $default[] = \JHtml::_('select.option', '-1', '--------', ['disable' => true]); | ||
| $default[] = HTMLHelper::_('select.option', '-1', '--------', ['disable' => true]); | ||
| } | ||
|
|
||
| // Merge with defaults | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,9 @@ | |
| defined('_JEXEC') or die; | ||
|
|
||
| use Joomla\CMS\Factory; | ||
| use Joomla\CMS\Form\Field\GroupedlistField; | ||
| use Joomla\CMS\HTML\HTMLHelper; | ||
| use Joomla\CMS\Language\Text; | ||
|
|
||
| /** | ||
| * Workflow Stages field. | ||
|
|
@@ -124,7 +126,7 @@ protected function getGroups() | |
| $workflowStages[$workflowStageKey] = array(); | ||
| } | ||
|
|
||
| $workflowStages[$workflowStageKey][] = HTMLHelper::_('select.option', $stage->workflow_stage_id, $stage->workflow_stage_title); | ||
| $workflowStates[$workflowStateKey][] = HTMLHelper::_('select.option', $state->workflow_stage_id, Text::_($state->workflow_stage_title)); | ||
|
||
| } | ||
|
|
||
| // Merge any additional options in the XML definition. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think correct would be do
escape()after translation, not before 😉There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, thx