Hello.
I’ve been bumping my head for a while on something weird regarding the __()
translation function, and I could really use some help.
I’ve added some custom strings to a theme, particularly one to collections/browse
page:
<?php
echo link_to_items_browse(
__(plural('Browse %s item in the collection', 'Browse all %s items in the collection', $total), '<b>' . $total . '</b>'),
array('collection' => metadata('collection', 'id')),
array('class' => 'view-items-link')
);
?>
and… the linktext does not get translated.
I’m using the Translations plugin to add custom strings to the theme, and that is working fine because, if I tried to replace the plural()
part with any of the two strings, they would get correctly translated. But when passing them both via the plural()
function, they remain in English.
I’ve also tried replacing the plural()
function with something different:
echo link_to_items_browse(
__(($total > 1 ? 'Browse %s item in the collection' : 'Browse all %s items in the collection'), '<b>' . $total . '</b>'),
array('collection' => metadata('collection', 'id')),
array('class' => 'view-items-link')
);
?>
without success, of course.
So, what am I doing wrong? I assumed that according to (https://omeka.readthedocs.io/en/latest/Reference/libraries/globals/plural.html) it should work… Thanks for any advice.