Skip to content

Commit f9affb6

Browse files
Mutugiiidogi
andauthored
all: smoother spanish translations (fixes #9086) (#9104)
Co-authored-by: dogi <[email protected]>
1 parent 5005482 commit f9affb6

39 files changed

+20388
-18285
lines changed

angular.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,8 @@
227227
"options": {
228228
"browserTarget": "planet-app:build",
229229
"outputPath": "src/i18n",
230-
"format": "xlf",
231-
"ivy": true
232-
},
233-
"ivy": true
230+
"format": "xlf"
231+
}
234232
},
235233
"test": {
236234
"builder": "@angular-devkit/build-angular:karma",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "planet",
33
"license": "AGPL-3.0",
4-
"version": "0.20.43",
4+
"version": "0.20.44",
55
"myplanet": {
66
"latest": "v0.33.66",
77
"min": "v0.32.66"

src/app/chat/chat-sidebar/chat-sidebar.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@
6161
<button *ngIf="conversation.shared" mat-icon-button class="sidebar-icon" matTooltip="Conversation shared" i18n-matTooltip>
6262
<mat-icon>done_all</mat-icon>
6363
</button>
64-
<button mat-icon-button class="sidebar-icon" *ngIf="selectedConversation?._id === conversation?._id" (click)="toggleEditTitle()" matTooltip="Edit title">
64+
<button mat-icon-button class="sidebar-icon" *ngIf="selectedConversation?._id === conversation?._id" (click)="toggleEditTitle()" i18n-matTooltip matTooltip="Edit title">
6565
<mat-icon>edit</mat-icon>
6666
</button>
67-
<button mat-icon-button class="sidebar-icon" *ngIf="selectedConversation?._id === conversation?._id" (click)="openShareDialog(conversation)" matTooltip="Share conversation">
67+
<button mat-icon-button class="sidebar-icon" *ngIf="selectedConversation?._id === conversation?._id" (click)="openShareDialog(conversation)" i18n-matTooltip matTooltip="Share conversation">
6868
<mat-icon>share</mat-icon>
6969
</button>
7070
</ng-template>

src/app/chat/chat-window/chat-window.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
mat-icon-button
1717
[planetSubmit]="promptForm.valid && spinnerOn"
1818
[disabled]="!promptForm.valid || providers.length === 0"
19+
i18n-matTooltip
1920
matTooltip="chat is disabled, contact community admin"
2021
[matTooltipDisabled]="providers.length > 0"
2122
color="primary"

src/app/courses/enroll-courses/courses-enroll.component.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,20 @@ export class CoursesEnrollComponent {
8484
}
8585

8686
exportCSV() {
87-
// Prepare CSV data
8887
const csvData = this.members.map((user: any) => {
8988
return {
90-
username: user.doc.name,
91-
dateStarted: user.activityDates.createdDate
89+
[$localize`username`]: user.doc.name,
90+
[$localize`Date Started`]: user.activityDates.createdDate
9291
? new Date(user.activityDates.createdDate).toLocaleDateString()
9392
: 'N/A',
94-
mostRecentActivity: user.activityDates.updatedDate
93+
[$localize`Most Recent Activity`]: user.activityDates.updatedDate
9594
? new Date(user.activityDates.updatedDate).toLocaleDateString()
9695
: 'N/A',
9796
};
9897
});
9998
this.csvService.exportCSV({
10099
data: csvData,
101-
title: `Course Enrollment Data - ${this.course}`,
100+
title: $localize`Course Enrollment Data - ${this.course}`,
102101
});
103102
}
104103
}

src/app/courses/progress-courses/courses-progress-leader.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,13 @@ export class CoursesProgressLeaderComponent implements OnInit, OnDestroy {
245245
successfulSteps++;
246246
}
247247
totalErrors += stepErrors;
248-
steps[`Step ${(index + 1)}`] = stepErrors;
248+
steps[$localize`Step ${(index + 1)}`] = stepErrors;
249249
});
250250

251251
return {
252-
'Username': element.label,
253-
'Success Percentage': `${((successfulSteps / totalSteps) * 100).toFixed(2)}%`,
254-
'Total Errors': totalErrors,
252+
[$localize`Username`]: element.label,
253+
[$localize`Success Percentage`]: `${((successfulSteps / totalSteps) * 100).toFixed(2)}%`,
254+
[$localize`Total Errors`]: totalErrors,
255255
...steps
256256
};
257257
});

src/app/dashboard/dashboard-tile.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
{{(cardType === 'myLife' && isAccordionMode) ? '' : (item.title | truncateText:50)}}
3737
</p>
3838
<button mat-icon-button class="delete-item" (click)="removeFromShelf($event, item)" *ngIf="cardType!=='myLife' && !item?.canRemove">
39-
<mat-icon i18n-matTooltip [matTooltip]="'Remove from ' + cardTitle" [inline]="true">clear</mat-icon>
39+
<mat-icon i18n-matTooltip [matTooltip]="getRemoveTooltip(cardTitle)" [inline]="true">clear</mat-icon>
4040
</button>
4141
</div>
4242
</ng-container>

src/app/dashboard/dashboard-tile.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ export class DashboardTileComponent implements AfterViewChecked, OnInit {
161161
this.recentlyDragged = false;
162162
}, 300);
163163
}
164+
165+
getRemoveTooltip(cardTitle: string): string {
166+
return $localize`Remove from ${cardTitle}`;
167+
}
164168
}
165169

166170
@Component({

src/app/exams/exams-add.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</mat-accordion>
4747
<planet-step-list class="exam-questions" [steps]="questions" [nameProp]="'title'" (stepClicked)="stepClick($event)">
4848
<planet-step-list-item *ngFor="let question of questions?.controls; index as i" >
49-
<span class="exam-question" i18n>{{ plainText(question.value.body) || 'Question ' + (i+1) }}</span>
49+
<span class="exam-question">{{ getQuestionLabel(question.value.body, i) }}</span>
5050
<span i18n class="margin-lr-4 mat-caption warn-text-color" *ngIf="!question.valid && question.touched">There are missing fields on this question</span>
5151
</planet-step-list-item>
5252
<div planetStepListForm>

src/app/exams/exams-add.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,9 @@ export class ExamsAddComponent implements OnInit {
207207
(<UntypedFormArray>this.examForm.get('questions')).removeAt(index);
208208
}
209209

210-
plainText(value) {
211-
markdownToPlainText(value);
210+
getQuestionLabel(value: any, index: number): string {
211+
const questionText = markdownToPlainText(value);
212+
return questionText || $localize`Question ${index + 1}`;
212213
}
213214

214215
goBack() {

0 commit comments

Comments
 (0)