Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feauture#408 #424

Merged
merged 3 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### [ita-challenges-frontend-3.1.2-RELEASE] - 2024-09-26 (feauture#408)

- Tooltip is not translated.

### [ita-challenges-frontend-3.1.0-RELEASE]

- Added pipe to escape java characters to json.
Expand Down
2 changes: 1 addition & 1 deletion conf/.env.CI.dev
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MICROSERVICE_DEPLOY=ita-challenges-frontend
MICROSERVICE_VERSION=3.1.0-RELEASE
MICROSERVICE_VERSION=3.1.2-RELEASE
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ita-challenges-frontend",
"version": "3.1.0-RELEASE",
"version": "3.1.2-RELEASE",
"sideEffects": [
"node_modules/@angular/localize"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@
<div>IT-Academy</div>
</div>

<div class="stat d-flex align-items-center" ngbTooltip="Empezado y finalizado">
<div class="stat d-flex align-items-center" [ngbTooltip]="'tooltips.startedFinished' | translate">
<div><img src="assets/img/icon/bullseye.svg" alt="Bullseye"></div>
<div>87%</div>
</div>

<div class="stat d-flex align-items-center" ngbTooltip="Veces guardado">
<div class="stat d-flex align-items-center" [ngbTooltip]="'tooltips.savedTimes' | translate">
<div><img src="assets/img/icon/bookmark.svg" alt="Bookmark"></div>
<div>82</div>
</div>

<div class="stat d-flex align-items-center" ngbTooltip="Fecha creación">
<div class="stat d-flex align-items-center" [ngbTooltip]="'tooltips.creationDate' | translate">
<div><img src="assets/img/icon/clock.svg" alt="Date"></div>
<div>{{creation_date | date:'mediumDate':'':currentLang}}</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import { RouterTestingModule } from '@angular/router/testing'
import { StarterService } from '../../../services/starter.service'
import { provideHttpClient, withInterceptorsFromDi, HttpClient } from '@angular/common/http'
import { provideHttpClientTesting, HttpClientTestingModule } from '@angular/common/http/testing'
import { TranslateService, TranslateModule, TranslateLoader } from '@ngx-translate/core'
import { TranslateModule, TranslateLoader } from '@ngx-translate/core'

import { HttpLoaderFactory } from '../../../app.module' // Asegúrate de que la ruta es correcta
import { LOCALE_ID } from '@angular/core'
import { LOCALE_ID, Pipe, type PipeTransform } from '@angular/core'
import { By } from '@angular/platform-browser'
import { formatDate } from '@angular/common'
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'

// Crear un mock para TranslateService
class TranslateServiceMock {
currentLang = 'ca'
instant (key: any): string {
return key
@Pipe({ name: 'translate' })
class MockTranslatePipe implements PipeTransform {
transform (value: string): string {
return value// Restituisce semplicemente la chiave di traduzione
}
}

Expand All @@ -25,8 +25,9 @@ describe('ChallengeCardComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ChallengeCardComponent],
declarations: [ChallengeCardComponent, MockTranslatePipe],
imports: [
NgbTooltipModule,
RouterTestingModule,
HttpClientTestingModule,
TranslateModule.forRoot({
Expand All @@ -41,7 +42,6 @@ describe('ChallengeCardComponent', () => {
StarterService,
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
{ provide: TranslateService, useClass: TranslateServiceMock },
{ provide: LOCALE_ID, useValue: 'ca' } // Proveer LOCALE_ID para el idioma
]
}).compileComponents()
Expand Down
5 changes: 5 additions & 0 deletions src/assets/i18n/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,10 @@
"invalidPassword": "Mínim 1 majúscula, 1 minúscula, 1 nombre i sense caràcters especials",
"pattern": "Format incorrecte"
}
},
"tooltips": {
"startedFinished": "Començat i finalitzat",
"savedTimes": "Vegades guardat",
"creationDate": "Data de creació"
}
}
5 changes: 5 additions & 0 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,10 @@
"invalidPassword": "Minimum 1 uppercase and 1 lower case letter, 1 number, and no special characters",
"pattern": "Invalid format"
}
},
"tooltips": {
"startedFinished": "Started and finished",
"savedTimes": "Times saved",
"creationDate": "Creation date"
}
}
5 changes: 5 additions & 0 deletions src/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,10 @@
"invalidPassword": "Mínimo 1 mayúscula, 1 minúscula, 1 número y sin caracteres especiales",
"pattern": "Formato incorrecto"
}
},
"tooltips": {
"startedFinished": "Empezado y finalizado",
"savedTimes": "Veces guardado",
"creationDate": "Fecha creación"
}
}