french translation front end

you'll need to add these (attached) content elements into Joomfish which will then allow for front end translation
 

Attachments

  • contentelements-joomfish.zip
    2.5 KB · Views: 312
OK thank you, but I search to translate next previous in down table but I don't see where is it.
 
In English first: I think the next/previous translations are not Fabrik specific but depending on the Joomla general language choice.
Et en français: La traduction des mots "next" et "previous" n'ai pas à ma connaissance spécifique à Fabrik, mais dépendant du choix de la langue générale dans Joomla. Tout comme tu auras "auteur" à la place de "author", "download" à la place de télécharger" etc etc.
 
I reply to myself: Seems I'm wrong with above statement.
In fact the French general language file does have the translations needed:
DEFINE('_PN_START','Début');
DEFINE('_PN_PREVIOUS','Précédente');
and
DEFINE('_CMN_NEXT','Suivant');
DEFINE('_CMN_PREV','Précédent');

But even when switching to French the terms are not translated to French, so it seems Rob is not using the general translation file?

Gup'
 
ah yes - I've a custom pagenav function which doesnt contain the translation text. In components/com_fabrik/fabrik_functions.php replace:

Code:
/**
 * makes the table navigation html to traverse the table data
 * @param int the total number of records in the table
 * @param int number of records to show per page
 * @param int which record number to start at
 */
	 
function pageNav( $total, $pageLimit, $limitStart ){
	if($pageLimit == 0){
		$pageLimit = 5;
	}
	$b = $limitStart + $pageLimit;
	if($b > $total){ $b = $total;}
	$prevLimitStart = $limitStart - $pageLimit;
	if($prevLimitStart < 0){$prevLimitStart = 0;}
	
	$pageCount = ceil(($total ) / $pageLimit);
	$nextLimitStart = $limitStart + $pageLimit;
	$lastLimit = floor(($total - 1) / $pageLimit) * $pageLimit;
	if($nextLimitStart >= $total){$nextLimitStart = $lastLimit;}
	/* makes sure thatthe end limits are not less than 0 */
	if($nextLimitStart < 0){$nextLimitStart = 0;}
	if($lastLimit < 0){ $lastLimit = 0;}
	$str = "<table class=\"adminlist\"><tr><th>\n<span class=\"pagenav\">\n";
	if($limitStart == 0){
		$str .= "&lt;&lt;Start ";
	}else{
		$str .= "<a href=\"javascript: fabrikNav(0);\">&lt;&lt;Start</a> \n";
	}
	$str .= "</span>\n<span class=\"pagenav\">\n";
	if($limitStart == $prevLimitStart){
		$str .= "&lt;Previous ";
	}else{
		$str .= "<a href=\"javascript: fabrikNav($prevLimitStart);\">&lt;Previous</a> \n";			
	}
	$str .= "</span>\n\n";
	for($i=0;$i<$pageCount;$i++){
		$thisLimit = $i * $pageLimit;
		$j = $i +1;
		if($limitStart == $thisLimit){
			$str .= "<span class=\"pagenav\">$j</span> ";
		}else{
			$str .= "<span class=\"pagenav\"><a href=\"javascript: fabrikNav($thisLimit);\">$j</a></span> \n";
		}
	}
	$str .= "<span class=\"pagenav\">\n";
	if($limitStart == $nextLimitStart){
		$str .= "Next&gt; ";
	}else{
		$str .= "<a href=\"javascript: fabrikNav($nextLimitStart);\">Next&gt;</a> \n";
	}
	$str .= "</span>\n<span class=\"pagenav\">\n";
	if($limitStart == $lastLimit){
		$str .= "Last&gt;&gt;";
	}else{
		$str .= "<a href=\"javascript: fabrikNav($lastLimit);\">Last&gt;&gt;</a>\n";
	}
	$str .= "</span>\n";
	$str .= "</th</tr><tr><td style=\"text-align:center;\">Display # ";
	$str .= getLimitBox ($pageLimit ) ;
	$str .= " Results $limitStart to $b of $total</td></tr></table>";
	return $str;
}

with

Code:
/**
 * makes the table navigation html to traverse the table data
 * @param int the total number of records in the table
 * @param int number of records to show per page
 * @param int which record number to start at
 */
		 
	 
