From 93f7d287794f5689cd0e6351024baa59ed726a5d Mon Sep 17 00:00:00 2001 From: Amit Moryossef Date: Wed, 1 Jan 2025 16:41:53 +0100 Subject: [PATCH] chore(): generic changes and updates --- functions/package.json | 4 ++-- package.json | 6 +++--- src/app/components/map/map.component.ts | 4 ++-- src/app/core/helpers/iana/languages.ts | 2 +- src/app/core/modules/transloco/transloco.loader.ts | 9 +++++++-- .../spoken-language-input.component.ts | 4 ++-- src/app/pages/translate/translate.component.ts | 1 - tsconfig.json | 2 +- 8 files changed, 18 insertions(+), 14 deletions(-) diff --git a/functions/package.json b/functions/package.json index b66ada8c..931aefb4 100644 --- a/functions/package.json +++ b/functions/package.json @@ -43,8 +43,8 @@ "@types/jest": "29.5.14", "@types/node-fetch": "2.6.12", "@types/request-ip": "0.0.41", - "@typescript-eslint/eslint-plugin": "8.18.2", - "@typescript-eslint/parser": "8.18.2", + "@typescript-eslint/eslint-plugin": "8.19.0", + "@typescript-eslint/parser": "8.19.0", "eslint": "8.57.0", "firebase-functions-test": "3.4.0", "firebase-tools": "13.29.1", diff --git a/package.json b/package.json index 6e609d6a..0dffba7c 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "rxjs": "7.8.1", "stats.js": "0.17.0", "swiper": "11.1.15", - "three": "0.171.0", + "three": "0.172.0", "tslib": "2.8.1", "web-vitals": "4.2.4", "webm-muxer": "5.0.3", @@ -132,8 +132,8 @@ "@types/web-app-manifest": "1.0.8", "@types/webgl2": "0.0.11", "@types/wicg-file-system-access": "2023.10.5", - "@typescript-eslint/eslint-plugin": "8.18.2", - "@typescript-eslint/parser": "8.18.2", + "@typescript-eslint/eslint-plugin": "8.19.0", + "@typescript-eslint/parser": "8.19.0", "browser-sync": "3.0.3", "deepmerge": "4.3.1", "dotenv": "16.4.7", diff --git a/src/app/components/map/map.component.ts b/src/app/components/map/map.component.ts index 882f08f2..fb1408b7 100644 --- a/src/app/components/map/map.component.ts +++ b/src/app/components/map/map.component.ts @@ -1,6 +1,6 @@ import {Component, inject, NgModule, OnInit} from '@angular/core'; import {geoJSON, latLng, Map} from 'leaflet'; -import {HttpClient, provideHttpClient} from '@angular/common/http'; +import {HttpClient, provideHttpClient, withFetch} from '@angular/common/http'; import {firstValueFrom} from 'rxjs'; import {LeafletModule} from '@asymmetrik/ngx-leaflet'; import {BaseComponent} from '../base/base.component'; @@ -104,6 +104,6 @@ export class MapComponent extends BaseComponent implements OnInit { @NgModule({ imports: [LeafletModule, MapComponent], - providers: [provideHttpClient()], + providers: [provideHttpClient(withFetch())], }) export class MapModule {} diff --git a/src/app/core/helpers/iana/languages.ts b/src/app/core/helpers/iana/languages.ts index 957a2b06..5cb6f0fe 100644 --- a/src/app/core/helpers/iana/languages.ts +++ b/src/app/core/helpers/iana/languages.ts @@ -126,7 +126,7 @@ export const IANASignedLanguages = [ {signed: 'szs', spoken: 'en', country: 'sb', abbreviation: ''}, // Solomon Islands Sign Language {signed: 'sfb', spoken: 'fr', country: 'be', abbreviation: ''}, // French Belgian Sign Language {signed: 'sfs', spoken: 'af', country: 'za', abbreviation: ''}, // South African Sign Language - {signed: 'ssp', spoken: 'es', country: 'es', abbreviation: ''}, // Spanish Sign Language + {signed: 'ssp', spoken: 'es', country: 'es', abbreviation: 'LSE'}, // Spanish Sign Language {signed: 'sqs', spoken: 'si', country: 'lk', abbreviation: ''}, // Sri Lankan Sign Language {signed: 'swl', spoken: 'sv', country: 'se', abbreviation: 'STS'}, // Swedish Sign Language {signed: 'ssr', spoken: 'fr', country: 'ch', abbreviation: 'LSF-CH'}, // Swiss-French Sign Language diff --git a/src/app/core/modules/transloco/transloco.loader.ts b/src/app/core/modules/transloco/transloco.loader.ts index 6b35de3a..93c48c43 100644 --- a/src/app/core/modules/transloco/transloco.loader.ts +++ b/src/app/core/modules/transloco/transloco.loader.ts @@ -2,7 +2,7 @@ import {HttpClient} from '@angular/common/http'; import {Translation, TRANSLOCO_SCOPE, TranslocoLoader} from '@jsverse/transloco'; import {inject, Injectable} from '@angular/core'; -import {Observable} from 'rxjs'; +import {catchError, Observable} from 'rxjs'; @Injectable({providedIn: 'root'}) export class HttpLoader implements TranslocoLoader { @@ -10,7 +10,12 @@ export class HttpLoader implements TranslocoLoader { getTranslation(langPath: string): Observable { const assetPath = `assets/i18n/${langPath}.json`; - return this.http.get(assetPath); + return this.http.get(assetPath).pipe( + catchError(err => { + console.error(`Couldn't load translation file '${assetPath}'`, err); + throw err; + }) + ); } } diff --git a/src/app/pages/translate/spoken-to-signed/spoken-language-input/spoken-language-input.component.ts b/src/app/pages/translate/spoken-to-signed/spoken-language-input/spoken-language-input.component.ts index 7a7307f8..ecba137e 100644 --- a/src/app/pages/translate/spoken-to-signed/spoken-language-input/spoken-language-input.component.ts +++ b/src/app/pages/translate/spoken-to-signed/spoken-language-input/spoken-language-input.component.ts @@ -48,8 +48,8 @@ export class SpokenLanguageInputComponent extends BaseComponent implements OnIni text = new FormControl(); maxTextLength = 500; - detectedLanguage: string; - spokenLanguage: string; + detectedLanguage!: string; + spokenLanguage!: string; @Input() isMobile = false; diff --git a/src/app/pages/translate/translate.component.ts b/src/app/pages/translate/translate.component.ts index 306dfa2d..41a4f2e6 100644 --- a/src/app/pages/translate/translate.component.ts +++ b/src/app/pages/translate/translate.component.ts @@ -26,7 +26,6 @@ export class TranslateComponent extends BaseComponent implements OnInit { private title = inject(Title); spokenToSigned$: Observable; - spokenToSigned: boolean; isMobile: MediaQueryList; diff --git a/tsconfig.json b/tsconfig.json index fca83f8e..7035f4e6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,7 @@ "sourceMap": true, "declaration": false, "experimentalDecorators": true, - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "importHelpers": true, "target": "ES2022",