rtl pagination

General questions regarding the use of languages in Joomla! 2.5.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
chamela
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Dec 26, 2010 7:23 am

rtl pagination

Post by chamela » Fri Jan 14, 2011 10:00 pm

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;
}
 
?>

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: rtl pagination

Post by infograf768 » Sat Jan 15, 2011 12:23 pm

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.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: rtl pagination

Post by infograf768 » Sun Jan 16, 2011 7:01 am

Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

vivoices
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Sep 24, 2007 10:22 am

Re: rtl pagination

Post by vivoices » Sun Jan 16, 2011 10:43 am

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

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: rtl pagination

Post by infograf768 » Sun Jan 16, 2011 4:54 pm

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
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

chamela
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Dec 26, 2010 7:23 am

Re: rtl pagination

Post by chamela » Mon Jan 17, 2011 10:04 am

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

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: rtl pagination

Post by infograf768 » Mon Jan 17, 2011 12:49 pm

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.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

chamela
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Dec 26, 2010 7:23 am

Re: rtl pagination

Post by chamela » Mon Jan 17, 2011 1:26 pm

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...

User avatar
cbahiana
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 186
Joined: Wed Aug 24, 2005 2:03 pm
Location: Rio de Janeiro
Contact:

Re: rtl pagination

Post by cbahiana » Mon Sep 26, 2011 2:00 pm

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.
Carlos Bahiana
You can't always get what you want, but if you try sometimes...

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: rtl pagination

Post by infograf768 » Tue Sep 27, 2011 5:16 am

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)
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

kay_jay
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Jun 28, 2017 2:59 pm

Re: rtl pagination

Post by kay_jay » Mon Oct 02, 2017 4:53 pm

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

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: rtl pagination

Post by infograf768 » Tue Oct 03, 2017 5:30 am

This depends on your template CSS indeed.
Can't help without a link to that site.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group


Locked

Return to “Language - Joomla! 2.5”