function pageNav( $total, $pageLimit, $limitStart ){
	if($pageLimit == 0){
		$pageLimit = 5;
	}
	$b = $limitStart + $pageLimit;
	if($b > $total){ $b = $total;}
	$prevLimitStart = $limitStart - $pageLimit;
	if($prevLimitStart < 0){$prevLimitStart = 0;}
	
	$pageCount = ceil(($total ) / $pageLimit);
	$nextLimitStart = $limitStart + $pageLimit;
	$lastLimit = floor(($total - 1) / $pageLimit) * $pageLimit;
	if($nextLimitStart >= $total){$nextLimitStart = $lastLimit;}
	/* makes sure thatthe end limits are not less than 0 */
	if($nextLimitStart < 0){$nextLimitStart = 0;}
	if($lastLimit < 0){ $lastLimit = 0;}
	if (!defined( '_PN_LT' ) || !defined( '_PN_RT' ) ) {
		DEFINE('_PN_LT','&lt;');
		DEFINE('_PN_RT','&gt;');
	}
	
	$str = "<table class=\"adminlist\"><tr><th>\n<span class=\"pagenav\">\n";
	if($limitStart == 0){
		$str .= "&lt;&lt;Start ";
	}else{
		$str .= "<a href=\"javascript: fabrikNav(0);\">" _PN_LT . _PN_LT .$pnSpace . _PN_START . "</a> \n";
	}
	$str .= "</span>\n<span class=\"pagenav\">\n";
	if($limitStart == $prevLimitStart){
		$str .= "&lt;Previous ";
	}else{
		$str .= "<a href=\"javascript: fabrikNav($prevLimitStart);\">" . _PN_LT . $pnSpace . _PN_PREVIOUS ."</a> \n";			
	}
	$str .= "</span>\n\n";
	for($i=0;$i<$pageCount;$i++){
		$thisLimit = $i * $pageLimit;
		$j = $i +1;
		if($limitStart == $thisLimit){
			$str .= "<span class=\"pagenav\">$j</span> ";
		}else{
			$str .= "<span class=\"pagenav\"><a href=\"javascript: fabrikNav($thisLimit);\">$j</a></span> \n";
		}
	}
	$str .= "<span class=\"pagenav\">\n";
	if($limitStart == $nextLimitStart){
		$str .= "Next&gt; ";
	}else{
		$str .= "<a href=\"javascript: fabrikNav($nextLimitStart);\">" . _PN_NEXT . "&gt;</a> \n";
	}
	$str .= "</span>\n<span class=\"pagenav\">\n";
	if($limitStart == $lastLimit){
		$str .= "Last&gt;&gt;";
	}else{
		$str .= "<a href=\"javascript: fabrikNav($lastLimit);\">" . _PN_END . "&gt;&gt;</a>\n";
	}
	$str .= "</span>\n";
	$str .= "</th</tr><tr><td style=\"text-align:center;\">" . _PN_DISPLAY_NR ;
	$str .= getLimitBox ($pageLimit ) ;
	$str .= _PN_RESULTS . " $limitStart - $b " . _PN_OF . " $total</td></tr></table>";
	return $str;
}
 
