33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-12-28 12:30:44 +00:00

translate text badges

This commit is contained in:
Denis Ryabov 2021-09-05 23:04:22 +03:00
parent 9627a9b01e
commit a1a86d3f81
4 changed files with 14 additions and 12 deletions

View File

@ -144,3 +144,7 @@ COM_JEDCHECKER_LANG_VARIABLE_REF="A variable reference found in the translation
COM_JEDCHECKER_LANG_INCORRECT_ARGNUM="Probably you use incorrect placeholder format (e.g. '%1s' instead of '%1$s'), see <a href='https://www.php.net/manual/en/function.sprintf.php'>printf's argnum format specification</a> for details"
COM_JEDCHECKER_LANG_SPACES_AROUND="Spaces around the translation string are detected"
COM_JEDCHECKER_LANG_UNKNOWN_KEY_IN_CODE="Unknown language key '%s' found in the code."
COM_JEDCHECKER_LEVEL_ERROR="ERROR"
COM_JEDCHECKER_LEVEL_WARNING="WARNING"
COM_JEDCHECKER_LEVEL_COMPATIBILITY="COMPATIBILITY"
COM_JEDCHECKER_LEVEL_INFO="INFO"

View File

@ -186,24 +186,24 @@ class JEDcheckerReport extends JObject
// Go through the error list
if ($this->data['count']->errors > 0)
{
$html[] = $this->formatItems($this->data['errors'], 'danger');
$html[] = $this->formatItems($this->data['errors'], 'danger', JText::_('COM_JEDCHECKER_LEVEL_ERROR'));
}
// Go through the warning list
if ($this->data['count']->warning > 0)
{
$html[] = $this->formatItems($this->data['warning'], 'warning');
$html[] = $this->formatItems($this->data['warning'], 'warning', JText::_('COM_JEDCHECKER_LEVEL_WARNING'));
}
// Go through the compat list
if ($this->data['count']->compat > 0)
{
$html[] = $this->formatItems($this->data['compat'], 'secondary');
$html[] = $this->formatItems($this->data['compat'], 'secondary', JText::_('COM_JEDCHECKER_LEVEL_COMPATIBILITY'));
}
// Go through the info list
if ($this->data['count']->info > 0)
{
$html[] = $this->formatItems($this->data['info'], 'info');
$html[] = $this->formatItems($this->data['info'], 'info', JText::_('COM_JEDCHECKER_LEVEL_INFO'));
}
}
@ -243,11 +243,12 @@ class JEDcheckerReport extends JObject
* Converts an item to the string representation
*
* @param array $items List or reports
* @param string $alertStyle Type of alert blocks
* @param string $alertStyle Style of alert blocks
* @param string $alertName Type of alert blocks
*
* @return string
*/
protected function formatItems($items, $alertStyle)
protected function formatItems($items, $alertStyle, $alertName)
{
$html = array();
@ -255,7 +256,7 @@ class JEDcheckerReport extends JObject
{
$num = $i + 1;
$html[] = '<div class="alert alert-' . $alertStyle . '">';
$html[] = '<div class="alert alert-' . $alertStyle . '" data-level="' . $alertName . '">';
// Add count number
$html[] = '<strong>#' . str_pad($num, 3, '0', STR_PAD_LEFT) . '</strong> ';

View File

@ -50,6 +50,7 @@
/* Alerts */
#jedchecker .alert::before {
content: attr(data-level);
position: absolute;
top: -.5rem;
left: .5rem;
@ -65,7 +66,6 @@
border-color: #eebfbe;
}
#jedchecker .alert.alert-danger::before {
content: 'ERROR';
background-color: #761817;
color: #f3d4d4;
}
@ -75,7 +75,6 @@
border-color: #ffe9b9;
}
#jedchecker .alert.alert-warning::before {
content: 'WARNING';
background-color: #664808;
color: #fff0d0;
}
@ -85,7 +84,6 @@
border-color: #c8cbcd;
}
#jedchecker .alert.alert-secondary::before {
content: 'DEPRECATED';
background-color: #2c3034;
color: #dbdcdd;
}
@ -95,7 +93,6 @@
border-color: #bfcbd9;
}
#jedchecker .alert.alert-info::before {
content: 'INFO';
background-color: #193f6e;
color: #d4e1f1;
}

View File

