[ Video Sharing CMS v4 ] Translation issue

Started by sevarf2,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Martin


PHPVibe A.

If you have switched to json (applied Mario's change), you need to delete the previous translations, as there are not the same encoding, and recreate them.

Open /moderator/edit-lang.php

Find at the top:

$translated = lang_terms($the_lang);
//var_dump($lang_terms);


remove // in front of var_dump and see if it has any output

var_dump($lang_terms);



max18121980

Note that these values can not be translated

  •  

PHPVibe A.

Quote from: max18121980 on
Note that these values can not be translated

Confirmed.
In lib/functions.php the

//global time ago
function time_ago($date,$granularity=2) {



should have this return

return $difference.' '._lang($periods[$j]).' '._lang($tense);

max18121980

Quote from: Alexander on
Confirmed.
In lib/functions.php the

//global time ago
function time_ago($date,$granularity=2) {



should have this return

return $difference.' '._lang($periods[$j]).' '._lang($tense);



I did so, and nothing has changed

//global time ago
function time_ago($date,$granularity=2) {
if (nullval($date)) {
return $difference.' '._lang($periods[$j]).' '._lang($tense);
}
$periods         = array("second", "minute", "hour", "day", "week", "month", "year", "decade");
$lengths         = array("60","60","24","7","4.35","12","10");
$now             = time();
$unix_date         = strtotime($date);
  •  

PHPVibe A.

The "return" is far downer.

//global time ago
function time_ago($date,$granularity=2) {
if (nullval($date)) {
return '';
}
$periods         = array("second", "minute", "hour", "day", "week", "month", "year", "decade");
$lengths         = array("60","60","24","7","4.35","12","10");
$now             = time();
$unix_date         = strtotime($date);
// check validity of date
if(empty($unix_date)) {
return $date;
}
// is it future date or past date
if($now > $unix_date) {
$difference     = $now - $unix_date;
$tense         = "ago";
} else {
$difference     = $unix_date - $now;
$tense         = "from now";
}
for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {
$difference /= $lengths[$j];
}
$difference = round($difference);
if($difference != 1) {
$periods[$j].= "s";
}
return $difference.' '._lang($periods[$j]).' '._lang($tense);
}

Similar topics (7)