I'm sorry doesn't work, the buttons are always in english.
and be carreful the other users I think that it misses a point
$str = "<table class=\"adminlist\"><tr><th>\n<span class=\"pagenav\">\n";
if($limitStart == 0){
$str .= "&lt;&lt;Start ";
}else{
$str .= "<a href=\"javascript: fabrikNav(0);\">" ._PN_LT . _PN_LT .$pnSpace . _PN_START . "</a> \n";
}
$str .= "</span>\n<span class=\"pagenav\">\n";
if($limitStart == $prevLimitStart){
$str .= "&lt;Previous ";
}else{
$str .= "<a href=\"javascript: fabrikNav($prevLimitStart);\">" . _PN_LT . $pnSpace . _PN_PREVIOUS ."</a> \n";
 
Finaly!!!!!
I have partial solution for this problem. It's fabrik 1.03 that I'm using, and this is guide for this version.
In language file administrator/components/com_fabrik/language/english.php add these lines:
Code:
 define("_START", "<< Start");
define("_PREV", "< Prev");
define("_NEXT", "Next >");
define("_END", "End >>");
and in your language file (eg. administrator/components/com_fabrik/language/french.php
Code:
 define("_START", "<< start_in_french");
define("_PREV", "< previous_in_french");
define("_NEXT", "next_in_french >");
define("_END", "end_in_french >>");
sorry, my English is very bad, and I don't know any word in French. :(

Next thing is to replace code from line 61 to line 89 in component/com_fabrik/fabrik_functions.php
Code:
 		if ($this_page > 1) {
 			$page = ($this_page - 2) * $this->limit;
 			$html .= "\n<a href=\"#beg\" class=\"pagenav\" title=\"first page\" onclick=\"javascript:fabrikNav(0);return false;\">&lt;&lt;&nbsp;Start</a>";
 			$html .= "\n<a href=\"#prev\" class=\"pagenav\" title=\"previous page\" onclick=\"javascript:fabrikNav($page);return false;\">&lt;&nbsp;Previous</a>";
 		} else {
 			$html .= "\n<span class=\"pagenav\">&lt;&lt;&nbsp;Start</span>";
 			$html .= "\n<span class=\"pagenav\">&lt;&nbsp;Previous</span>";
 		}

 		for ($i=$start_loop; $i <= $stop_loop; $i++) {
 			$page = ($i - 1) * $this->limit;
 			if ($i == $this_page) {
 				$html .= "\n<span class=\"pagenav\"> $i </span>";
 			} else {
 				$html .= "\n<a href=\"#$i\" class=\"pagenav\" onclick=\"javascript:fabrikNav($page);return false;\"><strong>$i</strong></a>";
 			}
 		}

 		if ($this_page < $total_pages) {
 			$page = $this_page * $this->limit;
 			$end_page = ($total_pages-1) * $this->limit;
 			$html .= "\n<a href=\"#next\" class=\"pagenav\" title=\"next page\" onclick=\"javascript: fabrikNav($page);;return false;\"> Next&nbsp;&gt;</a>";
 			$html .= "\n<a href=\"#end\" class=\"pagenav\" title=\"end page\" onclick=\"javascript: fabrikNav($end_page);return false;\"> End&nbsp;&gt;&gt;</a>";
 		} else {
 			$html .= "\n<span class=\"pagenav\">Next&nbsp;&gt;</span>";
 			$html .= "\n<span class=\"pagenav\">End&nbsp;&gt;&gt;</span>";
 		}
 		return $html;
 	}
with
Code:
 		if ($this_page > 1) {
 			$page = ($this_page - 2) * $this->limit;
 			$html .= "\n<a href=\"#beg\" class=\"pagenav\" title=\"first page\" onclick=\"javascript:fabrikNav(0);return false;\">"._START."</a>";
 			$html .= "\n<a href=\"#prev\" class=\"pagenav\" title=\"previous page\" onclick=\"javascript:fabrikNav($page);return false;\">"._PREV."</a>";
 		} else {
 			$html .= "\n<span class=\"pagenav\">"._START."</span>";
 			$html .= "\n<span class=\"pagenav\">"._PREV."</span>";
 		}

 		for ($i=$start_loop; $i <= $stop_loop; $i++) {
 			$page = ($i - 1) * $this->limit;
 			if ($i == $this_page) {
 				$html .= "\n<span class=\"pagenav\"> $i </span>";
 			} else {
 				$html .= "\n<a href=\"#$i\" class=\"pagenav\" onclick=\"javascript:fabrikNav($page);return false;\"><strong>$i</strong></a>";
 			}
 		}

 		if ($this_page < $total_pages) {
 			$page = $this_page * $this->limit;
 			$end_page = ($total_pages-1) * $this->limit;
 			$html .= "\n<a href=\"#next\" class=\"pagenav\" title=\"next page\" onclick=\"javascript: fabrikNav($page);;return false;\">"._NEXT."</a>";
 			$html .= "\n<a href=\"#end\" class=\"pagenav\" title=\"end page\" onclick=\"javascript: fabrikNav($end_page);return false;\">"._END."</a>";
 		} else {
 			$html .= "\n<span class=\"pagenav\">"._NEXT."</span>";
 			$html .= "\n<span class=\"pagenav\">"._END."</span>";
 		}
 		return $html;
 	}

And that's it!!!


BUT (of course that there is BUT) I don't know where to find code that defines "Display #" and "Results" below these buttons.
Please HELP!

At least help me find these lines, or simply post how to translate these words. ;D
 
Hi, i'd like to know too what file do i have to modify to translate the words "Display #" and "Results x of y"

Thanks.
 
I think the "Display #" is on Joomla's administrator/includes/pageNavigation, as we're using the built in table footer function, and unfortunately they aren't using their own language file definition for that string in the pagenav code.

Not sure where "Results x of y" is coming from, I'll carry on digging.

-- hugh
 
Hugh Messenger said:
I think the "Display #" is on Joomla's administrator/includes/pageNavigation, as we're using the built in table footer function, and unfortunately they aren't using their own language file definition for that string in the pagenav code.

Not sure where "Results x of y" is coming from, I'll carry on digging.

-- hugh

Any news on this as I'm looking for the same thing?
 
OK, apparently the pagenav stuff is now fully translateable - should be in the most recent language files from SVN.

If you need to style the pagenav, you should be able to do most of what you want in your table template CSS file, just override the existing classes used in the pagenav.

-- hugh
 
Back
Top