set feature variables from ts environment
parent
ee1bdba661
commit
ce1004a94f
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "opt-cc",
|
"name": "opt-cc",
|
||||||
"version": "1.8.3",
|
"version": "1.8.4",
|
||||||
"author": "Florian Hartwich <hardi@noarch.de>",
|
"author": "Florian Hartwich <hardi@noarch.de>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -98,15 +98,15 @@
|
||||||
<li *ngIf="!loginService.isLoggedIn()" routerLinkActive="active">
|
<li *ngIf="!loginService.isLoggedIn()" routerLinkActive="active">
|
||||||
<a routerLink='{{config.loginPath}}' class="link">{{'navigation.top.login' | translate}}</a>
|
<a routerLink='{{config.loginPath}}' class="link">{{'navigation.top.login' | translate}}</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="dropdown" *ngIf="FEATURE_LOCALIZATION_ENABLED">
|
<li class="dropdown" *ngIf="features.localization">
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
|
||||||
aria-expanded="false" style="padding: 12px 12px 10px 12px;">
|
aria-expanded="false" style="padding: 12px 12px 10px 12px;">
|
||||||
<mat-icon svgIcon="{{(language === 'de') ? 'flag-de' : 'flag-gb'}}"></mat-icon>
|
<mat-icon svgIcon="flag-{{language}}"></mat-icon>
|
||||||
<span class="caret"></span>
|
<span class="caret"></span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li *ngFor="let lang of languages" style="cursor: pointer">
|
<li *ngFor="let lang of languages" style="cursor: pointer">
|
||||||
<a (click)="setLanguage(lang)"><mat-icon svgIcon="{{(lang === 'de') ? 'flag-de' : 'flag-gb'}}"></mat-icon></a>
|
<a (click)="setLanguage(lang)"><mat-icon svgIcon="flag-{{lang}}"></mat-icon></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -10,6 +10,7 @@ import {MatIconRegistry} from '@angular/material';
|
||||||
import {SpinnerService} from './services/user-interface/spinner/spinner.service';
|
import {SpinnerService} from './services/user-interface/spinner/spinner.service';
|
||||||
import {TranslateService} from '@ngx-translate/core';
|
import {TranslateService} from '@ngx-translate/core';
|
||||||
import {SettingsService} from './services/settings.service';
|
import {SettingsService} from './services/settings.service';
|
||||||
|
import {environment} from '../environments/environment';
|
||||||
|
|
||||||
declare function require(url: string);
|
declare function require(url: string);
|
||||||
|
|
||||||
|
@ -20,7 +21,7 @@ declare function require(url: string);
|
||||||
})
|
})
|
||||||
export class AppComponent implements OnInit {
|
export class AppComponent implements OnInit {
|
||||||
|
|
||||||
readonly FEATURE_LOCALIZATION_ENABLED = false;
|
readonly features = environment.features;
|
||||||
|
|
||||||
config = RouteConfig;
|
config = RouteConfig;
|
||||||
|
|
||||||
|
@ -59,7 +60,7 @@ export class AppComponent implements OnInit {
|
||||||
'vehicleLight': 'stats/scoreboard/vehicleLight',
|
'vehicleLight': 'stats/scoreboard/vehicleLight',
|
||||||
// --------LOCALE---------
|
// --------LOCALE---------
|
||||||
'flag-de': 'locale/de',
|
'flag-de': 'locale/de',
|
||||||
'flag-gb': 'locale/gb',
|
'flag-en': 'locale/en',
|
||||||
};
|
};
|
||||||
|
|
||||||
language;
|
language;
|
||||||
|
|
Before Width: | Height: | Size: 831 B After Width: | Height: | Size: 831 B |
|
@ -1,4 +1,7 @@
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: true,
|
production: true,
|
||||||
e2eMode: false
|
e2eMode: false,
|
||||||
|
features: {
|
||||||
|
localization: false
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,5 +5,8 @@
|
||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
e2eMode: false
|
e2eMode: false,
|
||||||
|
features: {
|
||||||
|
localization: true
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue