[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 %}
|
||||
{% if conversation.show_more %}
|
||||
<a href="{{ conversation.note.getConversationUrl() }}">
|
||||
{{ transchoice({
|
||||
{{ trans({
|
||||
'1': 'Show an additional reply',
|
||||
'other': 'Show # additional replies'
|
||||
}, (conversation.total_replies - config('plugin_tree_notes', 'feed_replies'))) }}
|
||||
}, {'count': (conversation.total_replies - config('plugin_tree_notes', 'feed_replies'))}) }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -79,7 +79,7 @@ class Extension extends AbstractExtension
|
|||
new TwigFunction('open_details', [Runtime::class, 'openDetails']),
|
||||
new TwigFunction('show_stylesheets', [Runtime::class, 'getShowStylesheets']),
|
||||
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;
|
||||
}
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user