@ -1 +1 @@
@-webkit-keyframes spinner-border{to{transform:rotate(360deg)}}@keyframes spinner-border{to{transform:rotate(360deg)}}#jedchecker .spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;border:.25em solid currentColor;border-right-color:transparent;border-radius:50%;-webkit-animation:.75s linear infinite spinner-border;animation:.75s linear infinite spinner-border}#jedchecker .spinner-border-sm{width:1rem;height:1rem;border-width:.2em}#jedchecker .spinner-border.hidden{display:none}#jedchecker .list-group-item-action.list-group-item-action.active{color:#fff;background-color:#132f53!important;border-color:#132f53!important}#jedchecker .badge{border:0!important;padding:.3rem .45rem!important}#jedchecker .badge.bg-info{background-color:#2a69b8!important;color:#fff}#jedchecker .alert::before{position:absolute;top:-.5rem;left:.5rem;padding:.25rem .5rem;font-size:.75rem;font-weight:700;line-height:1;border-radius:.25rem}#jedchecker .alert.alert-danger{color:#761817;background-color:#f3d4d4;border-color:#eebfbe}#jedchecker .alert.alert-danger::before{content:'ERROR';background-color:#761817;color:#f3d4d4}#jedchecker .alert.alert-warning{color:#664808;background-color:#fff0d0;border-color:#ffe9b9}#jedchecker .alert.alert-warning::before{content:'WARNING';background-color:#664808;color:#fff0d0}#jedchecker .alert.alert-secondary{color:#2c3034;background-color:#dbdcdd;border-color:#c8cbcd}#jedchecker .alert.alert-secondary::before{content:'DEPRECATED';background-color:#2c3034;color:#dbdcdd}#jedchecker .alert.alert-info{color:#193f6e;background-color:#d4e1f1;border-color:#bfcbd9}#jedchecker .alert.alert-info::before{content:'INFO';background-color:#193f6e;color:#d4e1f1}#jedchecker .alert pre{margin-bottom:0;white-space:pre}#jedchecker input[type=file]{height:auto}#jedchecker .fade.show{opacity:1}#jedchecker .collapse{height:inherit}#jedchecker .tooltip>.tooltip-arrow{border-style:none}
@-webkit-keyframes spinner-border{to{transform:rotate(360deg)}}@keyframes spinner-border{to{transform:rotate(360deg)}}#jedchecker .spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;border:.25em solid currentColor;border-right-color:transparent;border-radius:50%;-webkit-animation:.75s linear infinite spinner-border;animation:.75s linear infinite spinner-border}#jedchecker .spinner-border-sm{width:1rem;height:1rem;border-width:.2em}#jedchecker .spinner-border.hidden{display:none}#jedchecker .list-group-item-action.list-group-item-action.active{color:#fff;background-color:#132f53!important;border-color:#132f53!important}#jedchecker .badge{border:0!important;padding:.3rem .45rem!important}#jedchecker .badge.bg-info{background-color:#2a69b8!important;color:#fff}#jedchecker .alert::before{content:attr(data-level);position:absolute;top:-.5rem;left:.5rem;padding:.25rem .5rem;font-size:.75rem;font-weight:700;line-height:1;border-radius:.25rem}#jedchecker .alert.alert-danger{color:#761817;background-color:#f3d4d4;border-color:#eebfbe}#jedchecker .alert.alert-danger::before{background-color:#761817;color:#f3d4d4}#jedchecker .alert.alert-warning{color:#664808;background-color:#fff0d0;border-color:#ffe9b9}#jedchecker .alert.alert-warning::before{background-color:#664808;color:#fff0d0}#jedchecker .alert.alert-secondary{color:#2c3034;background-color:#dbdcdd;border-color:#c8cbcd}#jedchecker .alert.alert-secondary::before{background-color:#2c3034;color:#dbdcdd}#jedchecker .alert.alert-info{color:#193f6e;background-color:#d4e1f1;border-color:#bfcbd9}#jedchecker .alert.alert-info::before{background-color:#193f6e;color:#d4e1f1}#jedchecker .alert pre{margin-bottom:0;white-space:pre}#jedchecker input[type=file]{height:auto}#jedchecker .fade.show{opacity:1}#jedchecker .collapse{height:inherit}#jedchecker .tooltip>.tooltip-arrow{border-style:none}