Restructure language files

This commit is contained in:
2026-04-28 21:39:36 +02:00
parent 37bfb42834
commit dcb916d442
24 changed files with 787 additions and 688 deletions

View File

@@ -166,7 +166,7 @@ class Spot extends Main
public function getAppMainPage() {
//Cache Page List
$asPages = array_diff($this->asMasks, array('email_update', 'email_conf'));
$asPages = array_diff($this->asMasks, array('email.update', 'email.confirmation'));
if(!$this->oUser->checkUserClearance(User::CLEARANCE_ADMIN)) {
$asPages = array_diff($asPages, array('admin', 'upload'));
}
@@ -231,11 +231,12 @@ class Spot extends Main
}
private function sendEmail() {
$oEmail = new Email($this->asContext['serv_name'], 'email_update');
$oEmail = new Email($this->asContext['serv_name'], 'email.update');
$oEmail->setDestInfo($this->oUser->getActiveUsersInfo());
//Add Position
$asLastMessage = array_shift($this->getSpotMessages(array($this->oProject->getLastMessageId($this->getFeedConstraints(Feed::MSG_TABLE)))));
$asSpotMessages = $this->getSpotMessages(array($this->oProject->getLastMessageId($this->getFeedConstraints(Feed::MSG_TABLE))));
$asLastMessage = array_shift($asSpotMessages);
$oEmail->oTemplate->setTags($asLastMessage);
$oEmail->oTemplate->setTag('date_time', 'time:'.$asLastMessage['unix_time'], 'd/m/Y, H:i');
@@ -326,8 +327,8 @@ class Spot extends Main
$asUserInfo = $this->oUser->getUserInfo();
//Send Confirmation Email
if($asResult['result'] && $asResult['desc']=='lang:nl_subscribed') {
$oConfEmail = new Email($this->asContext['serv_name'], 'email_conf');
if($asResult['result'] && $asResult['desc']=='lang:newsletter.subscribed') {
$oConfEmail = new Email($this->asContext['serv_name'], 'email.confirmation');
$oConfEmail->setDestInfo($asUserInfo);
$oConfEmail->send();
}
@@ -516,7 +517,7 @@ class Spot extends Main
$asResult = array_merge($asResult, $asMarkers);
}
else $sDesc = 'mode_histo';
else $sDesc = 'project.modes.histo';
return self::getJsonResult(true, $sDesc, $asResult);
}
@@ -588,6 +589,7 @@ class Spot extends Main
);
//Replace Array Key with Item ID
$asFeeds = array();
foreach($asFeedAttrs as $sType=>$asFeedAttr) {
foreach($asFeedAttr as $asFeed) {
$asFeeds[$sType][$asFeed['id_'.$sType]] = $asFeed;
@@ -621,7 +623,7 @@ class Spot extends Main
$this->oUser->updateNickname($sName);
}
else $sDesc = 'mode_histo';
else $sDesc = 'project.modes.histo';
return self::getJsonResult(($iPostId > 0), $sDesc);
}
@@ -647,7 +649,7 @@ class Spot extends Main
$bSuccess = $this->sendEmail();
$sDesc = $bSuccess?'mail_sent':'mail_failure';
}
else $sDesc = 'error_commit_db';
else $sDesc = 'error.commit_db';
return self::getJsonResult($bSuccess, $sDesc);
}
@@ -674,7 +676,7 @@ class Spot extends Main
$sDesc = '';
$asResult = array();
if($this->oDb->isId($sField) && $sValue <= 0) return self::getJsonResult(false, $this->oLang->getTranslation('impossible_value', [$sValue, $sField]));
if($this->oDb->isId($sField) && $sValue <= 0) return self::getJsonResult(false, $this->oLang->getTranslation('error.impossible_value', [$sValue, $sField]));
switch($sType) {
case 'project':
@@ -693,7 +695,7 @@ class Spot extends Main
$bSuccess = $oProject->setActivePeriod($sValue.' 23:59:59', 'to');
break;
default:
$sDesc = $this->oLang->getTranslation('unknown_field', $sField);
$sDesc = $this->oLang->getTranslation('error.unknown_field', $sField);
}
$asResult = $oProject->getProject();
$asResult['active_from'] = substr($asResult['active_from'], 0, 10);
@@ -712,7 +714,7 @@ class Spot extends Main
$bSuccess = $oFeed->setProjectId($sValue);
break;
default:
$sDesc = $this->oLang->getTranslation('unknown_field', $sField);
$sDesc = $this->oLang->getTranslation('error.unknown_field', $sField);
}
$asResult = $oFeed->getFeed();
break;
@@ -724,12 +726,12 @@ class Spot extends Main
$sDesc = $asReturnCode['desc'];
break;
default:
$sDesc = $this->oLang->getTranslation('unknown_field', $sField);
$sDesc = $this->oLang->getTranslation('error.unknown_field', $sField);
}
$asResult = $this->oUser->getActiveUserInfo($iId);
break;
}
if(!$bSuccess && $sDesc=='') $sDesc = Mask::LANG_PREFIX.'error_commit_db';
if(!$bSuccess && $sDesc=='') $sDesc = Mask::LANG_PREFIX.'error.commit_db';
return self::getJsonResult($bSuccess, $sDesc, array($sType=>array($asResult)));
}
@@ -837,7 +839,7 @@ class Spot extends Main
$sDate = $oDate->format('d/m/Y');
$sTime = $oDate->format('H:i');
return $this->oLang->getTranslation('date_time', array($sDate, $sTime));
return $this->oLang->getTranslation('time.date_time', array($sDate, $sTime));
}
public static function getTimeZoneDayOffset($iTime, $sLocalTimeZone) {