mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-04 04:22:50 +00:00
@@ -17,8 +17,6 @@ import {SplashScreen} from '@ionic-native/splash-screen/ngx';
|
||||
import {StatusBar} from '@ionic-native/status-bar/ngx';
|
||||
import {Platform} from '@ionic/angular';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
import {SCLanguageCode} from '@openstapps/core';
|
||||
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {ConfigProvider} from './modules/config/config.provider';
|
||||
import {SettingsProvider} from './modules/settings/settings.provider';
|
||||
@@ -74,7 +72,7 @@ export class AppComponent {
|
||||
|
||||
try {
|
||||
// set language from settings
|
||||
const languageCode: SCLanguageCode = await this.settingsProvider.getSettingValue('profile', 'language');
|
||||
const languageCode = await this.settingsProvider.getSettingValue('profile', 'language');
|
||||
this.translateService.use(languageCode);
|
||||
} catch (error) {
|
||||
this.logger.warn(error);
|
||||
|
||||
@@ -7,41 +7,3 @@
|
||||
<ion-card-header>{{meta.getFieldTranslation(language, 'categories')}}</ion-card-header>
|
||||
<ion-card-content>{{item.categories.join(', ')}}</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
<ion-card *ngIf="item.characteristics">
|
||||
<ion-card-header>{{meta.getFieldTranslation(language, 'characteristics')}}</ion-card-header>
|
||||
<ion-card-content>{{item.characteristics.join(', ')}}</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
<ion-card *ngIf="item.additives">
|
||||
<ion-card-header>{{meta.getFieldTranslation(language, 'additives')}}</ion-card-header>
|
||||
<ion-card-content>{{item.additives.join(', ')}}</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
<ion-card *ngIf="item.place">
|
||||
<ion-card-header>{{meta.getFieldTranslation(language, 'place')}}</ion-card-header>
|
||||
<ion-card-content><a>{{item.place.name}}</a></ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
<ion-card>
|
||||
<ion-card-header>{{meta.getFieldTranslation(language, 'price')}}</ion-card-header>
|
||||
<ion-card-content>
|
||||
<ion-grid>
|
||||
<ion-row *ngFor="let offer of item.offers">
|
||||
<ion-col>
|
||||
{{offer.universityRole.name}}
|
||||
</ion-col>
|
||||
<ion-col>{{offer.price}}</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col>Standard / Gäste</ion-col>
|
||||
<ion-col>{{item.price}}</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
<ion-card *ngIf="item.availabilityStarts">
|
||||
<ion-card-header>Verfügbarkeit</ion-card-header>
|
||||
<ion-card-content>{{item.availabilityStarts | date}}</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{{item.name}}<br/>
|
||||
<ion-note>
|
||||
{{item.price}}
|
||||
{{item.categories.join(',')}}
|
||||
{{item.place.name}}
|
||||
</ion-note>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{{item.name}}<br/>
|
||||
|
||||
<ion-note>
|
||||
{{item.subProperties.semester}}
|
||||
{{item.categories.join(', ')}}
|
||||
{{item.startDate}} - {{item.endDate}}
|
||||
{{item.type}}
|
||||
</ion-note>
|
||||
|
||||
@@ -17,9 +17,9 @@ import {Geolocation} from '@ionic-native/geolocation/ngx';
|
||||
import {AlertController} from '@ionic/angular';
|
||||
import {LangChangeEvent, TranslateService} from '@ngx-translate/core';
|
||||
import {
|
||||
SCLanguageName,
|
||||
SCSetting,
|
||||
SCSettingMeta,
|
||||
SCTranslations,
|
||||
} from '@openstapps/core';
|
||||
import {SettingsProvider} from '../settings.provider';
|
||||
|
||||
@@ -29,7 +29,8 @@ import {SettingsProvider} from '../settings.provider';
|
||||
})
|
||||
export class SettingsItemComponent {
|
||||
isVisible = true;
|
||||
language: SCLanguageName;
|
||||
// limit to languages that are available in StApps Core
|
||||
language: keyof SCTranslations<any>;
|
||||
meta = SCSettingMeta;
|
||||
|
||||
@Input() setting: SCSetting;
|
||||
@@ -40,11 +41,11 @@ export class SettingsItemComponent {
|
||||
private geoLocation: Geolocation) {
|
||||
this.meta = SCSettingMeta;
|
||||
|
||||
this.language = translateService.currentLang as SCLanguageName;
|
||||
this.language = translateService.currentLang as keyof SCTranslations<any>;
|
||||
|
||||
translateService.onLangChange.subscribe((event: LangChangeEvent) => {
|
||||
this.isVisible = false;
|
||||
this.language = event.lang as SCLanguageName;
|
||||
this.language = event.lang as keyof SCTranslations<any>;
|
||||
// workaround for selected 'select option' not updating translation
|
||||
setTimeout(() => this.isVisible = true);
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {LangChangeEvent, TranslateService} from '@ngx-translate/core';
|
||||
import {SCLanguageName, SCSettingMeta} from '@openstapps/core';
|
||||
import {SCSettingMeta, SCTranslations} from '@openstapps/core';
|
||||
import {SettingsCache, SettingsProvider} from '../settings.provider';
|
||||
|
||||
@Component({
|
||||
@@ -23,16 +23,17 @@ import {SettingsCache, SettingsProvider} from '../settings.provider';
|
||||
})
|
||||
export class SettingsPageComponent implements OnInit {
|
||||
categoriesOrder: string[];
|
||||
language: SCLanguageName;
|
||||
// limit to languages that are available in StApps Core
|
||||
language: keyof SCTranslations<any>;
|
||||
meta = SCSettingMeta;
|
||||
objectKeys = Object.keys;
|
||||
settingsCache: SettingsCache;
|
||||
|
||||
constructor(public settingsProvider: SettingsProvider,
|
||||
translateService: TranslateService) {
|
||||
this.language = translateService.currentLang as SCLanguageName;
|
||||
this.language = translateService.currentLang as keyof SCTranslations<any>;
|
||||
translateService.onLangChange.subscribe((event: LangChangeEvent) => {
|
||||
this.language = event.lang as SCLanguageName;
|
||||
this.language = event.lang as keyof SCTranslations<any>;
|
||||
});
|
||||
this.settingsCache = {};
|
||||
this.categoriesOrder = settingsProvider.getCategoriesOrder();
|
||||
|
||||
Reference in New Issue
Block a user