diff --git a/ios/App/Podfile.lock b/ios/App/Podfile.lock index e32cd68f..db7668db 100644 --- a/ios/App/Podfile.lock +++ b/ios/App/Podfile.lock @@ -124,4 +124,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 8e6a2a27555a43af8fdcda646e72fe803c20f937 -COCOAPODS: 1.14.2 +COCOAPODS: 1.11.3 diff --git a/package-lock.json b/package-lock.json index f0cfb4d6..feddc98c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,6 +37,8 @@ "@fortawesome/free-solid-svg-icons": "6.4.2", "@ionic/angular": "7.5.5", "@ionic/pwa-elements": "^3.1.1", + "@ngx-translate/core": "^15.0.0", + "@ngx-translate/http-loader": "^8.0.0", "@tailwindcss/forms": "0.5.6", "@tailwindcss/typography": "0.5.10", "@trapezedev/configure": "7.0.10", @@ -5431,6 +5433,33 @@ "webpack": "^5.54.0" } }, + "node_modules/@ngx-translate/core": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@ngx-translate/core/-/core-15.0.0.tgz", + "integrity": "sha512-Am5uiuR0bOOxyoercDnAA3rJVizo4RRqJHo8N3RqJ+XfzVP/I845yEnMADykOHvM6HkVm4SZSnJBOiz0Anx5BA==", + "engines": { + "node": "^16.13.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/common": ">=16.0.0", + "@angular/core": ">=16.0.0", + "rxjs": "^6.5.5 || ^7.4.0" + } + }, + "node_modules/@ngx-translate/http-loader": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@ngx-translate/http-loader/-/http-loader-8.0.0.tgz", + "integrity": "sha512-SFMsdUcmHF5OdZkL1CHEoSAwbP5EbAOPTLLboOCRRoOg21P4GJx+51jxGdJeGve6LSKLf4Pay7BkTwmE6vxYlg==", + "engines": { + "node": "^16.13.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/common": ">=16.0.0", + "@angular/core": ">=16.0.0", + "@ngx-translate/core": ">=15.0.0", + "rxjs": "^6.5.5 || ^7.4.0" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -23952,6 +23981,18 @@ "dev": true, "requires": {} }, + "@ngx-translate/core": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@ngx-translate/core/-/core-15.0.0.tgz", + "integrity": "sha512-Am5uiuR0bOOxyoercDnAA3rJVizo4RRqJHo8N3RqJ+XfzVP/I845yEnMADykOHvM6HkVm4SZSnJBOiz0Anx5BA==", + "requires": {} + }, + "@ngx-translate/http-loader": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@ngx-translate/http-loader/-/http-loader-8.0.0.tgz", + "integrity": "sha512-SFMsdUcmHF5OdZkL1CHEoSAwbP5EbAOPTLLboOCRRoOg21P4GJx+51jxGdJeGve6LSKLf4Pay7BkTwmE6vxYlg==", + "requires": {} + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", diff --git a/package.json b/package.json index 55310c9c..3a4f336c 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,8 @@ "@fortawesome/free-solid-svg-icons": "6.4.2", "@ionic/angular": "7.5.5", "@ionic/pwa-elements": "^3.1.1", + "@ngx-translate/core": "^15.0.0", + "@ngx-translate/http-loader": "^8.0.0", "@tailwindcss/forms": "0.5.6", "@tailwindcss/typography": "0.5.10", "@trapezedev/configure": "7.0.10", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 0ba1e9d4..955c8846 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -11,6 +11,7 @@ import { onAuthStateChanged } from "@angular/fire/auth"; import { UserProfileService } from "./services/firebase/user-profile.service"; import { Device, DeviceId, DeviceInfo } from "@capacitor/device"; import { Network, ConnectionStatus } from '@capacitor/network'; +import { TranslateService } from "@ngx-translate/core"; @Component({ selector: "app-root", @@ -36,7 +37,8 @@ export class AppComponent implements OnInit { private readonly fbService: FirebaseService, private readonly profileService: UserProfileService, private readonly router: Router, - public readonly menuCtrl: MenuController + public readonly menuCtrl: MenuController, + private translate: TranslateService, ) { this.initializeApp(); // this.initializeFirebase(); @@ -158,7 +160,7 @@ export class AppComponent implements OnInit { initializeApp(): void { this.showSplashScreen(); - + this.translate.setDefaultLang('de'); this.swUpdate.versionUpdates.subscribe((event: VersionEvent) => { if (event.type === "VERSION_READY") { this.presentAlertUpdateVersion(); diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 1af31984..6261779f 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -9,7 +9,7 @@ import { AppComponent } from './app.component'; import { AppRoutingModule } from './app-routing.module'; import { ServiceWorkerModule } from '@angular/service-worker'; import { environment } from '../environments/environment'; -import { HttpClientModule } from '@angular/common/http'; +import { HttpClientModule,HttpClient } from '@angular/common/http'; // import { GraphQLModule } from './graphql.module'; @@ -38,6 +38,8 @@ import { EventDetailPage } from './pages/event/event-detail/event-detail.page'; import { ClubPage } from './pages/club/club.page'; import { TeamPage } from './pages/team/team.page'; import { Capacitor } from '@capacitor/core'; +import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; +import { TranslateHttpLoader } from '@ngx-translate/http-loader'; @NgModule({ @@ -66,6 +68,13 @@ import { Capacitor } from '@capacitor/core'; }), // GraphQLModule, HttpClientModule, + TranslateModule.forRoot({ // <--- add this + loader: { // <--- add this + provide: TranslateLoader, // <--- add this + useFactory: (createTranslateLoader), // <--- add this + deps: [HttpClient] // <--- add this + } // <--- add this + }), provideFirebaseApp(() => { const init = initializeApp(environment.firebase); return init; @@ -96,3 +105,6 @@ import { Capacitor } from '@capacitor/core'; schemas: [CUSTOM_ELEMENTS_SCHEMA] }) export class AppModule {} +export function createTranslateLoader(http: HttpClient) { + return new TranslateHttpLoader(http, './assets/lang/', '.json'); +} \ No newline at end of file diff --git a/src/app/pages/auth/login/login.module.ts b/src/app/pages/auth/login/login.module.ts index b1c5d21b..e0429757 100644 --- a/src/app/pages/auth/login/login.module.ts +++ b/src/app/pages/auth/login/login.module.ts @@ -6,6 +6,7 @@ import { IonicModule } from '@ionic/angular'; import { LoginPageRoutingModule } from './login-routing.module'; import { LoginPage } from './login.page'; +import { TranslateModule } from '@ngx-translate/core'; @NgModule({ imports: [ @@ -13,7 +14,8 @@ import { LoginPage } from './login.page'; FormsModule, ReactiveFormsModule, IonicModule, - LoginPageRoutingModule + LoginPageRoutingModule, + TranslateModule ], declarations: [LoginPage] }) diff --git a/src/app/pages/auth/login/login.page.html b/src/app/pages/auth/login/login.page.html index 0d415446..5e5631aa 100644 --- a/src/app/pages/auth/login/login.page.html +++ b/src/app/pages/auth/login/login.page.html @@ -10,12 +10,12 @@
- Oder - - erstelle einen neuen Account + {{"or"|translate}} + + {{"signin_create__account"|translate}}
@@ -25,7 +25,7 @@- Oder + {{"or" | translate}} - bist Du bereits registriert? + {{"already_have__acount" | translate}}
@@ -39,7 +39,7 @@