[TWIG][TEMPLATES] Rename transchoice to trans and make it more generic
This commit is contained in:
parent
b3374333f3
commit
fc203e2e38
@ -9,10 +9,10 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if conversation.show_more %}
|
{% if conversation.show_more %}
|
||||||
<a href="{{ conversation.note.getConversationUrl() }}">
|
<a href="{{ conversation.note.getConversationUrl() }}">
|
||||||
{{ transchoice({
|
{{ trans({
|
||||||
'1': 'Show an additional reply',
|
'1': 'Show an additional reply',
|
||||||
'other': 'Show # additional replies'
|
'other': 'Show # additional replies'
|
||||||
}, (conversation.total_replies - config('plugin_tree_notes', 'feed_replies'))) }}
|
}, {'count': (conversation.total_replies - config('plugin_tree_notes', 'feed_replies'))}) }}
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -79,7 +79,7 @@ class Extension extends AbstractExtension
|
|||||||
new TwigFunction('open_details', [Runtime::class, 'openDetails']),
|
new TwigFunction('open_details', [Runtime::class, 'openDetails']),
|
||||||
new TwigFunction('show_stylesheets', [Runtime::class, 'getShowStylesheets']),
|
new TwigFunction('show_stylesheets', [Runtime::class, 'getShowStylesheets']),
|
||||||
new TwigFunction('add_right_panel_block', [Runtime::class, 'addRightPanelBlock']),
|
new TwigFunction('add_right_panel_block', [Runtime::class, 'addRightPanelBlock']),
|
||||||
new TwigFunction('transchoice', [Runtime::class, 'transchoice']),
|
new TwigFunction('trans', [Runtime::class, 'trans']),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,9 +57,9 @@ class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface
|
|||||||
$this->request = $req;
|
$this->request = $req;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function transchoice(array $message, int $count): string
|
public function trans(array $message, array $arguments): string
|
||||||
{
|
{
|
||||||
return _m($message, ['count' => $count]);
|
return _m($message, $arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isCurrentRouteActive(string ...$routes): string
|
public function isCurrentRouteActive(string ...$routes): string
|
||||||
|
Loading…
Reference in New Issue
Block a user