Modified:multilingual phrase issues fixed

This commit is contained in:
Awais-cb 2018-04-10 16:10:37 +05:00
parent 6c92da586a
commit 6ff2f28f57
2 changed files with 9 additions and 1 deletions

View file

@ -28,7 +28,11 @@ class GoogleTranslator
$transClient->setSource($from); // Translate from English
$transClient->setTarget($to); // Translate to Georgian
$transClient->setUrlBase('http://translate.google.cn/translate_a/single'); // Set Google Translate URL base (This is not necessary, only for some countries)
// checkmate
$text=str_replace("%s","_c_b_",$text);
$phraseTranslated = $transClient->translate($text);
$phraseTranslated=str_replace("_c_b_","%s",$phraseTranslated);
// checkmate
return $phraseTranslated;
}

View file

@ -2545,6 +2545,7 @@
*/
function nicetime($date,$istime=false) {
global $lang_obj;
if(empty($date)) {
return lang('no_date_provided');
}
@ -2579,7 +2580,10 @@
if($difference != 1) {
// *** Dont apply plural if terms ending by a "s". Typically, french word for "month" is "mois".
if(substr($periods[$j], -1) != "s") {
$periods[$j].= "s";
$periods[$j]= $periods[$j];
if($lang_obj->lang=='en'){
$periods[$j].= 's';
}
}
}
return sprintf(lang($tense),$difference,$periods[$j]);