Page 1 of 1

rtl pagination

Posted: Fri Jan 14, 2011 10:00 pm
by chamela
Since the pagination is not set for rtl languages in 1.6.0 in the core Joomla. If you want to add it you need to create the file templates/template_name/html/pagination.php with the following code:

Code: Select all

<?php
defined('JPATH_BASE') or die;

function pagination_list_render($list) {

		$lang = JFactory::getLanguage();
		
		if ($lang->isRTL()) {
			$html = '<ul>';
			$html .= '<li class="pagination-start">'.$list['start']['data'].'</li>';
			$html .= '<li class="pagination-prev">'.$list['previous']['data'].'</li>';		
			$list['pages'] = array_reverse( $list['pages'] );	
			foreach($list['pages'] as $page) {
				$html .= '<li>'.$page['data'].'</li>';
			}
			$html .= '<li class="pagination-next">'. $list['next']['data'].'</li>';
			$html .= '<li class="pagination-end">'. $list['end']['data'].'</li>';
			$html .= '</ul>';
			
		} else {
			$html = '<ul>';
			$html .= '<li class="pagination-start">'.$list['start']['data'].'</li>';
			$html .= '<li class="pagination-prev">'.$list['previous']['data'].'</li>';
			foreach($list['pages'] as $page) {
				$html .= '<li>'.$page['data'].'</li>';
			}
			$html .= '<li class="pagination-next">'. $list['next']['data'].'</li>';
			$html .= '<li class="pagination-end">'. $list['end']['data'].'</li>';
			$html .= '</ul>';
		}

		return $html;
}

function pagination_list_footer($list) {

		$lang = JFactory::getLanguage();
		$html = "<div class=\"list-footer\">\n";
		
		if ($lang->isRTL()) {
			$html .= "\n<div class=\"counter\">".$list['pagescounter']."</div>";
			$html .= $list['pageslinks'];
			$html .= "\n<div class=\"limit\">".JText::_('JGLOBAL_DISPLAY_NUM').$list['limitfield']."</div>";

		} else {
			$html .= "\n<div class=\"limit\">".JText::_('JGLOBAL_DISPLAY_NUM').$list['limitfield']."</div>";
			$html .= $list['pageslinks'];
			$html .= "\n<div class=\"counter\">".$list['pagescounter']."</div>";
		}
		
		$html .= "\n<input type=\"hidden\" name=\"" . $list['prefix'] . "limitstart\" value=\"".$list['limitstart']."\" />";
		$html .= "\n</div>";
			
		return $html;
}
 
?>

Re: rtl pagination

Posted: Sat Jan 15, 2011 12:23 pm
by infograf768
It works in back-end because the css are Ok.

Just needs some CSS in front-end in the template_rtl.css

I will make a tracker.

Thanks.

Re: rtl pagination

Posted: Sun Jan 16, 2011 7:01 am
by infograf768

Re: rtl pagination

Posted: Sun Jan 16, 2011 10:43 am
by vivoices
I created a Hebrew translation for the frontend.
It still needs a lot of work.

Where can I upload my "he-IL_joomla_lang_site.1.6.0v1.zip"

Thanks,
David

Re: rtl pagination

Posted: Sun Jan 16, 2011 4:54 pm
by infograf768
vivoices wrote:I created a Hebrew translation for the frontend.
It still needs a lot of work.

Where can I upload my "he-IL_joomla_lang_site.1.6.0v1.zip"

Thanks,
David
I suggest you contact our Hebrew Translation Team Coordinator as he is now working on 1.6 translations.

http://forum.joomla.org/memberlist.php? ... e&u=147303

Re: rtl pagination

Posted: Mon Jan 17, 2011 10:04 am
by chamela
Thank you for patching the beez template. However, it would be nice to patch the pagination.php as well.

I have another issue with the pagination translation. How I can translate the strings:
- JLIB_HTML_PAGE_CURRENT_OF_TOTAL (Page 1 of 2)
- JLIB_HTML_START (Start)
- JLIB_HTML_END (End)

in the front-end only. I want to keep the back end as default (en-GB)

It seems that the translation of many strings affects both the frent-end and the back-end.

Thanks

Re: rtl pagination

Posted: Mon Jan 17, 2011 12:49 pm
by infograf768
chamela wrote:Thank you for patching the beez template. However, it would be nice to patch the pagination.php as well.

I have another issue with the pagination translation. How I can translate the strings:
- JLIB_HTML_PAGE_CURRENT_OF_TOTAL (Page 1 of 2)
- JLIB_HTML_START (Start)
- JLIB_HTML_END (End)

in the front-end only. I want to keep the back end as default (en-GB)

It seems that the translation of many strings affects both the frent-end and the back-end.

Thanks
http://docs.joomla.org/International_En ... _Overrides

is the solution.

Re: rtl pagination

Posted: Mon Jan 17, 2011 1:26 pm
by chamela
thanks for the tip, it worked for me. For those who are curious on how to do it, create the file xx-XX.override.ini (replace xx-XX with your language) and place it in the folder language/overrides/

Code: Select all

; xx-XX.override.ini file

JLIB_HTML_START="your_translation_here"
JLIB_HTML_END="your_translation_here"
etc...

Re: rtl pagination

Posted: Mon Sep 26, 2011 2:00 pm
by cbahiana
I might be missing something very simple.

My site (Joomla 1.7) is in pt-BR.

My pt-BR.lib_joomla.ini carries

JLIB_HTML_PAGE_CURRENT_OF_TOTAL = "Página %s de %s"
JLIB_HTML_START="Início"
JLIB_HTML_END="Fim"

Language setting in the administration area shows "Português (Brasil)" as default for both site and administration, but the only way to get theses strings (and only these three) working on the front end is to have them set in pt-BR.override.ini.

Re: rtl pagination

Posted: Tue Sep 27, 2011 5:16 am
by infograf768
cbahiana wrote:I might be missing something very simple.

My site (Joomla 1.7) is in pt-BR.

My pt-BR.lib_joomla.ini carries

JLIB_HTML_PAGE_CURRENT_OF_TOTAL = "Página %s de %s"
JLIB_HTML_START="Início"
JLIB_HTML_END="Fim"

Language setting in the administration area shows "Português (Brasil)" as default for both site and administration, but the only way to get theses strings (and only these three) working on the front end is to have them set in pt-BR.override.ini.
Check for the presence of the file pt-BR.lib_joomla.ini in the SITE pt-BR language folder.
If not present, please contact the coordinator for pt-BR Translation Team (in the meanwhile FTP a copy of that file from the administrator pt-BR language folder to the site language folder)

Re: rtl pagination

Posted: Mon Oct 02, 2017 4:53 pm
by kay_jay
Hi,

I am helping some friends out with an Arabic language website. On the articles pages, the Previous and Next buttons should be flipped, so that the buttons go to the side that the arrows are pointing. Image It seems like this is something that I would change in the CSS. Does anyone know to do this?

thanks,
Kyle

Re: rtl pagination

Posted: Tue Oct 03, 2017 5:30 am
by infograf768
This depends on your template CSS indeed.
Can't help without a link to that site.