Skip to main content

Translate, Override views_litepager text for Page

So it turns out that the current version of views_litepager 7.x-3.0 (https://www.drupal.org/project/views_litepager) does not use the t() function at the pager theme function. This is a simple override for updating (greek) the rendered text (page 1, page 2 etc) of the views litepager pager. Add this code at sites/all/themes/mytheme/template.php file /* // Override the Views Litepager module pagination text sring vars e.g // Page 1 -> Σελίδα 1 */ function mytheme_pager_lite($variables) { $tags = $variables['tags']; $element = $variables['element']; $parameters = $variables['parameters']; global $pager_page_array, $pager_total; // current is the page we are currently paged to $pager_current = $pager_page_array[$element] + 1; $li_previous = theme('pager_previous', array('text' => (isset($tags[1]) ? $tags[1] : t('‹‹')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters)); if (empty($li_previous)) { $li_previous = " "; } $li_next = theme('pager_lite_next', array('text' => (isset($tags[3]) ? $tags[3] : t('››')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters)); if (empty($li_next)) { $li_next = " "; } $items[] = array( 'class' => array('pager-previous'), 'data' => $li_previous, ); $items[] = array( 'class' => array('pager-current'), 'data' => format_plural($pager_current, 'Σελίδα 1', 'Σελίδα @count'), //This is where we override the default text for Pager ); $items[] = array( 'class' => array('pager-next'), 'data' => $li_next, ); return theme('item_list', array( 'items' => $items, 'title' => NULL, 'type' => 'ul', 'attributes' => array('class' => array('pager')), ) ); }