Does some i18n key refactoring stuff

parent e4b642e8
Pipeline #15952 passed with stages
in 5 minutes and 19 seconds
......@@ -22,10 +22,14 @@
<h5 class="text-center">{{'component.quiz_summary.validation_question_group' | translate}}</h5>
<p class="mb-0 d-flex align-self-center align-items-end h-100 text-bold"
role="listitem">
<span [class.text-success]="questionGroupItem.isValid()"
[class.text-danger]="!questionGroupItem.isValid()">
{{('component.quiz_summary.question_group_' + (questionGroupItem.isValid() ? 'successful' : 'failed')) | translate}}
</span>
<span *ngIf="questionGroupItem.isValid()"
class="text-success">
{{'component.quiz_summary.question_group_successful' | translate}}
</span>
<span *ngIf="!questionGroupItem.isValid()"
class="text-danger">
{{'component.quiz_summary.question_group_failed' | translate}}
</span>
</p>
</div>
</div>
......@@ -49,7 +53,12 @@
<h5 class="text-center">{{'component.quiz_summary.isRestrictingRudeNicks' | translate}}</h5>
<p class="mb-0"
role="listitem">
<span>{{('global.' + questionGroupItem.sessionConfig.nicks.blockIllegalNicks) | translate}}</span>
<span *ngIf="questionGroupItem.sessionConfig.nicks.blockIllegalNicks">
{{'global.true' | translate}}
</span>
<span *ngIf="!questionGroupItem.sessionConfig.nicks.blockIllegalNicks">
{{'global.false' | translate}}
</span>
</p>
</div>
</div>
......@@ -62,7 +71,12 @@
<h5 class="text-center">{{'component.quiz_summary.isRestrictingToCAS' | translate}}</h5>
<p class="mb-0"
role="listitem">
<span>{{('global.' + questionGroupItem.sessionConfig.nicks.restrictToCasLogin) | translate}}</span>
<span *ngIf="questionGroupItem.sessionConfig.nicks.restrictToCasLogin">
{{'global.true' | translate}}
</span>
<span *ngIf="!questionGroupItem.sessionConfig.nicks.restrictToCasLogin">
{{'global.false' | translate}}
</span>
</p>
</div>
</div>
......
......@@ -72,7 +72,8 @@
data-fa-mask="fas fa-square"></i>
<p class="ml-2 mb-0 d-inline">
<span>Server: </span>
<span>{{'region.header.connection_status.server_status.' + (connectionService.serverAvailable ? 'available' : 'not_available') | translate}}</span>
<span *ngIf="connectionService.serverAvailable">{{'region.header.connection_status.server_status.available' | translate}}</span>
<span *ngIf="!connectionService.serverAvailable">{{'region.header.connection_status.server_status.not_available' | translate}}</span>
</p>
</li>
<li>
......@@ -85,7 +86,8 @@
data-fa-mask="fas fa-square"></i>
<p class="ml-2 mb-0 d-inline">
<span>Websocket: </span>
<span>{{'region.header.connection_status.websocket_status.' + (connectionService.websocketAvailable ? 'connected' : 'not_connected') | translate}}</span>
<span *ngIf="connectionService.websocketAvailable">{{'region.header.connection_status.websocket_status.connected' | translate}}</span>
<span *ngIf="!connectionService.websocketAvailable">{{'region.header.connection_status.websocket_status.not_connected' | translate}}</span>
</p>
</li>
<li>
......@@ -98,7 +100,8 @@
data-fa-mask="fas fa-square"></i>
<p class="ml-2 mb-0 d-inline">
<span>LocalStorage: </span>
<span>{{'region.header.connection_status.localStorage_status.' + (localStorageAvailable ? 'writable' : 'non_writable') | translate}}</span>
<span *ngIf="localStorageAvailable">{{'region.header.connection_status.localStorage_status.writable' | translate}}</span>
<span *ngIf="!localStorageAvailable">{{'region.header.connection_status.localStorage_status.non_writable' | translate}}</span>
</p>
</li>
<li>
......@@ -111,7 +114,8 @@
data-fa-mask="fas fa-square"></i>
<p class="ml-2 mb-0 d-inline">
<span>SessionStorage: </span>
<span>{{'region.header.connection_status.sessionStorage_status.' + (sessionStorageAvailable ? 'writable' : 'non_writable') | translate}}</span>
<span *ngIf="sessionStorageAvailable">{{'region.header.connection_status.sessionStorage_status.writable' | translate}}</span>
<span *ngIf="!sessionStorageAvailable">{{'region.header.connection_status.sessionStorage_status.non_writable' | translate}}</span>
</p>
</li>
<li>
......@@ -124,7 +128,8 @@
data-fa-mask="fas fa-square"></i>
<p class="ml-2 mb-0 d-inline">
<span>Round-Trip-Time: </span>
<span>{{connectionService.serverAvailable ? (connectionService.rtt + 'ms') : ('region.header.connection_status.server_status.not_available' | translate)}}</span>
<span *ngIf="connectionService.serverAvailable">{{connectionService.rtt}} ms</span>
<span *ngIf="!connectionService.serverAvailable">{{'region.header.connection_status.server_status.not_available' | translate}}</span>
</p>
</li>
</ul>
......
<div class="row">
<h4 *ngIf="!leaderBoardCorrect.length"
class="col-12 mt-5 text-center text-light"
[innerHTML]="'component.leaderboard.no_attendee_correct' + (isGlobalRanking ? '_global' : '') | translate"></h4>
class="col-12 mt-5 text-center text-light">
<span *ngIf="isGlobalRanking">{{'component.leaderboard.no_attendee_correct_global' | translate}}</span>
<span *ngIf="!isGlobalRanking">{{'component.leaderboard.no_attendee_correct' | translate}}</span>
</h4>
<h4 *ngIf="leaderBoardCorrect.length"
class="col-12 text-light">
{{'component.leaderboard.title.' + (isGlobalRanking ? 'all_questions' : 'single_question') | translate:{QUESTION_ID: (questionIndex + 1)} }}
<span *ngIf="isGlobalRanking">
{{'component.leaderboard.title.all_questions' | translate }}
</span>
<span *ngIf="!isGlobalRanking">
{{'component.leaderboard.title.single_question' | translate:{QUESTION_ID: (questionIndex + 1)} }}
</span>
</h4>
<ng-container *ngIf="currentQuizService.quiz.sessionConfig.nicks.memberGroups.length > 1;else attendeeView">
......@@ -28,7 +35,10 @@
<div class="row">
<h4 class="col-12 text-light">
{{'component.leaderboard.title.' + (isGlobalRanking ? 'all_questions_partially' : 'single_question_partially') | translate:{QUESTION_ID: (questionIndex + 1)} }}
<span *ngIf="isGlobalRanking">{{'component.leaderboard.title.all_questions_partially' | translate }}</span>
<span *ngIf="!isGlobalRanking">
{{'component.leaderboard.title.single_question_partially' | translate:{QUESTION_ID: (questionIndex + 1)} }}
</span>
</h4>
<div *ngFor="let attendee of leaderBoardPartiallyCorrect"
......
......@@ -17,8 +17,15 @@
(click)="startQuiz()"
class="btn btn-default pointer"
[class.w-100]="currentQuizService.getVisibleQuestions().length">
<span
[innerHTML]="('component.liveResults.' + (currentQuizService.quiz.sessionConfig.readingConfirmationEnabled ? currentQuizService.readingConfirmationRequested ? 'start_round' : 'show_question' : 'start_round')) | translate"></span>
<span *ngIf="currentQuizService.quiz.sessionConfig.readingConfirmationEnabled && currentQuizService.readingConfirmationRequested">
{{'component.liveResults.start_round' | translate}}
</span>
<span *ngIf="currentQuizService.quiz.sessionConfig.readingConfirmationEnabled && !currentQuizService.readingConfirmationRequested">
{{'component.liveResults.show_question' | translate}}
</span>
<span *ngIf="!currentQuizService.quiz.sessionConfig.readingConfirmationEnabled">
{{'component.liveResults.start_round' | translate}}
</span>
<i class="fas fa-paper-plane"></i>
</button>
<button *ngIf="showStopCountdownButton()"
......
......@@ -30,7 +30,8 @@
role="switch"
[(ngModel)]="autoJoinToGroup"
[title]="'component.answeroptions.is_correct' | translate">
{{('global.' + (autoJoinToGroup ? 'yes' : 'no')) | translate}}
<span *ngIf="autoJoinToGroup">{{'global.yes' | translate}}</span>
<span *ngIf="!autoJoinToGroup">{{'global.no' | translate}}</span>
</label>
</div>
</div>
......
......@@ -45,7 +45,8 @@
[checked]="elem.isCorrect"
(change)="elem.isCorrect = !elem.isCorrect"
[title]="'component.answeroptions.is_correct' | translate">
{{('component.answeroptions.' + (elem.isCorrect ? 'correct' : 'wrong')) | translate}}
<span *ngIf="elem.isCorrect">{{'component.answeroptions.correct'}}</span>
<span *ngIf="!elem.isCorrect">{{'component.answeroptions.wrong'}}</span>
</label>
</div>
</div>
......@@ -70,7 +71,8 @@
[checked]="question.displayAnswerText"
(change)="toggleShowAnswerContentOnButtons()"
[title]="'component.answeroptions.show_answer_content_on_buttons' | translate">
{{('component.answeroptions.free_text_question.' + (question.displayAnswerText ? 'onText' : 'offText')) | translate}}
<span *ngIf="question.displayAnswerText">{{'component.answeroptions.free_text_question.onText' | translate}}</span>
<span *ngIf="!question.displayAnswerText">{{'component.answeroptions.free_text_question.offText' | translate}}</span>
</label>
</div>
<div class="col-12 mb-2 d-flex answerOptionConfig"
......@@ -90,7 +92,8 @@
[checked]="question.showOneAnswerPerRow"
(change)="toggleShowOneAnswerPerRow()"
[title]="'component.answeroptions.show_one_answer_per_row' | translate">
{{('component.answeroptions.free_text_question.' + (question.showOneAnswerPerRow ? 'onText' : 'offText')) | translate}}
<span *ngIf="question.showOneAnswerPerRow">{{'component.answeroptions.free_text_question.onText' | translate}}</span>
<span *ngIf="!question.showOneAnswerPerRow">{{'component.answeroptions.free_text_question.offText' | translate}}</span>
</label>
</div>
<div *ngIf="question.TYPE === 'SurveyQuestion'"
......@@ -111,7 +114,8 @@
[checked]="question.multipleSelectionEnabled"
(change)="toggleMultipleSelectionSurvey()"
[title]="'component.answeroptions.multiple_selection_survey' | translate">
{{('component.answeroptions.free_text_question.' + (question.multipleSelectionEnabled ? 'onText' : 'offText')) | translate}}
<span *ngIf="question.multipleSelectionEnabled">{{'component.answeroptions.free_text_question.onText' | translate}}</span>
<span *ngIf="!question.multipleSelectionEnabled">{{'component.answeroptions.free_text_question.offText' | translate}}</span>
</label>
</div>
</div>
......
......@@ -140,9 +140,11 @@
<div class="col-12">
<div class="validation">
<h4>
<span [innerHTML]="'component.quiz_summary.validation' | translate"></span>:&nbsp;
<span [class]="question.isValid() ? 'success' : 'failed'"
[innerHTML]="('component.quiz_summary.question_' + (question.isValid() ? 'successful' : 'failed')) | translate"></span>
<span>{{'component.quiz_summary.validation' | translate}}:&nbsp;</span>
<span class="success"
*ngIf="question.isValid()">{{'component.quiz_summary.question_successful' | translate}}</span>
<span class="failed"
*ngIf="!question.isValid()">{{'component.quiz_summary.question_failed' | translate}}</span>
</h4>
<ul *ngIf="!question.isValid()"
id="quizSummaryValidationErrors"
......
......@@ -83,7 +83,8 @@
[checked]="config.volumeConfig.useGlobalVolume"
(change)="config.volumeConfig.useGlobalVolume = !config.volumeConfig.useGlobalVolume"
[title]="'component.answeroptions.multiple_selection_survey' | translate">
{{('plugins.sound.' + (config.volumeConfig.useGlobalVolume ? 'activated' : 'deactivated')) | translate}}
<span *ngIf="config.volumeConfig.useGlobalVolume">{{'plugins.sound.activated' | translate}}</span>
<span *ngIf="!config.volumeConfig.useGlobalVolume">{{'plugins.sound.deactivated' | translate}}</span>
</label>
</div>
</div>
......@@ -110,7 +111,8 @@
[checked]="config.enabled.lobby"
(change)="config.enabled.lobby = !config.enabled.lobby"
[title]="'Activate/Deactivate Lobby Music Button'">
{{('plugins.sound.' + (config.enabled.lobby ? 'active' : 'inactive')) | translate}}
<span *ngIf="config.enabled.lobby">{{'plugins.sound.active' | translate}}</span>
<span *ngIf="!config.enabled.lobby">{{'plugins.sound.inactive' | translate}}</span>
</label>
<p class="mb-0 d-flex align-items-center ml-5 text-light">{{'plugins.sound.volume' | translate}}: {{config.volumeConfig.lobby}} %</p>
</div>
......@@ -162,7 +164,8 @@
[checked]="config.enabled.countdownRunning"
(change)="config.enabled.countdownRunning = !config.enabled.countdownRunning"
[title]="'Activate/Deactivate Countdown Running Button'">
{{('plugins.sound.' + (config.enabled.countdownRunning ? 'active' : 'inactive')) | translate}}
<span *ngIf="config.enabled.countdownRunning">{{'plugins.sound.active' | translate}}</span>
<span *ngIf="!config.enabled.countdownRunning">{{'plugins.sound.inactive' | translate}}</span>
</label>
<p class="mb-0 d-flex align-items-center ml-5 text-light">{{'plugins.sound.volume' | translate}}: {{config.volumeConfig.countdownRunning}} %</p>
</div>
......@@ -214,7 +217,8 @@
[checked]="config.enabled.countdownEnd"
(change)="config.enabled.countdownEnd = !config.enabled.countdownEnd"
[title]="'Activate/Deactivate Countdown End Button'">
{{('plugins.sound.' + (config.enabled.countdownEnd ? 'active' : 'inactive')) | translate}}
<span *ngIf="config.enabled.countdownEnd">{{'plugins.sound.active' | translate}}</span>
<span *ngIf="!config.enabled.countdownEnd">{{'plugins.sound.inactive' | translate}}</span>
</label>
<p class="mb-0 d-flex align-items-center ml-5 text-light">{{'plugins.sound.volume' | translate}}: {{config.volumeConfig.countdownEnd}} %</p>
</div>
......
......@@ -108,7 +108,6 @@ export class ConnectionService {
}
public initConnection(overrideCurrentState?: boolean): Promise<any> {
console.log('init connection');
return new Promise(async (resolve) => {
if ((this.pending || this.serverAvailable) && !overrideCurrentState) {
resolve();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment