mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:48:49 +01:00
translate labels like "{something} {else}"
This commit is contained in:
parent
fa8ee606b3
commit
602f3093b5
@ -1396,7 +1396,16 @@ abstract class admin_cmd
|
|||||||
// config templates have options in the template
|
// config templates have options in the template
|
||||||
case 'option':
|
case 'option':
|
||||||
if (!is_array($widgets[$last_select])) $widgets[$last_select] = [];
|
if (!is_array($widgets[$last_select])) $widgets[$last_select] = [];
|
||||||
$widgets[$last_select][(string)$widget->attrs['value']] = $widget->attrs['#text'];
|
$label = (string)$widget->attrs['#text'];
|
||||||
|
// translate "{something} {else}" type options
|
||||||
|
if (strpos($label, '{') !== false)
|
||||||
|
{
|
||||||
|
$label = preg_replace_callback('/{([^}]+)}/', function($matches)
|
||||||
|
{
|
||||||
|
return lang($matches[1]);
|
||||||
|
}, $label);
|
||||||
|
}
|
||||||
|
$widgets[$last_select][(string)$widget->attrs['value']] = $label;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$last_select = null;
|
$last_select = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user