i18n
This commit is contained in:
27
inc/spot.php
27
inc/spot.php
@@ -19,8 +19,6 @@ class Spot extends Main
|
||||
//Database
|
||||
const POST_TABLE = 'posts';
|
||||
|
||||
const FORMAT_TIME = 'd/m/Y à H:i';
|
||||
|
||||
const FEED_CHUNK_SIZE = 15;
|
||||
|
||||
/**
|
||||
@@ -126,9 +124,7 @@ class Spot extends Main
|
||||
'consts' => array(
|
||||
'geo_server' => Settings::GEO_SERVER,
|
||||
'modes' => Project::MODES,
|
||||
'site_timezone' => Settings::TIMEZONE,
|
||||
'site_timezone_desc' => self::getTimeZoneDesc(Settings::TIMEZONE),
|
||||
'trans' => $this->oLang->getTranslations()
|
||||
'site_timezone' => Settings::TIMEZONE
|
||||
)
|
||||
),
|
||||
'index',
|
||||
@@ -225,7 +221,7 @@ class Spot extends Main
|
||||
foreach($asMedias as $iIndex=>$asMedia) {
|
||||
$sTimeRef = $asMedia[$sTimeRefField];
|
||||
if($sTimeRef >= $this->oProject->getActivePeriod('from') && $sTimeRef <= $this->oProject->getActivePeriod('to')) {
|
||||
$asMedia['taken_on_formatted'] = date(self::FORMAT_TIME, strtotime($asMedia['taken_on']));
|
||||
$asMedia['taken_on_formatted'] = $this->getTimeFormat(strtotime($asMedia['taken_on']));
|
||||
$asMedia['displayed_id'] = 'N°'.($iIndex + 1);
|
||||
|
||||
$this->addTimeStamp($asMedia, strtotime($sTimeRef));
|
||||
@@ -263,8 +259,8 @@ class Spot extends Main
|
||||
|
||||
private function addTimeStamp(&$asData, $iTime) {
|
||||
$asData['unix_time'] = (int) $iTime;
|
||||
$asData['relative_time'] = Toolbox::getDateTimeDesc($iTime, 'fr');
|
||||
$asData['formatted_time'] = date(self::FORMAT_TIME, $iTime);
|
||||
$asData['relative_time'] = Toolbox::getDateTimeDesc($iTime, $this->oLang->getLanguage());
|
||||
$asData['formatted_time'] = $this->getTimeFormat($iTime);
|
||||
}
|
||||
|
||||
public function getNewsFeed($iChunk=0)
|
||||
@@ -328,7 +324,7 @@ class Spot extends Main
|
||||
public function upload()
|
||||
{
|
||||
$this->oClassManagement->incClass('uploader', true);
|
||||
$oUploader = new Uploader($this->oMedia);
|
||||
$oUploader = new Uploader($this->oMedia, $this->oLang);
|
||||
|
||||
return $oUploader->sBody;
|
||||
}
|
||||
@@ -355,7 +351,7 @@ class Spot extends Main
|
||||
$bSuccess = $this->oProject->setTimeZone($sValue);
|
||||
break;
|
||||
}
|
||||
if(!$bSuccess) $sDesc = 'Issue committing to DB';
|
||||
if(!$bSuccess) $sDesc = Mask::LANG_PREFIX.'error_commit_db';
|
||||
|
||||
return self::getJsonResult($bSuccess, $sDesc, array('values'=>$this->oProject->getProject()));
|
||||
}
|
||||
@@ -380,10 +376,9 @@ class Spot extends Main
|
||||
return $iDegree.'°'.$iMinute.'\''.$fSecond.'"'.$sDirection;
|
||||
}
|
||||
|
||||
public static function getTimeZoneDesc($sTimeZone) {
|
||||
$sCity = substr(strrchr($sTimeZone, '/'), 1);
|
||||
return 'heure d'.(in_array(strtolower(substr($sCity, 0, 1)), array('a', 'e', 'i', 'o', 'u', 'h'))?'\'':'e ').$sCity;
|
||||
public function getTimeFormat($iTime) {
|
||||
$sDate = date('d/m/Y', $iTime);
|
||||
$sTime = date('H:i', $iTime);
|
||||
return $this->oLang->getTranslation('date_time', array($sDate, $sTime));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
Reference in New Issue
Block a user