From be72fac08b957ebb6ad88ec77dc3593f6c81f49c Mon Sep 17 00:00:00 2001 From: Guillaume Riondet <guillaume-auguste.riondet@etu.hesge.ch> Date: Thu, 30 Jul 2020 23:23:33 +0200 Subject: [PATCH] Touchpad works --- .../@ngx-translate/core/README.md | 552 +++++ .../core/bundles/ngx-translate-core.umd.js | 2111 +++++++++++++++++ .../bundles/ngx-translate-core.umd.js.map | 1 + .../bundles/ngx-translate-core.umd.min.js | 16 + .../bundles/ngx-translate-core.umd.min.js.map | 1 + .../lib/missing-translation-handler.js | 61 + .../core/esm2015/lib/translate.compiler.js | 52 + .../core/esm2015/lib/translate.directive.js | 261 ++ .../core/esm2015/lib/translate.loader.js | 36 + .../core/esm2015/lib/translate.parser.js | 120 + .../core/esm2015/lib/translate.pipe.js | 193 ++ .../core/esm2015/lib/translate.service.js | 722 ++++++ .../core/esm2015/lib/translate.store.js | 90 + .../@ngx-translate/core/esm2015/lib/util.js | 115 + .../core/esm2015/ngx-translate-core.js | 10 + .../@ngx-translate/core/esm2015/public_api.js | 102 + .../core/fesm2015/ngx-translate-core.js | 1723 ++++++++++++++ .../core/fesm2015/ngx-translate-core.js.map | 1 + .../core/lib/missing-translation-handler.d.ts | 33 + .../core/lib/translate.compiler.d.ts | 11 + .../core/lib/translate.directive.d.ts | 23 + .../core/lib/translate.loader.d.ts | 10 + .../core/lib/translate.parser.d.ts | 23 + .../core/lib/translate.pipe.d.ts | 21 + .../core/lib/translate.service.d.ts | 189 ++ .../core/lib/translate.store.d.ts | 41 + .../@ngx-translate/core/lib/util.d.ts | 17 + .../core/ngx-translate-core.d.ts | 4 + .../core/ngx-translate-core.metadata.json | 1 + .../@ngx-translate/core/package.json | 69 + .../@ngx-translate/core/public_api.d.ts | 29 + .../@ngx-translate/http-loader/README.md | 125 + .../bundles/ngx-translate-http-loader.umd.js | 33 + .../ngx-translate-http-loader.umd.js.map | 1 + .../ngx-translate-http-loader.umd.min.js | 2 + .../ngx-translate-http-loader.umd.min.js.map | 1 + .../http-loader/esm2015/lib/http-loader.js | 14 + .../esm2015/ngx-translate-http-loader.js | 5 + .../http-loader/esm2015/public_api.js | 2 + .../fesm2015/ngx-translate-http-loader.js | 20 + .../fesm2015/ngx-translate-http-loader.js.map | 1 + .../http-loader/lib/http-loader.d.ts | 13 + .../ngx-translate-http-loader.d.ts | 4 + .../ngx-translate-http-loader.metadata.json | 1 + .../@ngx-translate/http-loader/package.json | 70 + .../http-loader/public_api.d.ts | 1 + frontend/package-lock.json | 16 + frontend/package.json | 2 + frontend/src/app/app-routing.module.ts | 5 +- frontend/src/app/app.module.ts | 22 +- frontend/src/app/geometry/geometry2d.spec.ts | 70 + frontend/src/app/geometry/geometry2d.ts | 256 ++ .../src/app/recorder/recorder.component.ts | 18 +- .../speech-processing.service.spec.ts | 48 + .../speech-processing.service.ts | 60 + .../speech-processing/speech-providers.ts | 145 ++ .../app/touchpad/speech-processing/utils.ts | 60 + .../src/app/touchpad/touchpad.component.css | 15 + .../src/app/touchpad/touchpad.component.html | 7 + .../app/touchpad/touchpad.component.spec.ts | 25 + .../src/app/touchpad/touchpad.component.ts | 299 +++ .../whiteboard-page.component.ts | 43 +- frontend/src/assets/i18n/de.json | 239 ++ frontend/src/assets/i18n/en.json | 239 ++ frontend/src/assets/i18n/fr.json | 239 ++ 65 files changed, 8702 insertions(+), 37 deletions(-) create mode 100644 frontend/node_modules/@ngx-translate/core/README.md create mode 100644 frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.js create mode 100644 frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.js.map create mode 100644 frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.min.js create mode 100644 frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.min.js.map create mode 100644 frontend/node_modules/@ngx-translate/core/esm2015/lib/missing-translation-handler.js create mode 100644 frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.compiler.js create mode 100644 frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.directive.js create mode 100644 frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.loader.js create mode 100644 frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.parser.js create mode 100644 frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.pipe.js create mode 100644 frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.service.js create mode 100644 frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.store.js create mode 100644 frontend/node_modules/@ngx-translate/core/esm2015/lib/util.js create mode 100644 frontend/node_modules/@ngx-translate/core/esm2015/ngx-translate-core.js create mode 100644 frontend/node_modules/@ngx-translate/core/esm2015/public_api.js create mode 100644 frontend/node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.js create mode 100644 frontend/node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.js.map create mode 100644 frontend/node_modules/@ngx-translate/core/lib/missing-translation-handler.d.ts create mode 100644 frontend/node_modules/@ngx-translate/core/lib/translate.compiler.d.ts create mode 100644 frontend/node_modules/@ngx-translate/core/lib/translate.directive.d.ts create mode 100644 frontend/node_modules/@ngx-translate/core/lib/translate.loader.d.ts create mode 100644 frontend/node_modules/@ngx-translate/core/lib/translate.parser.d.ts create mode 100644 frontend/node_modules/@ngx-translate/core/lib/translate.pipe.d.ts create mode 100644 frontend/node_modules/@ngx-translate/core/lib/translate.service.d.ts create mode 100644 frontend/node_modules/@ngx-translate/core/lib/translate.store.d.ts create mode 100644 frontend/node_modules/@ngx-translate/core/lib/util.d.ts create mode 100644 frontend/node_modules/@ngx-translate/core/ngx-translate-core.d.ts create mode 100644 frontend/node_modules/@ngx-translate/core/ngx-translate-core.metadata.json create mode 100644 frontend/node_modules/@ngx-translate/core/package.json create mode 100644 frontend/node_modules/@ngx-translate/core/public_api.d.ts create mode 100644 frontend/node_modules/@ngx-translate/http-loader/README.md create mode 100644 frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.js create mode 100644 frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.js.map create mode 100644 frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.min.js create mode 100644 frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.min.js.map create mode 100644 frontend/node_modules/@ngx-translate/http-loader/esm2015/lib/http-loader.js create mode 100644 frontend/node_modules/@ngx-translate/http-loader/esm2015/ngx-translate-http-loader.js create mode 100644 frontend/node_modules/@ngx-translate/http-loader/esm2015/public_api.js create mode 100644 frontend/node_modules/@ngx-translate/http-loader/fesm2015/ngx-translate-http-loader.js create mode 100644 frontend/node_modules/@ngx-translate/http-loader/fesm2015/ngx-translate-http-loader.js.map create mode 100644 frontend/node_modules/@ngx-translate/http-loader/lib/http-loader.d.ts create mode 100644 frontend/node_modules/@ngx-translate/http-loader/ngx-translate-http-loader.d.ts create mode 100644 frontend/node_modules/@ngx-translate/http-loader/ngx-translate-http-loader.metadata.json create mode 100644 frontend/node_modules/@ngx-translate/http-loader/package.json create mode 100644 frontend/node_modules/@ngx-translate/http-loader/public_api.d.ts create mode 100644 frontend/src/app/geometry/geometry2d.spec.ts create mode 100644 frontend/src/app/geometry/geometry2d.ts create mode 100644 frontend/src/app/touchpad/speech-processing/speech-processing.service.spec.ts create mode 100644 frontend/src/app/touchpad/speech-processing/speech-processing.service.ts create mode 100644 frontend/src/app/touchpad/speech-processing/speech-providers.ts create mode 100644 frontend/src/app/touchpad/speech-processing/utils.ts create mode 100644 frontend/src/app/touchpad/touchpad.component.css create mode 100644 frontend/src/app/touchpad/touchpad.component.html create mode 100644 frontend/src/app/touchpad/touchpad.component.spec.ts create mode 100644 frontend/src/app/touchpad/touchpad.component.ts create mode 100644 frontend/src/assets/i18n/de.json create mode 100644 frontend/src/assets/i18n/en.json create mode 100644 frontend/src/assets/i18n/fr.json diff --git a/frontend/node_modules/@ngx-translate/core/README.md b/frontend/node_modules/@ngx-translate/core/README.md new file mode 100644 index 000000000..75b6aa083 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/README.md @@ -0,0 +1,552 @@ +# @ngx-translate/core [](https://travis-ci.org/ngx-translate/core) [](https://badge.fury.io/js/%40ngx-translate%2Fcore) + +The internationalization (i18n) library for Angular. + +Simple example using ngx-translate: https://stackblitz.com/github/ngx-translate/example + +Get the complete changelog here: https://github.com/ngx-translate/core/releases + +## Table of Contents +* [Installation](#installation) +* [Usage](#usage) + * [Import the TranslateModule](#1-import-the-translatemodule) + * [SharedModule](#sharedmodule) + * [Lazy loaded modules](#lazy-loaded-modules) + * [Configuration](#configuration) + * [AoT](#aot) + * [Define the default language for the application](#2-define-the-default-language-for-the-application) + * [Init the TranslateService for your application](#3-init-the-translateservice-for-your-application) + * [Define the translations](#4-define-the-translations) + * [Use the service, the pipe or the directive](#5-use-the-service-the-pipe-or-the-directive) + * [Use HTML tags](#6-use-html-tags) +* [API](#api) + * [TranslateService](#translateservice) + * [Properties](#properties) + * [Methods](#methods) + * [Write & use your own loader](#write--use-your-own-loader) + * [Example](#example) + * [How to use a compiler to preprocess translation values](#how-to-use-a-compiler-to-preprocess-translation-values) + * [How to handle missing translations](#how-to-handle-missing-translations) + * [Example](#example-1) + * [Parser](#parser) + * [Methods](#methods) +* [FAQ](#faq) + * [I'm getting an error `npm ERR! peerinvalid Peer [...]`](#im-getting-an-error-npm-err-peerinvalid-peer-) +* [Plugins](#plugins) +* [Editors](#editors) +* [Additional Framework Support](#additional-framework-support) + + +## Installation + +First you need to install the npm module: + +```sh +npm install @ngx-translate/core --save +``` + +Choose the version corresponding to your Angular version: + + Angular | @ngx-translate/core | @ngx-translate/http-loader + ----------- | ------------------- | -------------------------- + 10 | 13.x+ | 6.x+ + 9 | 12.x+ | 5.x+ + 8 | 12.x+ | 4.x+ + 7 | 11.x+ | 4.x+ + 6 | 10.x | 3.x + 5 | 8.x to 9.x | 1.x to 2.x + 4.3 | 7.x or less | 1.x to 2.x + 2 to 4.2.x | 7.x or less | 0.x + +--- + +**If you use SystemJS** to load your files, you can check the [plunkr example](https://plnkr.co/edit/XXwyUYS6ZL7qVD9I2l0g?p=preview) for a working setup that uses the cdn [https://unpkg.com/](https://unpkg.com/). +If you're importing directly from `node_modules`, you should edit your systemjs config file and add `'@ngx-translate/core': 'node_modules/@ngx-translate/core/bundles'` in the map and `'@ngx-translate/core' : { defaultExtension: 'js' }` in packages. + + +## Usage + +#### 1. Import the `TranslateModule`: + +Finally, you can use ngx-translate in your Angular project. You have to import `TranslateModule.forRoot()` in the root NgModule of your application. + +The [`forRoot`](https://angular.io/api/router/RouterModule#forroot) static method is a convention that provides and configures services at the same time. +Make sure you only call this method in the root module of your application, most of the time called `AppModule`. +This method allows you to configure the `TranslateModule` by specifying a loader, a parser and/or a missing translations handler. + +```ts +import {BrowserModule} from '@angular/platform-browser'; +import {NgModule} from '@angular/core'; +import {TranslateModule} from '@ngx-translate/core'; + +@NgModule({ + imports: [ + BrowserModule, + TranslateModule.forRoot() + ], + bootstrap: [AppComponent] +}) +export class AppModule { } +``` + +##### SharedModule + +If you use a [`SharedModule`](https://angular.io/guide/sharing-ngmodules) that you import in multiple other feature modules, +you can export the `TranslateModule` to make sure you don't have to import it in every module. + +```ts +@NgModule({ + exports: [ + CommonModule, + TranslateModule + ] +}) +export class SharedModule { } +``` + +> Note: Never call a `forRoot` static method in the `SharedModule`. You might end up with different instances of the service in your injector tree. But you can use `forChild` if necessary. + +##### Lazy loaded modules + +When you lazy load a module, you should use the `forChild` static method to import the `TranslateModule`. + +Since lazy loaded modules use a different injector from the rest of your application, you can configure them separately with a different loader/compiler/parser/missing translations handler. + +To make a child module extend translations from parent modules use `extend: true`. This will cause the service to also +use translations from its parent module. + +You can also isolate the service by using `isolate: true`. In which case the service is a completely isolated instance (for translations, current lang, events, ...). +Otherwise, by default, it will share its data with other instances of the service (but you can still use a different loader/compiler/parser/handler even if you don't isolate the service). + +```ts +@NgModule({ + imports: [ + TranslateModule.forChild({ + loader: {provide: TranslateLoader, useClass: CustomLoader}, + compiler: {provide: TranslateCompiler, useClass: CustomCompiler}, + parser: {provide: TranslateParser, useClass: CustomParser}, + missingTranslationHandler: {provide: MissingTranslationHandler, useClass: CustomHandler}, + isolate: true + }) + ] +}) +export class LazyLoadedModule { } +``` + +##### Configuration + +By default, there is no loader available. You can add translations manually using `setTranslation` but it is better to use a loader. +You can write your own loader, or import an existing one. +For example you can use the [`TranslateHttpLoader`](https://github.com/ngx-translate/http-loader) that will load translations from files using HttpClient. + +To use it, you need to install the http-loader package from @ngx-translate: + +```sh +npm install @ngx-translate/http-loader --save +``` + +**NB: if you're still on Angular <4.3, please use Http from @angular/http with http-loader@0.1.0.** + +Once you've decided which loader to use, you have to setup the `TranslateModule` to use it. + +Here is how you would use the `TranslateHttpLoader` to load translations from "/assets/i18n/[lang].json" (`[lang]` is the lang that you're using, for english it could be `en`): + +```ts +import {NgModule} from '@angular/core'; +import {BrowserModule} from '@angular/platform-browser'; +import {HttpClientModule, HttpClient} from '@angular/common/http'; +import {TranslateModule, TranslateLoader} from '@ngx-translate/core'; +import {TranslateHttpLoader} from '@ngx-translate/http-loader'; +import {AppComponent} from './app'; + +// AoT requires an exported function for factories +export function HttpLoaderFactory(http: HttpClient) { + return new TranslateHttpLoader(http); +} + +@NgModule({ + imports: [ + BrowserModule, + HttpClientModule, + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useFactory: HttpLoaderFactory, + deps: [HttpClient] + } + }) + ], + bootstrap: [AppComponent] +}) +export class AppModule { } +``` + +##### AoT + +If you want to configure a custom `TranslateLoader` while using [AoT compilation](https://angular.io/docs/ts/latest/cookbook/aot-compiler.html) or [Ionic](http://ionic.io/), you must use an exported function instead of an inline function. + +```ts +export function createTranslateLoader(http: HttpClient) { + return new TranslateHttpLoader(http, './assets/i18n/', '.json'); +} + +@NgModule({ + imports: [ + BrowserModule, + HttpClientModule, + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useFactory: (createTranslateLoader), + deps: [HttpClient] + } + }) + ], + bootstrap: [AppComponent] +}) +export class AppModule { } +``` + +#### 2. Define the `default language` for the application + +```ts +@NgModule({ + imports: [ + BrowserModule, + TranslateModule.forRoot({ + defaultLanguage: 'en' + }) + ], + providers: [ + + ], + bootstrap: [AppComponent] +}) +export class AppModule { } +``` + +#### 3. Init the `TranslateService` for your application: + +```ts +import {Component} from '@angular/core'; +import {TranslateService} from '@ngx-translate/core'; + +@Component({ + selector: 'app', + template: ` + <div>{{ 'HELLO' | translate:param }}</div> + ` +}) +export class AppComponent { + param = {value: 'world'}; + + constructor(translate: TranslateService) { + // this language will be used as a fallback when a translation isn't found in the current language + translate.setDefaultLang('en'); + + // the lang to use, if the lang isn't available, it will use the current loader to get them + translate.use('en'); + } +} +``` + +#### 4. Define the translations: + +Once you've imported the `TranslateModule`, you can put your translations in a json file that will be imported with the `TranslateHttpLoader`. The following translations should be stored in `en.json`. + +```json +{ + "HELLO": "hello {{value}}" +} +``` + +You can also define your translations manually with `setTranslation`. + +```ts +translate.setTranslation('en', { + HELLO: 'hello {{value}}' +}); +``` + +The `TranslateParser` understands nested JSON objects. This means that you can have a translation that looks like this: + +```json +{ + "HOME": { + "HELLO": "hello {{value}}" + } +} +``` + +You can then access the value by using the dot notation, in this case `HOME.HELLO`. + +#### 5. Use the service, the pipe or the directive: + +You can either use the `TranslateService`, the `TranslatePipe` or the `TranslateDirective` to get your translation values. + +With the **service**, it looks like this: + +```ts +translate.get('HELLO', {value: 'world'}).subscribe((res: string) => { + console.log(res); + //=> 'hello world' +}); +``` + +This is how you do it with the **pipe**: + +```html +<div>{{ 'HELLO' | translate:param }}</div> +``` + +And in your component define `param` like this: +```ts +param = {value: 'world'}; +``` + +You can construct the translation keys dynamically by using simple string concatenation inside the template: + +```html +<ul *ngFor="let language of languages"> + <li>{{ 'LANGUAGES.' + language | translate }}</li> +</ul> +``` + +Where `languages` is an array member of your component: + +```ts +languages = ['EN', 'FR', 'BG']; +``` + +You can also use the output of the built-in pipes `uppercase` and `lowercase` in order to guarantee that your dynamically generated translation keys are either all uppercase or all lowercase. For example: + +```html +<p>{{ 'ROLES.' + role | uppercase | translate }}</p> +``` + +```ts +role = 'admin'; +``` + +will match the following translation: +```json +{ + "ROLES": { + "ADMIN": "Administrator" + } +} +``` + +This is how you use the **directive**: +```html +<div [translate]="'HELLO'" [translateParams]="{value: 'world'}"></div> +``` + +Or even simpler using the content of your element as a key: +```html +<div translate [translateParams]="{value: 'world'}">HELLO</div> +``` + +#### 6. Use HTML tags: + +You can easily use raw HTML tags within your translations. + +```json +{ + "HELLO": "Welcome to my Angular application!<br><strong>This is an amazing app which uses the latest technologies!</strong>" +} +``` + +To render them, simply use the `innerHTML` attribute with the pipe on any element. + +```html +<div [innerHTML]="'HELLO' | translate"></div> +``` + +## API + +### TranslateService + +#### Properties: + +- `currentLang`: The lang currently used +- `currentLoader`: An instance of the loader currently used (static loader by default) +- `onLangChange`: An EventEmitter to listen to lang change events. A `LangChangeEvent` is an object with the properties `lang: string` & `translations: any` (an object containing your translations). + + example: + ```ts + onLangChange.subscribe((event: LangChangeEvent) => { + // do something + }); + ``` +- `onTranslationChange`: An EventEmitter to listen to translation change events. A `TranslationChangeEvent` is an object with the properties `lang: string` & `translations: any` (an object containing your translations). + + example: + ```ts + onTranslationChange.subscribe((event: TranslationChangeEvent) => { + // do something + }); + ``` +- `onDefaultLangChange`: An EventEmitter to listen to default lang change events. A `DefaultLangChangeEvent` is an object with the properties `lang: string` & `translations: any` (an object containing your translations). + + example: + ```ts + onDefaultLangChange.subscribe((event: DefaultLangChangeEvent) => { + // do something + }); + ``` + +#### Methods: + +- `setDefaultLang(lang: string)`: Sets the default language to use as a fallback +- `getDefaultLang(): string`: Gets the default language +- `use(lang: string): Observable<any>`: Changes the lang currently used +- `getTranslation(lang: string): Observable<any>`: Gets an object of translations for a given language with the current loader +- `setTranslation(lang: string, translations: Object, shouldMerge: boolean = false)`: Manually sets an object of translations for a given language, set `shouldMerge` to true if you want to append the translations instead of replacing them +- `addLangs(langs: Array<string>)`: Add new langs to the list +- `getLangs()`: Returns an array of currently available langs +- `get(key: string|Array<string>, interpolateParams?: Object): Observable<string|Object>`: Gets the translated value of a key (or an array of keys) or the key if the value was not found +- `getStreamOnTranslationChange(key: string|Array<string>, interpolateParams?: Object): Observable<string|Object>`: Returns a stream of translated values of a key (or an array of keys) or the key if the value was not found. Without any `onTranslationChange` events this returns the same value as `get` but it will also emit new values whenever the translation changes. +- `stream(key: string|Array<string>, interpolateParams?: Object): Observable<string|Object>`: Returns a stream of translated values of a key (or an array of keys) or the key if the value was not found. Without any `onLangChange` events this returns the same value as `get` but it will also emit new values whenever the used language changes. +- `instant(key: string|Array<string>, interpolateParams?: Object): string|Object`: Gets the instant translated value of a key (or an array of keys). /!\ This method is **synchronous** and the default file loader is asynchronous. You are responsible for knowing when your translations have been loaded and it is safe to use this method. If you are not sure then you should use the `get` method instead. +- `set(key: string, value: string, lang?: string)`: Sets the translated value of a key +- `reloadLang(lang: string): Observable<string|Object>`: Calls resetLang and retrieves the translations object for the current loader +- `resetLang(lang: string)`: Removes the current translations for this lang. /!\ You will have to call `use`, `reloadLang` or `getTranslation` again to be able to get translations +- `getBrowserLang(): string | undefined`: Returns the current browser lang if available, or undefined otherwise +- `getBrowserCultureLang(): string | undefined`: Returns the current browser culture language name (e.g. "de-DE" if available, or undefined otherwise + +#### Write & use your own loader + +If you want to write your own loader, you need to create a class that implements `TranslateLoader`. The only required method is `getTranslation` that must return an `Observable`. If your loader is synchronous, just use [`Observable.of`](https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/of.md) to create an observable from your static value. + +##### Example + +```ts +class CustomLoader implements TranslateLoader { + getTranslation(lang: string): Observable<any> { + return Observable.of({KEY: 'value'}); + } +} +``` + +Once you've defined your loader, you can provide it in your configuration by adding it to its `providers` property. + +```ts +@NgModule({ + imports: [ + BrowserModule, + TranslateModule.forRoot({ + loader: {provide: TranslateLoader, useClass: CustomLoader} + }) + ], + bootstrap: [AppComponent] +}) +export class AppModule { } +``` +[Another custom loader example with translations stored in Firebase](FIREBASE_EXAMPLE.md) + +#### How to use a compiler to preprocess translation values + +By default, translation values are added "as-is". You can configure a `compiler` that implements `TranslateCompiler` to pre-process translation values when they are added (either manually or by a loader). A compiler has the following methods: + +- `compile(value: string, lang: string): string | Function`: Compiles a string to a function or another string. +- `compileTranslations(translations: any, lang: string): any`: Compiles a (possibly nested) object of translation values to a structurally identical object of compiled translation values. + +Using a compiler opens the door for powerful pre-processing of translation values. As long as the compiler outputs a compatible interpolation string or an interpolation function, arbitrary input syntax can be supported. + + +#### How to handle missing translations + +You can setup a provider for the `MissingTranslationHandler` in the bootstrap of your application (recommended), or in the `providers` property of a component. It will be called when the requested translation is not available. The only required method is `handle` where you can do whatever you want. If this method returns a value or an observable (that should return a string), then this will be used. Just don't forget that it will be called synchronously from the `instant` method. + +You can use `useDefaultLang` to decide whether default language string should be used when there is a missing translation in current language. Default value is true. If you set it to false, `MissingTranslationHandler` will be used instead of the default language string. + +##### Example: + +Create a Missing Translation Handler + +```ts +import {MissingTranslationHandler, MissingTranslationHandlerParams} from '@ngx-translate/core'; + +export class MyMissingTranslationHandler implements MissingTranslationHandler { + handle(params: MissingTranslationHandlerParams) { + return 'some value'; + } +} +``` + +Setup the Missing Translation Handler in your module import by adding it to the `forRoot` (or `forChild`) configuration. + +```ts +@NgModule({ + imports: [ + BrowserModule, + TranslateModule.forRoot({ + missingTranslationHandler: {provide: MissingTranslationHandler, useClass: MyMissingTranslationHandler}, + useDefaultLang: false + }) + ], + providers: [ + + ], + bootstrap: [AppComponent] +}) +export class AppModule { } +``` + +### Parser + +If you need it for some reason, you can use the `TranslateParser` service. + +#### Methods: +- `interpolate(expr: string | Function, params?: any): string`: Interpolates a string to replace parameters or calls the interpolation function with the parameters. + + `This is a {{ key }}` ==> `This is a value` with `params = { key: "value" }` + `(params) => \`This is a ${params.key}\` ==> `This is a value` with `params = { key: "value" }` +- `getValue(target: any, key: string): any`: Gets a value from an object by composed key + `parser.getValue({ key1: { keyA: 'valueI' }}, 'key1.keyA') ==> 'valueI'` + +## FAQ + +#### I'm getting an error `npm ERR! peerinvalid Peer [...]` + +If you're using npm 2.x, upgrade to npm 3.x, because npm 2 doesn't handle peer dependencies well. With npm 2 you could only use fixed versions, but with npm 3 you can use `^` to use a newer version if available. + +If you're already on npm 3, check if it's an error (`npm ERR!`) or a warning (`npm WARN!`), warning are just informative and if everything works then don't worry ! + +If you're using an old version of Angular and ngx-translate requires a newer version then you should consider upgrading your application to use the newer angular 2 version. There is always a reason when I upgrade the minimum dependencies of the library. Often it is because Angular had a breaking changes. If it's not an option for you, then check [the changelog](/releases) to know which version is the last compatible version for you. + +#### I want to hot reload the translations in my application but `reloadLang` does not work + +If you want to reload the translations and see the update on all your components without reloading the page, you have to load the translations manually and call `setTranslation` function which triggers `onTranslationChange`. + +## Plugins +- [Localize Router](https://github.com/Greentube/localize-router) by @meeroslav: An implementation of routes localization for Angular. If you need localized urls (for example /fr/page and /en/page). +- [.po files Loader](https://github.com/biesbjerg/ngx-translate-po-http-loader) by @biesbjerg: Use .po translation files with ngx-translate +- [ngx-translate-extract](https://github.com/biesbjerg/ngx-translate-extract) by @biesbjerg: Extract translatable strings from your projects +- [MessageFormat Compiler](https://github.com/lephyrus/ngx-translate-messageformat-compiler) by @lephyrus: Compiler for ngx-translate that uses messageformat.js to compile translations using ICU syntax for handling pluralization, gender, and more +- [ngx-translate-zombies](https://marketplace.visualstudio.com/items?itemName=seveseves.ngx-translate-zombies) by @seveves: A vscode extension that finds unused translation keys and shows them in a diff view (so called zombies). +- [ngx-translate-multi-http-loader](https://github.com/denniske/ngx-translate-multi-http-loader) by @denniske: Fetch multiple translation files with ngx-translate. +- [ngx-translate-cache](https://github.com/jgpacheco/ngx-translate-cache) by @jgpacheco: Simplified version of localize-router. If you are already using localize-router you don't need this extension. This extension is aimed only to facilitate language caching. +- [ngx-translate-module-loader](https://github.com/larscom/ngx-translate-module-loader) by @larscom: Fetch multiple translation files (http) with ngx-translate. Each translation file gets it's own namespace out of the box and the configuration is very flexible. +- [ngx-translate-all](https://github.com/irustm/ngx-translate-all) by @irustm: Automate translations for Angular projects. +- [ngx-translate-migrate](https://github.com/irustm/ngx-translate-migrate) by @irustm: Automate migrations from ngx-translate to Angular i18n. +- [ngx-translate-lint](https://github.com/svoboda-rabstvo/ngx-translate-lint) by @svoboda-rabstvo: Simple CLI tools for check ngx-translate keys in whole app +- [ngx-translate-cut](https://github.com/bartholomej/ngx-translate-cut) by @bartholomej: Simple and useful pipe for cutting translations ✂️ + +## Editors +- [BabelEdit](https://www.codeandweb.com/babeledit) — translation editor for JSON files +- [Translation Manager](https://translation-manager-86c3d.firebaseapp.com/) — Progressive web-app, translation editor for JSON files +- [Crowdl.io](https://crowdl.io) — Free translation management and crowd-translations tool with support for JSON files + +### Extensions + +#### VScode +- [Generate Translation](https://marketplace.visualstudio.com/items?itemName=thiagocordeirooo.generate-translation) by [@thiagocordeirooo](https://github.com/thiagocordeirooo): A visual studio code extension for you to generate the translations without leaving the current file. +- [Lingua](https://marketplace.visualstudio.com/items?itemName=chr33z.lingua-vscode&utm_source=www.vsixhub.com) by [@chr33z](https://github.com/chr33z): A visual studio code extension to help managing translations for ngx-translate - featuring inline translation lookup and in-place translation creation and editing. + + + +## Additional Framework Support + +* [Use with NativeScript](https://github.com/NathanWalker/nativescript-ng2-translate/issues/5#issuecomment-257606661) diff --git a/frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.js b/frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.js new file mode 100644 index 000000000..796ccb047 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.js @@ -0,0 +1,2111 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators')) : + typeof define === 'function' && define.amd ? define('@ngx-translate/core', ['exports', '@angular/core', 'rxjs', 'rxjs/operators'], factory) : + (global = global || self, factory((global['ngx-translate'] = global['ngx-translate'] || {}, global['ngx-translate'].core = {}), global.ng.core, global.rxjs, global.rxjs.operators)); +}(this, (function (exports, core, rxjs, operators) { 'use strict'; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise */ + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; }; + return extendStatics(d, b); + }; + function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + function __rest(s, e) { + var t = {}; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + } + function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + r = Reflect.decorate(decorators, target, key, desc); + else + for (var i = decorators.length - 1; i >= 0; i--) + if (d = decorators[i]) + r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); }; + } + function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(metadataKey, metadataValue); + } + function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { + step(generator.next(value)); + } + catch (e) { + reject(e); + } } + function rejected(value) { try { + step(generator["throw"](value)); + } + catch (e) { + reject(e); + } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + } + function __generator(thisArg, body) { + var _ = { label: 0, sent: function () { if (t[0] & 1) + throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) + throw new TypeError("Generator is already executing."); + while (_) + try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) + return t; + if (y = 0, t) + op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) + _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } + catch (e) { + op = [6, e]; + y = 0; + } + finally { + f = t = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } + } + var __createBinding = Object.create ? (function (o, m, k, k2) { + if (k2 === undefined) + k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } }); + }) : (function (o, m, k, k2) { + if (k2 === undefined) + k2 = k; + o[k2] = m[k]; + }); + function __exportStar(m, exports) { + for (var p in m) + if (p !== "default" && !exports.hasOwnProperty(p)) + __createBinding(exports, m, p); + } + function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) + return m.call(o); + if (o && typeof o.length === "number") + return { + next: function () { + if (o && i >= o.length) + o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + } + function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) + return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) + ar.push(r.value); + } + catch (error) { + e = { error: error }; + } + finally { + try { + if (r && !r.done && (m = i["return"])) + m.call(i); + } + finally { + if (e) + throw e.error; + } + } + return ar; + } + function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + } + function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) + s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + } + ; + function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + } + function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) + i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { + step(g[n](v)); + } + catch (e) { + settle(q[0][3], e); + } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) + resume(q[0][0], q[0][1]); } + } + function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + } + function __asyncValues(o) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); } + } + function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } + else { + cooked.raw = raw; + } + return cooked; + } + ; + var __setModuleDefault = Object.create ? (function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function (o, v) { + o["default"] = v; + }; + function __importStar(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) + for (var k in mod) + if (Object.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + } + function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; + } + function __classPrivateFieldGet(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); + } + function __classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; + } + + /** + * @abstract + */ + var TranslateLoader = /** @class */ (function () { + function TranslateLoader() { + } + return TranslateLoader; + }()); + if (false) { + /** + * @abstract + * @param {?} lang + * @return {?} + */ + TranslateLoader.prototype.getTranslation = function (lang) { }; + } + /** + * This loader is just a placeholder that does nothing, in case you don't need a loader at all + */ + var TranslateFakeLoader = /** @class */ (function (_super) { + __extends(TranslateFakeLoader, _super); + function TranslateFakeLoader() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * @param {?} lang + * @return {?} + */ + TranslateFakeLoader.prototype.getTranslation = function (lang) { + return rxjs.of({}); + }; + return TranslateFakeLoader; + }(TranslateLoader)); + TranslateFakeLoader.decorators = [ + { type: core.Injectable } + ]; + + /** + * @fileoverview added by tsickle + * Generated from: lib/missing-translation-handler.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ + /** + * @record + */ + function MissingTranslationHandlerParams() { } + if (false) { + /** + * the key that's missing in translation files + * @type {?} + */ + MissingTranslationHandlerParams.prototype.key; + /** + * an instance of the service that was unable to translate the key. + * @type {?} + */ + MissingTranslationHandlerParams.prototype.translateService; + /** + * interpolation params that were passed along for translating the given key. + * @type {?|undefined} + */ + MissingTranslationHandlerParams.prototype.interpolateParams; + } + /** + * @abstract + */ + var MissingTranslationHandler = /** @class */ (function () { + function MissingTranslationHandler() { + } + return MissingTranslationHandler; + }()); + if (false) { + /** + * A function that handles missing translations. + * + * @abstract + * @param {?} params context for resolving a missing translation + * @return {?} a value or an observable + * If it returns a value, then this value is used. + * If it return an observable, the value returned by this observable will be used (except if the method was "instant"). + * If it doesn't return then the key will be used as a value + */ + MissingTranslationHandler.prototype.handle = function (params) { }; + } + /** + * This handler is just a placeholder that does nothing, in case you don't need a missing translation handler at all + */ + var FakeMissingTranslationHandler = /** @class */ (function () { + function FakeMissingTranslationHandler() { + } + /** + * @param {?} params + * @return {?} + */ + FakeMissingTranslationHandler.prototype.handle = function (params) { + return params.key; + }; + return FakeMissingTranslationHandler; + }()); + FakeMissingTranslationHandler.decorators = [ + { type: core.Injectable } + ]; + + /** + * @fileoverview added by tsickle + * Generated from: lib/util.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ + /* tslint:disable */ + /** + * Determines if two objects or two values are equivalent. + * + * Two objects or values are considered equivalent if at least one of the following is true: + * + * * Both objects or values pass `===` comparison. + * * Both objects or values are of the same type and all of their properties are equal by + * comparing them with `equals`. + * + * @param {?} o1 Object or value to compare. + * @param {?} o2 Object or value to compare. + * @return {?} true if arguments are equal. + */ + function equals(o1, o2) { + if (o1 === o2) + return true; + if (o1 === null || o2 === null) + return false; + if (o1 !== o1 && o2 !== o2) + return true; // NaN === NaN + // NaN === NaN + /** @type {?} */ + var t1 = typeof o1; + /** @type {?} */ + var t2 = typeof o2; + /** @type {?} */ + var length; + /** @type {?} */ + var key; + /** @type {?} */ + var keySet; + if (t1 == t2 && t1 == 'object') { + if (Array.isArray(o1)) { + if (!Array.isArray(o2)) + return false; + if ((length = o1.length) == o2.length) { + for (key = 0; key < length; key++) { + if (!equals(o1[key], o2[key])) + return false; + } + return true; + } + } + else { + if (Array.isArray(o2)) { + return false; + } + keySet = Object.create(null); + for (key in o1) { + if (!equals(o1[key], o2[key])) { + return false; + } + keySet[key] = true; + } + for (key in o2) { + if (!(key in keySet) && typeof o2[key] !== 'undefined') { + return false; + } + } + return true; + } + } + return false; + } + /* tslint:enable */ + /** + * @param {?} value + * @return {?} + */ + function isDefined(value) { + return typeof value !== 'undefined' && value !== null; + } + /** + * @param {?} item + * @return {?} + */ + function isObject(item) { + return (item && typeof item === 'object' && !Array.isArray(item)); + } + /** + * @param {?} target + * @param {?} source + * @return {?} + */ + function mergeDeep(target, source) { + /** @type {?} */ + var output = Object.assign({}, target); + if (isObject(target) && isObject(source)) { + Object.keys(source).forEach(( /** + * @param {?} key + * @return {?} + */function (key) { + var _a, _b; + if (isObject(source[key])) { + if (!(key in target)) { + Object.assign(output, (_a = {}, _a[key] = source[key], _a)); + } + else { + output[key] = mergeDeep(target[key], source[key]); + } + } + else { + Object.assign(output, (_b = {}, _b[key] = source[key], _b)); + } + })); + } + return output; + } + + /** + * @abstract + */ + var TranslateParser = /** @class */ (function () { + function TranslateParser() { + } + return TranslateParser; + }()); + if (false) { + /** + * Interpolates a string to replace parameters + * "This is a {{ key }}" ==> "This is a value", with params = { key: "value" } + * @abstract + * @param {?} expr + * @param {?=} params + * @return {?} + */ + TranslateParser.prototype.interpolate = function (expr, params) { }; + /** + * Gets a value from an object by composed key + * parser.getValue({ key1: { keyA: 'valueI' }}, 'key1.keyA') ==> 'valueI' + * @abstract + * @param {?} target + * @param {?} key + * @return {?} + */ + TranslateParser.prototype.getValue = function (target, key) { }; + } + var TranslateDefaultParser = /** @class */ (function (_super) { + __extends(TranslateDefaultParser, _super); + function TranslateDefaultParser() { + var _this = _super.apply(this, __spread(arguments)) || this; + _this.templateMatcher = /{{\s?([^{}\s]*)\s?}}/g; + return _this; + } + /** + * @param {?} expr + * @param {?=} params + * @return {?} + */ + TranslateDefaultParser.prototype.interpolate = function (expr, params) { + /** @type {?} */ + var result; + if (typeof expr === 'string') { + result = this.interpolateString(expr, params); + } + else if (typeof expr === 'function') { + result = this.interpolateFunction(expr, params); + } + else { + // this should not happen, but an unrelated TranslateService test depends on it + result = ( /** @type {?} */(expr)); + } + return result; + }; + /** + * @param {?} target + * @param {?} key + * @return {?} + */ + TranslateDefaultParser.prototype.getValue = function (target, key) { + /** @type {?} */ + var keys = typeof key === 'string' ? key.split('.') : [key]; + key = ''; + do { + key += keys.shift(); + if (isDefined(target) && isDefined(target[key]) && (typeof target[key] === 'object' || !keys.length)) { + target = target[key]; + key = ''; + } + else if (!keys.length) { + target = undefined; + } + else { + key += '.'; + } + } while (keys.length); + return target; + }; + /** + * @private + * @param {?} fn + * @param {?=} params + * @return {?} + */ + TranslateDefaultParser.prototype.interpolateFunction = function (fn, params) { + return fn(params); + }; + /** + * @private + * @param {?} expr + * @param {?=} params + * @return {?} + */ + TranslateDefaultParser.prototype.interpolateString = function (expr, params) { + var _this = this; + if (!params) { + return expr; + } + return expr.replace(this.templateMatcher, ( /** + * @param {?} substring + * @param {?} b + * @return {?} + */function (substring, b) { + /** @type {?} */ + var r = _this.getValue(params, b); + return isDefined(r) ? r : substring; + })); + }; + return TranslateDefaultParser; + }(TranslateParser)); + TranslateDefaultParser.decorators = [ + { type: core.Injectable } + ]; + if (false) { + /** @type {?} */ + TranslateDefaultParser.prototype.templateMatcher; + } + + /** + * @abstract + */ + var TranslateCompiler = /** @class */ (function () { + function TranslateCompiler() { + } + return TranslateCompiler; + }()); + if (false) { + /** + * @abstract + * @param {?} value + * @param {?} lang + * @return {?} + */ + TranslateCompiler.prototype.compile = function (value, lang) { }; + /** + * @abstract + * @param {?} translations + * @param {?} lang + * @return {?} + */ + TranslateCompiler.prototype.compileTranslations = function (translations, lang) { }; + } + /** + * This compiler is just a placeholder that does nothing, in case you don't need a compiler at all + */ + var TranslateFakeCompiler = /** @class */ (function (_super) { + __extends(TranslateFakeCompiler, _super); + function TranslateFakeCompiler() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * @param {?} value + * @param {?} lang + * @return {?} + */ + TranslateFakeCompiler.prototype.compile = function (value, lang) { + return value; + }; + /** + * @param {?} translations + * @param {?} lang + * @return {?} + */ + TranslateFakeCompiler.prototype.compileTranslations = function (translations, lang) { + return translations; + }; + return TranslateFakeCompiler; + }(TranslateCompiler)); + TranslateFakeCompiler.decorators = [ + { type: core.Injectable } + ]; + + /** + * @fileoverview added by tsickle + * Generated from: lib/translate.store.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ + var TranslateStore = /** @class */ (function () { + function TranslateStore() { + /** + * The lang currently used + */ + this.currentLang = this.defaultLang; + /** + * a list of translations per lang + */ + this.translations = {}; + /** + * an array of langs + */ + this.langs = []; + /** + * An EventEmitter to listen to translation change events + * onTranslationChange.subscribe((params: TranslationChangeEvent) => { + * // do something + * }); + */ + this.onTranslationChange = new core.EventEmitter(); + /** + * An EventEmitter to listen to lang change events + * onLangChange.subscribe((params: LangChangeEvent) => { + * // do something + * }); + */ + this.onLangChange = new core.EventEmitter(); + /** + * An EventEmitter to listen to default lang change events + * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => { + * // do something + * }); + */ + this.onDefaultLangChange = new core.EventEmitter(); + } + return TranslateStore; + }()); + if (false) { + /** + * The default lang to fallback when translations are missing on the current lang + * @type {?} + */ + TranslateStore.prototype.defaultLang; + /** + * The lang currently used + * @type {?} + */ + TranslateStore.prototype.currentLang; + /** + * a list of translations per lang + * @type {?} + */ + TranslateStore.prototype.translations; + /** + * an array of langs + * @type {?} + */ + TranslateStore.prototype.langs; + /** + * An EventEmitter to listen to translation change events + * onTranslationChange.subscribe((params: TranslationChangeEvent) => { + * // do something + * }); + * @type {?} + */ + TranslateStore.prototype.onTranslationChange; + /** + * An EventEmitter to listen to lang change events + * onLangChange.subscribe((params: LangChangeEvent) => { + * // do something + * }); + * @type {?} + */ + TranslateStore.prototype.onLangChange; + /** + * An EventEmitter to listen to default lang change events + * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => { + * // do something + * }); + * @type {?} + */ + TranslateStore.prototype.onDefaultLangChange; + } + + /** @type {?} */ + var USE_STORE = new core.InjectionToken('USE_STORE'); + /** @type {?} */ + var USE_DEFAULT_LANG = new core.InjectionToken('USE_DEFAULT_LANG'); + /** @type {?} */ + var DEFAULT_LANGUAGE = new core.InjectionToken('DEFAULT_LANGUAGE'); + /** @type {?} */ + var USE_EXTEND = new core.InjectionToken('USE_EXTEND'); + /** + * @record + */ + function TranslationChangeEvent() { } + if (false) { + /** @type {?} */ + TranslationChangeEvent.prototype.translations; + /** @type {?} */ + TranslationChangeEvent.prototype.lang; + } + /** + * @record + */ + function LangChangeEvent() { } + if (false) { + /** @type {?} */ + LangChangeEvent.prototype.lang; + /** @type {?} */ + LangChangeEvent.prototype.translations; + } + /** + * @record + */ + function DefaultLangChangeEvent() { } + if (false) { + /** @type {?} */ + DefaultLangChangeEvent.prototype.lang; + /** @type {?} */ + DefaultLangChangeEvent.prototype.translations; + } + var TranslateService = /** @class */ (function () { + /** + * + * @param {?} store an instance of the store (that is supposed to be unique) + * @param {?} currentLoader An instance of the loader currently used + * @param {?} compiler An instance of the compiler currently used + * @param {?} parser An instance of the parser currently used + * @param {?} missingTranslationHandler A handler for missing translations. + * @param {?=} useDefaultLang whether we should use default language translation when current language translation is missing. + * @param {?=} isolate whether this service should use the store or not + * @param {?=} extend To make a child module extend (and use) translations from parent modules. + * @param {?=} defaultLanguage Set the default language using configuration + */ + function TranslateService(store, currentLoader, compiler, parser, missingTranslationHandler, useDefaultLang, isolate, extend, defaultLanguage) { + if (useDefaultLang === void 0) { useDefaultLang = true; } + if (isolate === void 0) { isolate = false; } + if (extend === void 0) { extend = false; } + this.store = store; + this.currentLoader = currentLoader; + this.compiler = compiler; + this.parser = parser; + this.missingTranslationHandler = missingTranslationHandler; + this.useDefaultLang = useDefaultLang; + this.isolate = isolate; + this.extend = extend; + this.pending = false; + this._onTranslationChange = new core.EventEmitter(); + this._onLangChange = new core.EventEmitter(); + this._onDefaultLangChange = new core.EventEmitter(); + this._langs = []; + this._translations = {}; + this._translationRequests = {}; + /** set the default language from configuration */ + if (defaultLanguage) { + this.setDefaultLang(defaultLanguage); + } + } + Object.defineProperty(TranslateService.prototype, "onTranslationChange", { + /** + * An EventEmitter to listen to translation change events + * onTranslationChange.subscribe((params: TranslationChangeEvent) => { + * // do something + * }); + * @return {?} + */ + get: function () { + return this.isolate ? this._onTranslationChange : this.store.onTranslationChange; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(TranslateService.prototype, "onLangChange", { + /** + * An EventEmitter to listen to lang change events + * onLangChange.subscribe((params: LangChangeEvent) => { + * // do something + * }); + * @return {?} + */ + get: function () { + return this.isolate ? this._onLangChange : this.store.onLangChange; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(TranslateService.prototype, "onDefaultLangChange", { + /** + * An EventEmitter to listen to default lang change events + * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => { + * // do something + * }); + * @return {?} + */ + get: function () { + return this.isolate ? this._onDefaultLangChange : this.store.onDefaultLangChange; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(TranslateService.prototype, "defaultLang", { + /** + * The default lang to fallback when translations are missing on the current lang + * @return {?} + */ + get: function () { + return this.isolate ? this._defaultLang : this.store.defaultLang; + }, + /** + * @param {?} defaultLang + * @return {?} + */ + set: function (defaultLang) { + if (this.isolate) { + this._defaultLang = defaultLang; + } + else { + this.store.defaultLang = defaultLang; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(TranslateService.prototype, "currentLang", { + /** + * The lang currently used + * @return {?} + */ + get: function () { + return this.isolate ? this._currentLang : this.store.currentLang; + }, + /** + * @param {?} currentLang + * @return {?} + */ + set: function (currentLang) { + if (this.isolate) { + this._currentLang = currentLang; + } + else { + this.store.currentLang = currentLang; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(TranslateService.prototype, "langs", { + /** + * an array of langs + * @return {?} + */ + get: function () { + return this.isolate ? this._langs : this.store.langs; + }, + /** + * @param {?} langs + * @return {?} + */ + set: function (langs) { + if (this.isolate) { + this._langs = langs; + } + else { + this.store.langs = langs; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(TranslateService.prototype, "translations", { + /** + * a list of translations per lang + * @return {?} + */ + get: function () { + return this.isolate ? this._translations : this.store.translations; + }, + /** + * @param {?} translations + * @return {?} + */ + set: function (translations) { + if (this.isolate) { + this._translations = translations; + } + else { + this.store.translations = translations; + } + }, + enumerable: false, + configurable: true + }); + /** + * Sets the default language to use as a fallback + * @param {?} lang + * @return {?} + */ + TranslateService.prototype.setDefaultLang = function (lang) { + var _this = this; + if (lang === this.defaultLang) { + return; + } + /** @type {?} */ + var pending = this.retrieveTranslations(lang); + if (typeof pending !== "undefined") { + // on init set the defaultLang immediately + if (this.defaultLang == null) { + this.defaultLang = lang; + } + pending.pipe(operators.take(1)) + .subscribe(( /** + * @param {?} res + * @return {?} + */function (res) { + _this.changeDefaultLang(lang); + })); + } + else { // we already have this language + this.changeDefaultLang(lang); + } + }; + /** + * Gets the default language used + * @return {?} + */ + TranslateService.prototype.getDefaultLang = function () { + return this.defaultLang; + }; + /** + * Changes the lang currently used + * @param {?} lang + * @return {?} + */ + TranslateService.prototype.use = function (lang) { + var _this = this; + // don't change the language if the language given is already selected + if (lang === this.currentLang) { + return rxjs.of(this.translations[lang]); + } + /** @type {?} */ + var pending = this.retrieveTranslations(lang); + if (typeof pending !== "undefined") { + // on init set the currentLang immediately + if (!this.currentLang) { + this.currentLang = lang; + } + pending.pipe(operators.take(1)) + .subscribe(( /** + * @param {?} res + * @return {?} + */function (res) { + _this.changeLang(lang); + })); + return pending; + } + else { // we have this language, return an Observable + this.changeLang(lang); + return rxjs.of(this.translations[lang]); + } + }; + /** + * Retrieves the given translations + * @private + * @param {?} lang + * @return {?} + */ + TranslateService.prototype.retrieveTranslations = function (lang) { + /** @type {?} */ + var pending; + // if this language is unavailable or extend is true, ask for it + if (typeof this.translations[lang] === "undefined" || this.extend) { + this._translationRequests[lang] = this._translationRequests[lang] || this.getTranslation(lang); + pending = this._translationRequests[lang]; + } + return pending; + }; + /** + * Gets an object of translations for a given language with the current loader + * and passes it through the compiler + * @param {?} lang + * @return {?} + */ + TranslateService.prototype.getTranslation = function (lang) { + var _this = this; + this.pending = true; + /** @type {?} */ + var loadingTranslations = this.currentLoader.getTranslation(lang).pipe(operators.shareReplay(1), operators.take(1)); + this.loadingTranslations = loadingTranslations.pipe(operators.map(( /** + * @param {?} res + * @return {?} + */function (res) { return _this.compiler.compileTranslations(res, lang); })), operators.shareReplay(1), operators.take(1)); + this.loadingTranslations + .subscribe({ + next: ( /** + * @param {?} res + * @return {?} + */function (res) { + _this.translations[lang] = _this.extend && _this.translations[lang] ? Object.assign(Object.assign({}, res), _this.translations[lang]) : res; + _this.updateLangs(); + _this.pending = false; + }), + error: ( /** + * @param {?} err + * @return {?} + */function (err) { + _this.pending = false; + }) + }); + return loadingTranslations; + }; + /** + * Manually sets an object of translations for a given language + * after passing it through the compiler + * @param {?} lang + * @param {?} translations + * @param {?=} shouldMerge + * @return {?} + */ + TranslateService.prototype.setTranslation = function (lang, translations, shouldMerge) { + if (shouldMerge === void 0) { shouldMerge = false; } + translations = this.compiler.compileTranslations(translations, lang); + if ((shouldMerge || this.extend) && this.translations[lang]) { + this.translations[lang] = mergeDeep(this.translations[lang], translations); + } + else { + this.translations[lang] = translations; + } + this.updateLangs(); + this.onTranslationChange.emit({ lang: lang, translations: this.translations[lang] }); + }; + /** + * Returns an array of currently available langs + * @return {?} + */ + TranslateService.prototype.getLangs = function () { + return this.langs; + }; + /** + * Add available langs + * @param {?} langs + * @return {?} + */ + TranslateService.prototype.addLangs = function (langs) { + var _this = this; + langs.forEach(( /** + * @param {?} lang + * @return {?} + */function (lang) { + if (_this.langs.indexOf(lang) === -1) { + _this.langs.push(lang); + } + })); + }; + /** + * Update the list of available langs + * @private + * @return {?} + */ + TranslateService.prototype.updateLangs = function () { + this.addLangs(Object.keys(this.translations)); + }; + /** + * Returns the parsed result of the translations + * @param {?} translations + * @param {?} key + * @param {?=} interpolateParams + * @return {?} + */ + TranslateService.prototype.getParsedResult = function (translations, key, interpolateParams) { + var e_1, _a; + /** @type {?} */ + var res; + if (key instanceof Array) { + /** @type {?} */ + var result_1 = {}; + /** @type {?} */ + var observables = false; + try { + for (var key_1 = __values(key), key_1_1 = key_1.next(); !key_1_1.done; key_1_1 = key_1.next()) { + var k = key_1_1.value; + result_1[k] = this.getParsedResult(translations, k, interpolateParams); + if (rxjs.isObservable(result_1[k])) { + observables = true; + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (key_1_1 && !key_1_1.done && (_a = key_1.return)) _a.call(key_1); + } + finally { if (e_1) throw e_1.error; } + } + if (observables) { + /** @type {?} */ + var sources = key.map(( /** + * @param {?} k + * @return {?} + */function (/** + * @param {?} k + * @return {?} + */ k) { return rxjs.isObservable(result_1[k]) ? result_1[k] : rxjs.of(( /** @type {?} */(result_1[k]))); })); + return rxjs.forkJoin(sources).pipe(operators.map(( /** + * @param {?} arr + * @return {?} + */function (arr) { + /** @type {?} */ + var obj = {}; + arr.forEach(( /** + * @param {?} value + * @param {?} index + * @return {?} + */function (value, index) { + obj[key[index]] = value; + })); + return obj; + }))); + } + return result_1; + } + if (translations) { + res = this.parser.interpolate(this.parser.getValue(translations, key), interpolateParams); + } + if (typeof res === "undefined" && this.defaultLang != null && this.defaultLang !== this.currentLang && this.useDefaultLang) { + res = this.parser.interpolate(this.parser.getValue(this.translations[this.defaultLang], key), interpolateParams); + } + if (typeof res === "undefined") { + /** @type {?} */ + var params = { key: key, translateService: this }; + if (typeof interpolateParams !== 'undefined') { + params.interpolateParams = interpolateParams; + } + res = this.missingTranslationHandler.handle(params); + } + return typeof res !== "undefined" ? res : key; + }; + /** + * Gets the translated value of a key (or an array of keys) + * @param {?} key + * @param {?=} interpolateParams + * @return {?} the translated key, or an object of translated keys + */ + TranslateService.prototype.get = function (key, interpolateParams) { + var _this = this; + if (!isDefined(key) || !key.length) { + throw new Error("Parameter \"key\" required"); + } + // check if we are loading a new translation to use + if (this.pending) { + return this.loadingTranslations.pipe(operators.concatMap(( /** + * @param {?} res + * @return {?} + */function (res) { + res = _this.getParsedResult(res, key, interpolateParams); + return rxjs.isObservable(res) ? res : rxjs.of(res); + }))); + } + else { + /** @type {?} */ + var res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams); + return rxjs.isObservable(res) ? res : rxjs.of(res); + } + }; + /** + * Returns a stream of translated values of a key (or an array of keys) which updates + * whenever the translation changes. + * @param {?} key + * @param {?=} interpolateParams + * @return {?} A stream of the translated key, or an object of translated keys + */ + TranslateService.prototype.getStreamOnTranslationChange = function (key, interpolateParams) { + var _this = this; + if (!isDefined(key) || !key.length) { + throw new Error("Parameter \"key\" required"); + } + return rxjs.concat(rxjs.defer(( /** + * @return {?} + */function () { return _this.get(key, interpolateParams); })), this.onTranslationChange.pipe(operators.switchMap(( /** + * @param {?} event + * @return {?} + */function (event) { + /** @type {?} */ + var res = _this.getParsedResult(event.translations, key, interpolateParams); + if (typeof res.subscribe === 'function') { + return res; + } + else { + return rxjs.of(res); + } + })))); + }; + /** + * Returns a stream of translated values of a key (or an array of keys) which updates + * whenever the language changes. + * @param {?} key + * @param {?=} interpolateParams + * @return {?} A stream of the translated key, or an object of translated keys + */ + TranslateService.prototype.stream = function (key, interpolateParams) { + var _this = this; + if (!isDefined(key) || !key.length) { + throw new Error("Parameter \"key\" required"); + } + return rxjs.concat(rxjs.defer(( /** + * @return {?} + */function () { return _this.get(key, interpolateParams); })), this.onLangChange.pipe(operators.switchMap(( /** + * @param {?} event + * @return {?} + */function (event) { + /** @type {?} */ + var res = _this.getParsedResult(event.translations, key, interpolateParams); + return rxjs.isObservable(res) ? res : rxjs.of(res); + })))); + }; + /** + * Returns a translation instantly from the internal state of loaded translation. + * All rules regarding the current language, the preferred language of even fallback languages will be used except any promise handling. + * @param {?} key + * @param {?=} interpolateParams + * @return {?} + */ + TranslateService.prototype.instant = function (key, interpolateParams) { + if (!isDefined(key) || !key.length) { + throw new Error("Parameter \"key\" required"); + } + /** @type {?} */ + var res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams); + if (rxjs.isObservable(res)) { + if (key instanceof Array) { + /** @type {?} */ + var obj_1 = {}; + key.forEach(( /** + * @param {?} value + * @param {?} index + * @return {?} + */function (value, index) { + obj_1[key[index]] = key[index]; + })); + return obj_1; + } + return key; + } + else { + return res; + } + }; + /** + * Sets the translated value of a key, after compiling it + * @param {?} key + * @param {?} value + * @param {?=} lang + * @return {?} + */ + TranslateService.prototype.set = function (key, value, lang) { + if (lang === void 0) { lang = this.currentLang; } + this.translations[lang][key] = this.compiler.compile(value, lang); + this.updateLangs(); + this.onTranslationChange.emit({ lang: lang, translations: this.translations[lang] }); + }; + /** + * Changes the current lang + * @private + * @param {?} lang + * @return {?} + */ + TranslateService.prototype.changeLang = function (lang) { + this.currentLang = lang; + this.onLangChange.emit({ lang: lang, translations: this.translations[lang] }); + // if there is no default lang, use the one that we just set + if (this.defaultLang == null) { + this.changeDefaultLang(lang); + } + }; + /** + * Changes the default lang + * @private + * @param {?} lang + * @return {?} + */ + TranslateService.prototype.changeDefaultLang = function (lang) { + this.defaultLang = lang; + this.onDefaultLangChange.emit({ lang: lang, translations: this.translations[lang] }); + }; + /** + * Allows to reload the lang file from the file + * @param {?} lang + * @return {?} + */ + TranslateService.prototype.reloadLang = function (lang) { + this.resetLang(lang); + return this.getTranslation(lang); + }; + /** + * Deletes inner translation + * @param {?} lang + * @return {?} + */ + TranslateService.prototype.resetLang = function (lang) { + this._translationRequests[lang] = undefined; + this.translations[lang] = undefined; + }; + /** + * Returns the language code name from the browser, e.g. "de" + * @return {?} + */ + TranslateService.prototype.getBrowserLang = function () { + if (typeof window === 'undefined' || typeof window.navigator === 'undefined') { + return undefined; + } + /** @type {?} */ + var browserLang = window.navigator.languages ? window.navigator.languages[0] : null; + browserLang = browserLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage; + if (typeof browserLang === 'undefined') { + return undefined; + } + if (browserLang.indexOf('-') !== -1) { + browserLang = browserLang.split('-')[0]; + } + if (browserLang.indexOf('_') !== -1) { + browserLang = browserLang.split('_')[0]; + } + return browserLang; + }; + /** + * Returns the culture language code name from the browser, e.g. "de-DE" + * @return {?} + */ + TranslateService.prototype.getBrowserCultureLang = function () { + if (typeof window === 'undefined' || typeof window.navigator === 'undefined') { + return undefined; + } + /** @type {?} */ + var browserCultureLang = window.navigator.languages ? window.navigator.languages[0] : null; + browserCultureLang = browserCultureLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage; + return browserCultureLang; + }; + return TranslateService; + }()); + TranslateService.decorators = [ + { type: core.Injectable } + ]; + /** @nocollapse */ + TranslateService.ctorParameters = function () { return [ + { type: TranslateStore }, + { type: TranslateLoader }, + { type: TranslateCompiler }, + { type: TranslateParser }, + { type: MissingTranslationHandler }, + { type: Boolean, decorators: [{ type: core.Inject, args: [USE_DEFAULT_LANG,] }] }, + { type: Boolean, decorators: [{ type: core.Inject, args: [USE_STORE,] }] }, + { type: Boolean, decorators: [{ type: core.Inject, args: [USE_EXTEND,] }] }, + { type: String, decorators: [{ type: core.Inject, args: [DEFAULT_LANGUAGE,] }] } + ]; }; + if (false) { + /** + * @type {?} + * @private + */ + TranslateService.prototype.loadingTranslations; + /** + * @type {?} + * @private + */ + TranslateService.prototype.pending; + /** + * @type {?} + * @private + */ + TranslateService.prototype._onTranslationChange; + /** + * @type {?} + * @private + */ + TranslateService.prototype._onLangChange; + /** + * @type {?} + * @private + */ + TranslateService.prototype._onDefaultLangChange; + /** + * @type {?} + * @private + */ + TranslateService.prototype._defaultLang; + /** + * @type {?} + * @private + */ + TranslateService.prototype._currentLang; + /** + * @type {?} + * @private + */ + TranslateService.prototype._langs; + /** + * @type {?} + * @private + */ + TranslateService.prototype._translations; + /** + * @type {?} + * @private + */ + TranslateService.prototype._translationRequests; + /** @type {?} */ + TranslateService.prototype.store; + /** @type {?} */ + TranslateService.prototype.currentLoader; + /** @type {?} */ + TranslateService.prototype.compiler; + /** @type {?} */ + TranslateService.prototype.parser; + /** @type {?} */ + TranslateService.prototype.missingTranslationHandler; + /** + * @type {?} + * @private + */ + TranslateService.prototype.useDefaultLang; + /** + * @type {?} + * @private + */ + TranslateService.prototype.isolate; + /** + * @type {?} + * @private + */ + TranslateService.prototype.extend; + } + + /** + * @fileoverview added by tsickle + * Generated from: lib/translate.directive.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ + var TranslateDirective = /** @class */ (function () { + /** + * @param {?} translateService + * @param {?} element + * @param {?} _ref + */ + function TranslateDirective(translateService, element, _ref) { + var _this = this; + this.translateService = translateService; + this.element = element; + this._ref = _ref; + // subscribe to onTranslationChange event, in case the translations of the current lang change + if (!this.onTranslationChangeSub) { + this.onTranslationChangeSub = this.translateService.onTranslationChange.subscribe(( /** + * @param {?} event + * @return {?} + */function (event) { + if (event.lang === _this.translateService.currentLang) { + _this.checkNodes(true, event.translations); + } + })); + } + // subscribe to onLangChange event, in case the language changes + if (!this.onLangChangeSub) { + this.onLangChangeSub = this.translateService.onLangChange.subscribe(( /** + * @param {?} event + * @return {?} + */function (event) { + _this.checkNodes(true, event.translations); + })); + } + // subscribe to onDefaultLangChange event, in case the default language changes + if (!this.onDefaultLangChangeSub) { + this.onDefaultLangChangeSub = this.translateService.onDefaultLangChange.subscribe(( /** + * @param {?} event + * @return {?} + */function (event) { + _this.checkNodes(true); + })); + } + } + Object.defineProperty(TranslateDirective.prototype, "translate", { + /** + * @param {?} key + * @return {?} + */ + set: function (key) { + if (key) { + this.key = key; + this.checkNodes(); + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(TranslateDirective.prototype, "translateParams", { + /** + * @param {?} params + * @return {?} + */ + set: function (params) { + if (!equals(this.currentParams, params)) { + this.currentParams = params; + this.checkNodes(true); + } + }, + enumerable: false, + configurable: true + }); + /** + * @return {?} + */ + TranslateDirective.prototype.ngAfterViewChecked = function () { + this.checkNodes(); + }; + /** + * @param {?=} forceUpdate + * @param {?=} translations + * @return {?} + */ + TranslateDirective.prototype.checkNodes = function (forceUpdate, translations) { + if (forceUpdate === void 0) { forceUpdate = false; } + /** @type {?} */ + var nodes = this.element.nativeElement.childNodes; + // if the element is empty + if (!nodes.length) { + // we add the key as content + this.setContent(this.element.nativeElement, this.key); + nodes = this.element.nativeElement.childNodes; + } + for (var i = 0; i < nodes.length; ++i) { + /** @type {?} */ + var node = nodes[i]; + if (node.nodeType === 3) { // node type 3 is a text node + // node type 3 is a text node + /** @type {?} */ + var key = void 0; + if (forceUpdate) { + node.lastKey = null; + } + if (isDefined(node.lookupKey)) { + key = node.lookupKey; + } + else if (this.key) { + key = this.key; + } + else { + /** @type {?} */ + var content = this.getContent(node); + /** @type {?} */ + var trimmedContent = content.trim(); + if (trimmedContent.length) { + node.lookupKey = trimmedContent; + // we want to use the content as a key, not the translation value + if (content !== node.currentValue) { + key = trimmedContent; + // the content was changed from the user, we'll use it as a reference if needed + node.originalContent = content || node.originalContent; + } + else if (node.originalContent) { // the content seems ok, but the lang has changed + // the current content is the translation, not the key, use the last real content as key + key = node.originalContent.trim(); + } + else if (content !== node.currentValue) { + // we want to use the content as a key, not the translation value + key = trimmedContent; + // the content was changed from the user, we'll use it as a reference if needed + node.originalContent = content || node.originalContent; + } + } + } + this.updateValue(key, node, translations); + } + } + }; + /** + * @param {?} key + * @param {?} node + * @param {?} translations + * @return {?} + */ + TranslateDirective.prototype.updateValue = function (key, node, translations) { + var _this = this; + if (key) { + if (node.lastKey === key && this.lastParams === this.currentParams) { + return; + } + this.lastParams = this.currentParams; + /** @type {?} */ + var onTranslation = ( /** + * @param {?} res + * @return {?} + */function (res) { + if (res !== key) { + node.lastKey = key; + } + if (!node.originalContent) { + node.originalContent = _this.getContent(node); + } + node.currentValue = isDefined(res) ? res : (node.originalContent || key); + // we replace in the original content to preserve spaces that we might have trimmed + _this.setContent(node, _this.key ? node.currentValue : node.originalContent.replace(key, node.currentValue)); + _this._ref.markForCheck(); + }); + if (isDefined(translations)) { + /** @type {?} */ + var res = this.translateService.getParsedResult(translations, key, this.currentParams); + if (rxjs.isObservable(res)) { + res.subscribe(onTranslation); + } + else { + onTranslation(res); + } + } + else { + this.translateService.get(key, this.currentParams).subscribe(onTranslation); + } + } + }; + /** + * @param {?} node + * @return {?} + */ + TranslateDirective.prototype.getContent = function (node) { + return isDefined(node.textContent) ? node.textContent : node.data; + }; + /** + * @param {?} node + * @param {?} content + * @return {?} + */ + TranslateDirective.prototype.setContent = function (node, content) { + if (isDefined(node.textContent)) { + node.textContent = content; + } + else { + node.data = content; + } + }; + /** + * @return {?} + */ + TranslateDirective.prototype.ngOnDestroy = function () { + if (this.onLangChangeSub) { + this.onLangChangeSub.unsubscribe(); + } + if (this.onDefaultLangChangeSub) { + this.onDefaultLangChangeSub.unsubscribe(); + } + if (this.onTranslationChangeSub) { + this.onTranslationChangeSub.unsubscribe(); + } + }; + return TranslateDirective; + }()); + TranslateDirective.decorators = [ + { type: core.Directive, args: [{ + selector: '[translate],[ngx-translate]' + },] } + ]; + /** @nocollapse */ + TranslateDirective.ctorParameters = function () { return [ + { type: TranslateService }, + { type: core.ElementRef }, + { type: core.ChangeDetectorRef } + ]; }; + TranslateDirective.propDecorators = { + translate: [{ type: core.Input }], + translateParams: [{ type: core.Input }] + }; + if (false) { + /** @type {?} */ + TranslateDirective.prototype.key; + /** @type {?} */ + TranslateDirective.prototype.lastParams; + /** @type {?} */ + TranslateDirective.prototype.currentParams; + /** @type {?} */ + TranslateDirective.prototype.onLangChangeSub; + /** @type {?} */ + TranslateDirective.prototype.onDefaultLangChangeSub; + /** @type {?} */ + TranslateDirective.prototype.onTranslationChangeSub; + /** + * @type {?} + * @private + */ + TranslateDirective.prototype.translateService; + /** + * @type {?} + * @private + */ + TranslateDirective.prototype.element; + /** + * @type {?} + * @private + */ + TranslateDirective.prototype._ref; + } + + /** + * @fileoverview added by tsickle + * Generated from: lib/translate.pipe.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ + var TranslatePipe = /** @class */ (function () { + /** + * @param {?} translate + * @param {?} _ref + */ + function TranslatePipe(translate, _ref) { + this.translate = translate; + this._ref = _ref; + this.value = ''; + } + /** + * @param {?} key + * @param {?=} interpolateParams + * @param {?=} translations + * @return {?} + */ + TranslatePipe.prototype.updateValue = function (key, interpolateParams, translations) { + var _this = this; + /** @type {?} */ + var onTranslation = ( /** + * @param {?} res + * @return {?} + */function (res) { + _this.value = res !== undefined ? res : key; + _this.lastKey = key; + _this._ref.markForCheck(); + }); + if (translations) { + /** @type {?} */ + var res = this.translate.getParsedResult(translations, key, interpolateParams); + if (rxjs.isObservable(res.subscribe)) { + res.subscribe(onTranslation); + } + else { + onTranslation(res); + } + } + this.translate.get(key, interpolateParams).subscribe(onTranslation); + }; + /** + * @param {?} query + * @param {...?} args + * @return {?} + */ + TranslatePipe.prototype.transform = function (query) { + var _this = this; + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + if (!query || !query.length) { + return query; + } + // if we ask another time for the same key, return the last value + if (equals(query, this.lastKey) && equals(args, this.lastParams)) { + return this.value; + } + /** @type {?} */ + var interpolateParams; + if (isDefined(args[0]) && args.length) { + if (typeof args[0] === 'string' && args[0].length) { + // we accept objects written in the template such as {n:1}, {'n':1}, {n:'v'} + // which is why we might need to change it to real JSON objects such as {"n":1} or {"n":"v"} + /** @type {?} */ + var validArgs = args[0] + .replace(/(\')?([a-zA-Z0-9_]+)(\')?(\s)?:/g, '"$2":') + .replace(/:(\s)?(\')(.*?)(\')/g, ':"$3"'); + try { + interpolateParams = JSON.parse(validArgs); + } + catch (e) { + throw new SyntaxError("Wrong parameter in TranslatePipe. Expected a valid Object, received: " + args[0]); + } + } + else if (typeof args[0] === 'object' && !Array.isArray(args[0])) { + interpolateParams = args[0]; + } + } + // store the query, in case it changes + this.lastKey = query; + // store the params, in case they change + this.lastParams = args; + // set the value + this.updateValue(query, interpolateParams); + // if there is a subscription to onLangChange, clean it + this._dispose(); + // subscribe to onTranslationChange event, in case the translations change + if (!this.onTranslationChange) { + this.onTranslationChange = this.translate.onTranslationChange.subscribe(( /** + * @param {?} event + * @return {?} + */function (event) { + if (_this.lastKey && event.lang === _this.translate.currentLang) { + _this.lastKey = null; + _this.updateValue(query, interpolateParams, event.translations); + } + })); + } + // subscribe to onLangChange event, in case the language changes + if (!this.onLangChange) { + this.onLangChange = this.translate.onLangChange.subscribe(( /** + * @param {?} event + * @return {?} + */function (event) { + if (_this.lastKey) { + _this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated + _this.updateValue(query, interpolateParams, event.translations); + } + })); + } + // subscribe to onDefaultLangChange event, in case the default language changes + if (!this.onDefaultLangChange) { + this.onDefaultLangChange = this.translate.onDefaultLangChange.subscribe(( /** + * @return {?} + */function () { + if (_this.lastKey) { + _this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated + _this.updateValue(query, interpolateParams); + } + })); + } + return this.value; + }; + /** + * Clean any existing subscription to change events + * @private + * @return {?} + */ + TranslatePipe.prototype._dispose = function () { + if (typeof this.onTranslationChange !== 'undefined') { + this.onTranslationChange.unsubscribe(); + this.onTranslationChange = undefined; + } + if (typeof this.onLangChange !== 'undefined') { + this.onLangChange.unsubscribe(); + this.onLangChange = undefined; + } + if (typeof this.onDefaultLangChange !== 'undefined') { + this.onDefaultLangChange.unsubscribe(); + this.onDefaultLangChange = undefined; + } + }; + /** + * @return {?} + */ + TranslatePipe.prototype.ngOnDestroy = function () { + this._dispose(); + }; + return TranslatePipe; + }()); + TranslatePipe.decorators = [ + { type: core.Injectable }, + { type: core.Pipe, args: [{ + name: 'translate', + pure: false // required to update the value when the promise is resolved + },] } + ]; + /** @nocollapse */ + TranslatePipe.ctorParameters = function () { return [ + { type: TranslateService }, + { type: core.ChangeDetectorRef } + ]; }; + if (false) { + /** @type {?} */ + TranslatePipe.prototype.value; + /** @type {?} */ + TranslatePipe.prototype.lastKey; + /** @type {?} */ + TranslatePipe.prototype.lastParams; + /** @type {?} */ + TranslatePipe.prototype.onTranslationChange; + /** @type {?} */ + TranslatePipe.prototype.onLangChange; + /** @type {?} */ + TranslatePipe.prototype.onDefaultLangChange; + /** + * @type {?} + * @private + */ + TranslatePipe.prototype.translate; + /** + * @type {?} + * @private + */ + TranslatePipe.prototype._ref; + } + + /** + * @fileoverview added by tsickle + * Generated from: public_api.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ + /** + * @record + */ + function TranslateModuleConfig() { } + if (false) { + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.loader; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.compiler; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.parser; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.missingTranslationHandler; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.isolate; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.extend; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.useDefaultLang; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.defaultLanguage; + } + var TranslateModule = /** @class */ (function () { + function TranslateModule() { + } + /** + * Use this method in your root module to provide the TranslateService + * @param {?=} config + * @return {?} + */ + TranslateModule.forRoot = function (config) { + if (config === void 0) { config = {}; } + return { + ngModule: TranslateModule, + providers: [ + config.loader || { provide: TranslateLoader, useClass: TranslateFakeLoader }, + config.compiler || { provide: TranslateCompiler, useClass: TranslateFakeCompiler }, + config.parser || { provide: TranslateParser, useClass: TranslateDefaultParser }, + config.missingTranslationHandler || { provide: MissingTranslationHandler, useClass: FakeMissingTranslationHandler }, + TranslateStore, + { provide: USE_STORE, useValue: config.isolate }, + { provide: USE_DEFAULT_LANG, useValue: config.useDefaultLang }, + { provide: USE_EXTEND, useValue: config.extend }, + { provide: DEFAULT_LANGUAGE, useValue: config.defaultLanguage }, + TranslateService + ] + }; + }; + /** + * Use this method in your other (non root) modules to import the directive/pipe + * @param {?=} config + * @return {?} + */ + TranslateModule.forChild = function (config) { + if (config === void 0) { config = {}; } + return { + ngModule: TranslateModule, + providers: [ + config.loader || { provide: TranslateLoader, useClass: TranslateFakeLoader }, + config.compiler || { provide: TranslateCompiler, useClass: TranslateFakeCompiler }, + config.parser || { provide: TranslateParser, useClass: TranslateDefaultParser }, + config.missingTranslationHandler || { provide: MissingTranslationHandler, useClass: FakeMissingTranslationHandler }, + { provide: USE_STORE, useValue: config.isolate }, + { provide: USE_DEFAULT_LANG, useValue: config.useDefaultLang }, + { provide: USE_EXTEND, useValue: config.extend }, + { provide: DEFAULT_LANGUAGE, useValue: config.defaultLanguage }, + TranslateService + ] + }; + }; + return TranslateModule; + }()); + TranslateModule.decorators = [ + { type: core.NgModule, args: [{ + declarations: [ + TranslatePipe, + TranslateDirective + ], + exports: [ + TranslatePipe, + TranslateDirective + ] + },] } + ]; + + /** + * @fileoverview added by tsickle + * Generated from: ngx-translate-core.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ + + exports.DEFAULT_LANGUAGE = DEFAULT_LANGUAGE; + exports.FakeMissingTranslationHandler = FakeMissingTranslationHandler; + exports.MissingTranslationHandler = MissingTranslationHandler; + exports.TranslateCompiler = TranslateCompiler; + exports.TranslateDefaultParser = TranslateDefaultParser; + exports.TranslateDirective = TranslateDirective; + exports.TranslateFakeCompiler = TranslateFakeCompiler; + exports.TranslateFakeLoader = TranslateFakeLoader; + exports.TranslateLoader = TranslateLoader; + exports.TranslateModule = TranslateModule; + exports.TranslateParser = TranslateParser; + exports.TranslatePipe = TranslatePipe; + exports.TranslateService = TranslateService; + exports.TranslateStore = TranslateStore; + exports.USE_DEFAULT_LANG = USE_DEFAULT_LANG; + exports.USE_EXTEND = USE_EXTEND; + exports.USE_STORE = USE_STORE; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=ngx-translate-core.umd.js.map diff --git a/frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.js.map b/frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.js.map new file mode 100644 index 000000000..b406ff1f8 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ngx-translate-core.umd.js","sources":["../../../../node_modules/tslib/tslib.es6.js","../../../../projects/ngx-translate/core/src/lib/translate.loader.ts","../../../../projects/ngx-translate/core/src/lib/missing-translation-handler.ts","../../../../projects/ngx-translate/core/src/lib/util.ts","../../../../projects/ngx-translate/core/src/lib/translate.parser.ts","../../../../projects/ngx-translate/core/src/lib/translate.compiler.ts","../../../../projects/ngx-translate/core/src/lib/translate.store.ts","../../../../projects/ngx-translate/core/src/lib/translate.service.ts","../../../../projects/ngx-translate/core/src/lib/translate.directive.ts","../../../../projects/ngx-translate/core/src/lib/translate.pipe.ts","../../../../projects/ngx-translate/core/src/public_api.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import {Injectable} from \"@angular/core\";\nimport {Observable, of} from \"rxjs\";\n\nexport abstract class TranslateLoader {\n abstract getTranslation(lang: string): Observable<any>;\n}\n\n/**\n * This loader is just a placeholder that does nothing, in case you don't need a loader at all\n */\n@Injectable()\nexport class TranslateFakeLoader extends TranslateLoader {\n getTranslation(lang: string): Observable<any> {\n return of({});\n }\n}\n","import {Injectable} from \"@angular/core\";\nimport {TranslateService} from \"./translate.service\";\n\nexport interface MissingTranslationHandlerParams {\n /**\n * the key that's missing in translation files\n */\n key: string;\n\n /**\n * an instance of the service that was unable to translate the key.\n */\n translateService: TranslateService;\n\n /**\n * interpolation params that were passed along for translating the given key.\n */\n interpolateParams?: Object;\n}\n\nexport abstract class MissingTranslationHandler {\n /**\n * A function that handles missing translations.\n *\n * @param params context for resolving a missing translation\n * @returns a value or an observable\n * If it returns a value, then this value is used.\n * If it return an observable, the value returned by this observable will be used (except if the method was \"instant\").\n * If it doesn't return then the key will be used as a value\n */\n abstract handle(params: MissingTranslationHandlerParams): any;\n}\n\n/**\n * This handler is just a placeholder that does nothing, in case you don't need a missing translation handler at all\n */\n@Injectable()\nexport class FakeMissingTranslationHandler implements MissingTranslationHandler {\n handle(params: MissingTranslationHandlerParams): string {\n return params.key;\n }\n}\n","/* tslint:disable */\n/**\n * Determines if two objects or two values are equivalent.\n *\n * Two objects or values are considered equivalent if at least one of the following is true:\n *\n * * Both objects or values pass `===` comparison.\n * * Both objects or values are of the same type and all of their properties are equal by\n * comparing them with `equals`.\n *\n * @param o1 Object or value to compare.\n * @param o2 Object or value to compare.\n * @returns true if arguments are equal.\n */\nexport function equals(o1: any, o2: any): boolean {\n if (o1 === o2) return true;\n if (o1 === null || o2 === null) return false;\n if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\n let t1 = typeof o1, t2 = typeof o2, length: number, key: any, keySet: any;\n if (t1 == t2 && t1 == 'object') {\n if (Array.isArray(o1)) {\n if (!Array.isArray(o2)) return false;\n if ((length = o1.length) == o2.length) {\n for (key = 0; key < length; key++) {\n if (!equals(o1[key], o2[key])) return false;\n }\n return true;\n }\n } else {\n if (Array.isArray(o2)) {\n return false;\n }\n keySet = Object.create(null);\n for (key in o1) {\n if (!equals(o1[key], o2[key])) {\n return false;\n }\n keySet[key] = true;\n }\n for (key in o2) {\n if (!(key in keySet) && typeof o2[key] !== 'undefined') {\n return false;\n }\n }\n return true;\n }\n }\n return false;\n}\n/* tslint:enable */\n\nexport function isDefined(value: any): boolean {\n return typeof value !== 'undefined' && value !== null;\n}\n\nexport function isObject(item: any): boolean {\n return (item && typeof item === 'object' && !Array.isArray(item));\n}\n\nexport function mergeDeep(target: any, source: any): any {\n let output = Object.assign({}, target);\n if (isObject(target) && isObject(source)) {\n Object.keys(source).forEach((key: any) => {\n if (isObject(source[key])) {\n if (!(key in target)) {\n Object.assign(output, {[key]: source[key]});\n } else {\n output[key] = mergeDeep(target[key], source[key]);\n }\n } else {\n Object.assign(output, {[key]: source[key]});\n }\n });\n }\n return output;\n}\n","import {Injectable} from \"@angular/core\";\nimport {isDefined} from \"./util\";\n\nexport abstract class TranslateParser {\n /**\n * Interpolates a string to replace parameters\n * \"This is a {{ key }}\" ==> \"This is a value\", with params = { key: \"value\" }\n * @param expr\n * @param params\n */\n abstract interpolate(expr: string | Function, params?: any): string;\n\n /**\n * Gets a value from an object by composed key\n * parser.getValue({ key1: { keyA: 'valueI' }}, 'key1.keyA') ==> 'valueI'\n * @param target\n * @param key\n */\n abstract getValue(target: any, key: string): any\n}\n\n@Injectable()\nexport class TranslateDefaultParser extends TranslateParser {\n templateMatcher: RegExp = /{{\\s?([^{}\\s]*)\\s?}}/g;\n\n public interpolate(expr: string | Function, params?: any): string {\n let result: string;\n\n if (typeof expr === 'string') {\n result = this.interpolateString(expr, params);\n } else if (typeof expr === 'function') {\n result = this.interpolateFunction(expr, params);\n } else {\n // this should not happen, but an unrelated TranslateService test depends on it\n result = expr as string;\n }\n\n return result;\n }\n\n getValue(target: any, key: string): any {\n let keys = typeof key === 'string' ? key.split('.') : [key];\n key = '';\n do {\n key += keys.shift();\n if (isDefined(target) && isDefined(target[key]) && (typeof target[key] === 'object' || !keys.length)) {\n target = target[key];\n key = '';\n } else if (!keys.length) {\n target = undefined;\n } else {\n key += '.';\n }\n } while (keys.length);\n\n return target;\n }\n\n private interpolateFunction(fn: Function, params?: any) {\n return fn(params);\n }\n\n private interpolateString(expr: string, params?: any) {\n if (!params) {\n return expr;\n }\n\n return expr.replace(this.templateMatcher, (substring: string, b: string) => {\n let r = this.getValue(params, b);\n return isDefined(r) ? r : substring;\n });\n }\n}\n","import {Injectable} from \"@angular/core\";\n\nexport abstract class TranslateCompiler {\n abstract compile(value: string, lang: string): string | Function;\n\n abstract compileTranslations(translations: any, lang: string): any;\n}\n\n/**\n * This compiler is just a placeholder that does nothing, in case you don't need a compiler at all\n */\n@Injectable()\nexport class TranslateFakeCompiler extends TranslateCompiler {\n compile(value: string, lang: string): string | Function {\n return value;\n }\n\n compileTranslations(translations: any, lang: string): any {\n return translations;\n }\n}\n","import {EventEmitter} from \"@angular/core\";\nimport {DefaultLangChangeEvent, LangChangeEvent, TranslationChangeEvent} from \"./translate.service\";\n\nexport class TranslateStore {\n /**\n * The default lang to fallback when translations are missing on the current lang\n */\n public defaultLang: string;\n\n /**\n * The lang currently used\n */\n public currentLang: string = this.defaultLang;\n\n /**\n * a list of translations per lang\n */\n public translations: any = {};\n\n /**\n * an array of langs\n */\n public langs: Array<string> = [];\n\n /**\n * An EventEmitter to listen to translation change events\n * onTranslationChange.subscribe((params: TranslationChangeEvent) => {\n * // do something\n * });\n */\n public onTranslationChange: EventEmitter<TranslationChangeEvent> = new EventEmitter<TranslationChangeEvent>();\n\n /**\n * An EventEmitter to listen to lang change events\n * onLangChange.subscribe((params: LangChangeEvent) => {\n * // do something\n * });\n */\n public onLangChange: EventEmitter<LangChangeEvent> = new EventEmitter<LangChangeEvent>();\n\n /**\n * An EventEmitter to listen to default lang change events\n * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => {\n * // do something\n * });\n */\n public onDefaultLangChange: EventEmitter<DefaultLangChangeEvent> = new EventEmitter<DefaultLangChangeEvent>();\n}\n","import {EventEmitter, Inject, Injectable, InjectionToken} from \"@angular/core\";\nimport {concat, forkJoin, isObservable, Observable, of, defer} from \"rxjs\";\nimport {concatMap, map, shareReplay, switchMap, take} from \"rxjs/operators\";\nimport {MissingTranslationHandler, MissingTranslationHandlerParams} from \"./missing-translation-handler\";\nimport {TranslateCompiler} from \"./translate.compiler\";\nimport {TranslateLoader} from \"./translate.loader\";\nimport {TranslateParser} from \"./translate.parser\";\n\nimport {TranslateStore} from \"./translate.store\";\nimport {isDefined, mergeDeep} from \"./util\";\n\nexport const USE_STORE = new InjectionToken<string>('USE_STORE');\nexport const USE_DEFAULT_LANG = new InjectionToken<string>('USE_DEFAULT_LANG');\nexport const DEFAULT_LANGUAGE = new InjectionToken<string>('DEFAULT_LANGUAGE');\nexport const USE_EXTEND = new InjectionToken<string>('USE_EXTEND');\n\nexport interface TranslationChangeEvent {\n translations: any;\n lang: string;\n}\n\nexport interface LangChangeEvent {\n lang: string;\n translations: any;\n}\n\nexport interface DefaultLangChangeEvent {\n lang: string;\n translations: any;\n}\n\ndeclare interface Window {\n navigator: any;\n}\n\ndeclare const window: Window;\n\n@Injectable()\nexport class TranslateService {\n private loadingTranslations: Observable<any>;\n private pending: boolean = false;\n private _onTranslationChange: EventEmitter<TranslationChangeEvent> = new EventEmitter<TranslationChangeEvent>();\n private _onLangChange: EventEmitter<LangChangeEvent> = new EventEmitter<LangChangeEvent>();\n private _onDefaultLangChange: EventEmitter<DefaultLangChangeEvent> = new EventEmitter<DefaultLangChangeEvent>();\n private _defaultLang: string;\n private _currentLang: string;\n private _langs: Array<string> = [];\n private _translations: any = {};\n private _translationRequests: any = {};\n\n /**\n * An EventEmitter to listen to translation change events\n * onTranslationChange.subscribe((params: TranslationChangeEvent) => {\n * // do something\n * });\n */\n get onTranslationChange(): EventEmitter<TranslationChangeEvent> {\n return this.isolate ? this._onTranslationChange : this.store.onTranslationChange;\n }\n\n /**\n * An EventEmitter to listen to lang change events\n * onLangChange.subscribe((params: LangChangeEvent) => {\n * // do something\n * });\n */\n get onLangChange(): EventEmitter<LangChangeEvent> {\n return this.isolate ? this._onLangChange : this.store.onLangChange;\n }\n\n /**\n * An EventEmitter to listen to default lang change events\n * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => {\n * // do something\n * });\n */\n get onDefaultLangChange() {\n return this.isolate ? this._onDefaultLangChange : this.store.onDefaultLangChange;\n }\n\n /**\n * The default lang to fallback when translations are missing on the current lang\n */\n get defaultLang(): string {\n return this.isolate ? this._defaultLang : this.store.defaultLang;\n }\n\n set defaultLang(defaultLang: string) {\n if (this.isolate) {\n this._defaultLang = defaultLang;\n } else {\n this.store.defaultLang = defaultLang;\n }\n }\n\n /**\n * The lang currently used\n */\n get currentLang(): string {\n return this.isolate ? this._currentLang : this.store.currentLang;\n }\n\n set currentLang(currentLang: string) {\n if (this.isolate) {\n this._currentLang = currentLang;\n } else {\n this.store.currentLang = currentLang;\n }\n }\n\n /**\n * an array of langs\n */\n get langs(): string[] {\n return this.isolate ? this._langs : this.store.langs;\n }\n\n set langs(langs: string[]) {\n if (this.isolate) {\n this._langs = langs;\n } else {\n this.store.langs = langs;\n }\n }\n\n /**\n * a list of translations per lang\n */\n get translations(): any {\n return this.isolate ? this._translations : this.store.translations;\n }\n\n set translations(translations: any) {\n if (this.isolate) {\n this._translations = translations;\n } else {\n this.store.translations = translations;\n }\n }\n\n /**\n *\n * @param store an instance of the store (that is supposed to be unique)\n * @param currentLoader An instance of the loader currently used\n * @param compiler An instance of the compiler currently used\n * @param parser An instance of the parser currently used\n * @param missingTranslationHandler A handler for missing translations.\n * @param useDefaultLang whether we should use default language translation when current language translation is missing.\n * @param isolate whether this service should use the store or not\n * @param extend To make a child module extend (and use) translations from parent modules.\n * @param defaultLanguage Set the default language using configuration\n */\n constructor(public store: TranslateStore,\n public currentLoader: TranslateLoader,\n public compiler: TranslateCompiler,\n public parser: TranslateParser,\n public missingTranslationHandler: MissingTranslationHandler,\n @Inject(USE_DEFAULT_LANG) private useDefaultLang: boolean = true,\n @Inject(USE_STORE) private isolate: boolean = false,\n @Inject(USE_EXTEND) private extend: boolean = false,\n @Inject(DEFAULT_LANGUAGE) defaultLanguage: string) {\n /** set the default language from configuration */\n if (defaultLanguage) {\n this.setDefaultLang(defaultLanguage);\n }\n }\n\n /**\n * Sets the default language to use as a fallback\n */\n public setDefaultLang(lang: string): void {\n if (lang === this.defaultLang) {\n return;\n }\n\n let pending: Observable<any> = this.retrieveTranslations(lang);\n\n if (typeof pending !== \"undefined\") {\n // on init set the defaultLang immediately\n if (this.defaultLang == null) {\n this.defaultLang = lang;\n }\n\n pending.pipe(take(1))\n .subscribe((res: any) => {\n this.changeDefaultLang(lang);\n });\n } else { // we already have this language\n this.changeDefaultLang(lang);\n }\n }\n\n /**\n * Gets the default language used\n */\n public getDefaultLang(): string {\n return this.defaultLang;\n }\n\n /**\n * Changes the lang currently used\n */\n public use(lang: string): Observable<any> {\n // don't change the language if the language given is already selected\n if (lang === this.currentLang) {\n return of(this.translations[lang]);\n }\n\n let pending: Observable<any> = this.retrieveTranslations(lang);\n\n if (typeof pending !== \"undefined\") {\n // on init set the currentLang immediately\n if (!this.currentLang) {\n this.currentLang = lang;\n }\n\n pending.pipe(take(1))\n .subscribe((res: any) => {\n this.changeLang(lang);\n });\n\n return pending;\n } else { // we have this language, return an Observable\n this.changeLang(lang);\n\n return of(this.translations[lang]);\n }\n }\n\n /**\n * Retrieves the given translations\n */\n private retrieveTranslations(lang: string): Observable<any> {\n let pending: Observable<any>;\n\n // if this language is unavailable or extend is true, ask for it\n if (typeof this.translations[lang] === \"undefined\" || this.extend) {\n this._translationRequests[lang] = this._translationRequests[lang] || this.getTranslation(lang);\n pending = this._translationRequests[lang];\n }\n\n return pending;\n }\n\n /**\n * Gets an object of translations for a given language with the current loader\n * and passes it through the compiler\n */\n public getTranslation(lang: string): Observable<any> {\n this.pending = true;\n const loadingTranslations = this.currentLoader.getTranslation(lang).pipe(\n shareReplay(1),\n take(1),\n );\n\n this.loadingTranslations = loadingTranslations.pipe(\n map((res: Object) => this.compiler.compileTranslations(res, lang)),\n shareReplay(1),\n take(1),\n );\n\n this.loadingTranslations\n .subscribe({\n next: (res: Object) => {\n this.translations[lang] = this.extend && this.translations[lang] ? { ...res, ...this.translations[lang] } : res;\n this.updateLangs();\n this.pending = false;\n },\n error: (err: any) => {\n this.pending = false;\n }\n });\n\n return loadingTranslations;\n }\n\n /**\n * Manually sets an object of translations for a given language\n * after passing it through the compiler\n */\n public setTranslation(lang: string, translations: Object, shouldMerge: boolean = false): void {\n translations = this.compiler.compileTranslations(translations, lang);\n if ((shouldMerge || this.extend) && this.translations[lang]) {\n this.translations[lang] = mergeDeep(this.translations[lang], translations);\n } else {\n this.translations[lang] = translations;\n }\n this.updateLangs();\n this.onTranslationChange.emit({lang: lang, translations: this.translations[lang]});\n }\n\n /**\n * Returns an array of currently available langs\n */\n public getLangs(): Array<string> {\n return this.langs;\n }\n\n /**\n * Add available langs\n */\n public addLangs(langs: Array<string>): void {\n langs.forEach((lang: string) => {\n if (this.langs.indexOf(lang) === -1) {\n this.langs.push(lang);\n }\n });\n }\n\n /**\n * Update the list of available langs\n */\n private updateLangs(): void {\n this.addLangs(Object.keys(this.translations));\n }\n\n /**\n * Returns the parsed result of the translations\n */\n public getParsedResult(translations: any, key: any, interpolateParams?: Object): any {\n let res: string | Observable<string>;\n\n if (key instanceof Array) {\n let result: any = {},\n observables: boolean = false;\n for (let k of key) {\n result[k] = this.getParsedResult(translations, k, interpolateParams);\n if (isObservable(result[k])) {\n observables = true;\n }\n }\n if (observables) {\n const sources = key.map(k => isObservable(result[k]) ? result[k] : of(result[k] as string));\n return forkJoin(sources).pipe(\n map((arr: Array<string>) => {\n let obj: any = {};\n arr.forEach((value: string, index: number) => {\n obj[key[index]] = value;\n });\n return obj;\n })\n );\n }\n return result;\n }\n\n if (translations) {\n res = this.parser.interpolate(this.parser.getValue(translations, key), interpolateParams);\n }\n\n if (typeof res === \"undefined\" && this.defaultLang != null && this.defaultLang !== this.currentLang && this.useDefaultLang) {\n res = this.parser.interpolate(this.parser.getValue(this.translations[this.defaultLang], key), interpolateParams);\n }\n\n if (typeof res === \"undefined\") {\n let params: MissingTranslationHandlerParams = {key, translateService: this};\n if (typeof interpolateParams !== 'undefined') {\n params.interpolateParams = interpolateParams;\n }\n res = this.missingTranslationHandler.handle(params);\n }\n\n return typeof res !== \"undefined\" ? res : key;\n }\n\n /**\n * Gets the translated value of a key (or an array of keys)\n * @returns the translated key, or an object of translated keys\n */\n public get(key: string | Array<string>, interpolateParams?: Object): Observable<string | any> {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n // check if we are loading a new translation to use\n if (this.pending) {\n return this.loadingTranslations.pipe(\n concatMap((res: any) => {\n res = this.getParsedResult(res, key, interpolateParams);\n return isObservable(res) ? res : of(res);\n }),\n );\n } else {\n let res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams);\n return isObservable(res) ? res : of(res);\n }\n }\n\n /**\n * Returns a stream of translated values of a key (or an array of keys) which updates\n * whenever the translation changes.\n * @returns A stream of the translated key, or an object of translated keys\n */\n public getStreamOnTranslationChange(key: string | Array<string>, interpolateParams?: Object): Observable<string | any> {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n\n return concat(\n defer(() => this.get(key, interpolateParams)),\n this.onTranslationChange.pipe(\n switchMap((event: TranslationChangeEvent) => {\n const res = this.getParsedResult(event.translations, key, interpolateParams);\n if (typeof res.subscribe === 'function') {\n return res;\n } else {\n return of(res);\n }\n })\n )\n );\n }\n\n /**\n * Returns a stream of translated values of a key (or an array of keys) which updates\n * whenever the language changes.\n * @returns A stream of the translated key, or an object of translated keys\n */\n public stream(key: string | Array<string>, interpolateParams?: Object): Observable<string | any> {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n\n return concat(\n defer(() => this.get(key, interpolateParams)),\n this.onLangChange.pipe(\n switchMap((event: LangChangeEvent) => {\n const res = this.getParsedResult(event.translations, key, interpolateParams);\n return isObservable(res) ? res : of(res);\n })\n ));\n }\n\n /**\n * Returns a translation instantly from the internal state of loaded translation.\n * All rules regarding the current language, the preferred language of even fallback languages will be used except any promise handling.\n */\n public instant(key: string | Array<string>, interpolateParams?: Object): string | any {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n\n let res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams);\n if (isObservable(res)) {\n if (key instanceof Array) {\n let obj: any = {};\n key.forEach((value: string, index: number) => {\n obj[key[index]] = key[index];\n });\n return obj;\n }\n return key;\n } else {\n return res;\n }\n }\n\n /**\n * Sets the translated value of a key, after compiling it\n */\n public set(key: string, value: string, lang: string = this.currentLang): void {\n this.translations[lang][key] = this.compiler.compile(value, lang);\n this.updateLangs();\n this.onTranslationChange.emit({lang: lang, translations: this.translations[lang]});\n }\n\n /**\n * Changes the current lang\n */\n private changeLang(lang: string): void {\n this.currentLang = lang;\n this.onLangChange.emit({lang: lang, translations: this.translations[lang]});\n\n // if there is no default lang, use the one that we just set\n if (this.defaultLang == null) {\n this.changeDefaultLang(lang);\n }\n }\n\n /**\n * Changes the default lang\n */\n private changeDefaultLang(lang: string): void {\n this.defaultLang = lang;\n this.onDefaultLangChange.emit({lang: lang, translations: this.translations[lang]});\n }\n\n /**\n * Allows to reload the lang file from the file\n */\n public reloadLang(lang: string): Observable<any> {\n this.resetLang(lang);\n return this.getTranslation(lang);\n }\n\n /**\n * Deletes inner translation\n */\n public resetLang(lang: string): void {\n this._translationRequests[lang] = undefined;\n this.translations[lang] = undefined;\n }\n\n /**\n * Returns the language code name from the browser, e.g. \"de\"\n */\n public getBrowserLang(): string {\n if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {\n return undefined;\n }\n\n let browserLang: any = window.navigator.languages ? window.navigator.languages[0] : null;\n browserLang = browserLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage;\n\n if (typeof browserLang === 'undefined') {\n return undefined\n }\n\n if (browserLang.indexOf('-') !== -1) {\n browserLang = browserLang.split('-')[0];\n }\n\n if (browserLang.indexOf('_') !== -1) {\n browserLang = browserLang.split('_')[0];\n }\n\n return browserLang;\n }\n\n /**\n * Returns the culture language code name from the browser, e.g. \"de-DE\"\n */\n public getBrowserCultureLang(): string {\n if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {\n return undefined;\n }\n\n let browserCultureLang: any = window.navigator.languages ? window.navigator.languages[0] : null;\n browserCultureLang = browserCultureLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage;\n\n return browserCultureLang;\n }\n}\n","import {AfterViewChecked, ChangeDetectorRef, Directive, ElementRef, Input, OnDestroy} from '@angular/core';\nimport {Subscription, isObservable} from 'rxjs';\nimport {DefaultLangChangeEvent, LangChangeEvent, TranslateService, TranslationChangeEvent} from './translate.service';\nimport {equals, isDefined} from './util';\n\n@Directive({\n selector: '[translate],[ngx-translate]'\n})\nexport class TranslateDirective implements AfterViewChecked, OnDestroy {\n key: string;\n lastParams: any;\n currentParams: any;\n onLangChangeSub: Subscription;\n onDefaultLangChangeSub: Subscription;\n onTranslationChangeSub: Subscription;\n\n @Input() set translate(key: string) {\n if (key) {\n this.key = key;\n this.checkNodes();\n }\n }\n\n @Input() set translateParams(params: any) {\n if (!equals(this.currentParams, params)) {\n this.currentParams = params;\n this.checkNodes(true);\n }\n }\n\n constructor(private translateService: TranslateService, private element: ElementRef, private _ref: ChangeDetectorRef) {\n // subscribe to onTranslationChange event, in case the translations of the current lang change\n if (!this.onTranslationChangeSub) {\n this.onTranslationChangeSub = this.translateService.onTranslationChange.subscribe((event: TranslationChangeEvent) => {\n if (event.lang === this.translateService.currentLang) {\n this.checkNodes(true, event.translations);\n }\n });\n }\n\n // subscribe to onLangChange event, in case the language changes\n if (!this.onLangChangeSub) {\n this.onLangChangeSub = this.translateService.onLangChange.subscribe((event: LangChangeEvent) => {\n this.checkNodes(true, event.translations);\n });\n }\n\n // subscribe to onDefaultLangChange event, in case the default language changes\n if (!this.onDefaultLangChangeSub) {\n this.onDefaultLangChangeSub = this.translateService.onDefaultLangChange.subscribe((event: DefaultLangChangeEvent) => {\n this.checkNodes(true);\n });\n }\n }\n\n ngAfterViewChecked() {\n this.checkNodes();\n }\n\n checkNodes(forceUpdate = false, translations?: any) {\n let nodes: NodeList = this.element.nativeElement.childNodes;\n // if the element is empty\n if (!nodes.length) {\n // we add the key as content\n this.setContent(this.element.nativeElement, this.key);\n nodes = this.element.nativeElement.childNodes;\n }\n for (let i = 0; i < nodes.length; ++i) {\n let node: any = nodes[i];\n if (node.nodeType === 3) { // node type 3 is a text node\n let key: string;\n if (forceUpdate) {\n node.lastKey = null;\n }\n if(isDefined(node.lookupKey)) {\n key = node.lookupKey;\n } else if (this.key) {\n key = this.key;\n } else {\n let content = this.getContent(node);\n let trimmedContent = content.trim();\n if (trimmedContent.length) {\n node.lookupKey = trimmedContent;\n // we want to use the content as a key, not the translation value\n if (content !== node.currentValue) {\n key = trimmedContent;\n // the content was changed from the user, we'll use it as a reference if needed\n node.originalContent = content || node.originalContent;\n } else if (node.originalContent) { // the content seems ok, but the lang has changed\n // the current content is the translation, not the key, use the last real content as key\n key = node.originalContent.trim();\n } else if (content !== node.currentValue) {\n // we want to use the content as a key, not the translation value\n key = trimmedContent;\n // the content was changed from the user, we'll use it as a reference if needed\n node.originalContent = content || node.originalContent;\n }\n }\n }\n this.updateValue(key, node, translations);\n }\n }\n }\n\n updateValue(key: string, node: any, translations: any) {\n if (key) {\n if (node.lastKey === key && this.lastParams === this.currentParams) {\n return;\n }\n\n this.lastParams = this.currentParams;\n\n let onTranslation = (res: string) => {\n if (res !== key) {\n node.lastKey = key;\n }\n if (!node.originalContent) {\n node.originalContent = this.getContent(node);\n }\n node.currentValue = isDefined(res) ? res : (node.originalContent || key);\n // we replace in the original content to preserve spaces that we might have trimmed\n this.setContent(node, this.key ? node.currentValue : node.originalContent.replace(key, node.currentValue));\n this._ref.markForCheck();\n };\n\n if (isDefined(translations)) {\n let res = this.translateService.getParsedResult(translations, key, this.currentParams);\n if (isObservable(res)) {\n res.subscribe(onTranslation);\n } else {\n onTranslation(res);\n }\n } else {\n this.translateService.get(key, this.currentParams).subscribe(onTranslation);\n }\n }\n }\n\n getContent(node: any): string {\n return isDefined(node.textContent) ? node.textContent : node.data;\n }\n\n setContent(node: any, content: string): void {\n if (isDefined(node.textContent)) {\n node.textContent = content;\n } else {\n node.data = content;\n }\n }\n\n ngOnDestroy() {\n if (this.onLangChangeSub) {\n this.onLangChangeSub.unsubscribe();\n }\n\n if (this.onDefaultLangChangeSub) {\n this.onDefaultLangChangeSub.unsubscribe();\n }\n\n if (this.onTranslationChangeSub) {\n this.onTranslationChangeSub.unsubscribe();\n }\n }\n}\n","import {ChangeDetectorRef, EventEmitter, Injectable, OnDestroy, Pipe, PipeTransform} from '@angular/core';\nimport {isObservable} from 'rxjs';\nimport {DefaultLangChangeEvent, LangChangeEvent, TranslateService, TranslationChangeEvent} from './translate.service';\nimport {equals, isDefined} from './util';\nimport { Subscription } from 'rxjs';\n\n@Injectable()\n@Pipe({\n name: 'translate',\n pure: false // required to update the value when the promise is resolved\n})\nexport class TranslatePipe implements PipeTransform, OnDestroy {\n value: string = '';\n lastKey: string;\n lastParams: any[];\n onTranslationChange: Subscription;\n onLangChange: Subscription;\n onDefaultLangChange: Subscription;\n\n constructor(private translate: TranslateService, private _ref: ChangeDetectorRef) {\n }\n\n updateValue(key: string, interpolateParams?: Object, translations?: any): void {\n let onTranslation = (res: string) => {\n this.value = res !== undefined ? res : key;\n this.lastKey = key;\n this._ref.markForCheck();\n };\n if (translations) {\n let res = this.translate.getParsedResult(translations, key, interpolateParams);\n if (isObservable(res.subscribe)) {\n res.subscribe(onTranslation);\n } else {\n onTranslation(res);\n }\n }\n this.translate.get(key, interpolateParams).subscribe(onTranslation);\n }\n\n transform(query: string, ...args: any[]): any {\n if (!query || !query.length) {\n return query;\n }\n\n // if we ask another time for the same key, return the last value\n if (equals(query, this.lastKey) && equals(args, this.lastParams)) {\n return this.value;\n }\n\n let interpolateParams: Object;\n if (isDefined(args[0]) && args.length) {\n if (typeof args[0] === 'string' && args[0].length) {\n // we accept objects written in the template such as {n:1}, {'n':1}, {n:'v'}\n // which is why we might need to change it to real JSON objects such as {\"n\":1} or {\"n\":\"v\"}\n let validArgs: string = args[0]\n .replace(/(\\')?([a-zA-Z0-9_]+)(\\')?(\\s)?:/g, '\"$2\":')\n .replace(/:(\\s)?(\\')(.*?)(\\')/g, ':\"$3\"');\n try {\n interpolateParams = JSON.parse(validArgs);\n } catch (e) {\n throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${args[0]}`);\n }\n } else if (typeof args[0] === 'object' && !Array.isArray(args[0])) {\n interpolateParams = args[0];\n }\n }\n\n // store the query, in case it changes\n this.lastKey = query;\n\n // store the params, in case they change\n this.lastParams = args;\n\n // set the value\n this.updateValue(query, interpolateParams);\n\n // if there is a subscription to onLangChange, clean it\n this._dispose();\n\n // subscribe to onTranslationChange event, in case the translations change\n if (!this.onTranslationChange) {\n this.onTranslationChange = this.translate.onTranslationChange.subscribe((event: TranslationChangeEvent) => {\n if (this.lastKey && event.lang === this.translate.currentLang) {\n this.lastKey = null;\n this.updateValue(query, interpolateParams, event.translations);\n }\n });\n }\n\n // subscribe to onLangChange event, in case the language changes\n if (!this.onLangChange) {\n this.onLangChange = this.translate.onLangChange.subscribe((event: LangChangeEvent) => {\n if (this.lastKey) {\n this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated\n this.updateValue(query, interpolateParams, event.translations);\n }\n });\n }\n\n // subscribe to onDefaultLangChange event, in case the default language changes\n if (!this.onDefaultLangChange) {\n this.onDefaultLangChange = this.translate.onDefaultLangChange.subscribe(() => {\n if (this.lastKey) {\n this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated\n this.updateValue(query, interpolateParams);\n }\n });\n }\n\n return this.value;\n }\n\n /**\n * Clean any existing subscription to change events\n */\n private _dispose(): void {\n if (typeof this.onTranslationChange !== 'undefined') {\n this.onTranslationChange.unsubscribe();\n this.onTranslationChange = undefined;\n }\n if (typeof this.onLangChange !== 'undefined') {\n this.onLangChange.unsubscribe();\n this.onLangChange = undefined;\n }\n if (typeof this.onDefaultLangChange !== 'undefined') {\n this.onDefaultLangChange.unsubscribe();\n this.onDefaultLangChange = undefined;\n }\n }\n\n ngOnDestroy(): void {\n this._dispose();\n }\n}\n","import {NgModule, ModuleWithProviders, Provider} from \"@angular/core\";\nimport {TranslateLoader, TranslateFakeLoader} from \"./lib/translate.loader\";\nimport {MissingTranslationHandler, FakeMissingTranslationHandler} from \"./lib/missing-translation-handler\";\nimport {TranslateParser, TranslateDefaultParser} from \"./lib/translate.parser\";\nimport {TranslateCompiler, TranslateFakeCompiler} from \"./lib/translate.compiler\";\nimport {TranslateDirective} from \"./lib/translate.directive\";\nimport {TranslatePipe} from \"./lib/translate.pipe\";\nimport {TranslateStore} from \"./lib/translate.store\";\nimport {USE_DEFAULT_LANG, DEFAULT_LANGUAGE, USE_STORE, TranslateService, USE_EXTEND} from \"./lib/translate.service\";\n\nexport * from \"./lib/translate.loader\";\nexport * from \"./lib/translate.service\";\nexport * from \"./lib/missing-translation-handler\";\nexport * from \"./lib/translate.parser\";\nexport * from \"./lib/translate.compiler\";\nexport * from \"./lib/translate.directive\";\nexport * from \"./lib/translate.pipe\";\nexport * from \"./lib/translate.store\";\n\nexport interface TranslateModuleConfig {\n loader?: Provider;\n compiler?: Provider;\n parser?: Provider;\n missingTranslationHandler?: Provider;\n // isolate the service instance, only works for lazy loaded modules or components with the \"providers\" property\n isolate?: boolean;\n // extends translations for a given language instead of ignoring them if present\n extend?: boolean;\n useDefaultLang?: boolean;\n defaultLanguage?: string;\n}\n\n@NgModule({\n declarations: [\n TranslatePipe,\n TranslateDirective\n ],\n exports: [\n TranslatePipe,\n TranslateDirective\n ]\n})\nexport class TranslateModule {\n /**\n * Use this method in your root module to provide the TranslateService\n */\n static forRoot(config: TranslateModuleConfig = {}): ModuleWithProviders<TranslateModule> {\n return {\n ngModule: TranslateModule,\n providers: [\n config.loader || {provide: TranslateLoader, useClass: TranslateFakeLoader},\n config.compiler || {provide: TranslateCompiler, useClass: TranslateFakeCompiler},\n config.parser || {provide: TranslateParser, useClass: TranslateDefaultParser},\n config.missingTranslationHandler || {provide: MissingTranslationHandler, useClass: FakeMissingTranslationHandler},\n TranslateStore,\n {provide: USE_STORE, useValue: config.isolate},\n {provide: USE_DEFAULT_LANG, useValue: config.useDefaultLang},\n {provide: USE_EXTEND, useValue: config.extend},\n {provide: DEFAULT_LANGUAGE, useValue: config.defaultLanguage},\n TranslateService\n ]\n };\n }\n\n /**\n * Use this method in your other (non root) modules to import the directive/pipe\n */\n static forChild(config: TranslateModuleConfig = {}): ModuleWithProviders<TranslateModule> {\n return {\n ngModule: TranslateModule,\n providers: [\n config.loader || {provide: TranslateLoader, useClass: TranslateFakeLoader},\n config.compiler || {provide: TranslateCompiler, useClass: TranslateFakeCompiler},\n config.parser || {provide: TranslateParser, useClass: TranslateDefaultParser},\n config.missingTranslationHandler || {provide: MissingTranslationHandler, useClass: FakeMissingTranslationHandler},\n {provide: USE_STORE, useValue: config.isolate},\n {provide: USE_DEFAULT_LANG, useValue: config.useDefaultLang},\n {provide: USE_EXTEND, useValue: config.extend},\n {provide: DEFAULT_LANGUAGE, useValue: config.defaultLanguage},\n TranslateService\n ]\n };\n }\n}\n"],"names":["of","Injectable","EventEmitter","InjectionToken","take","shareReplay","map","isObservable","forkJoin","concatMap","concat","defer","switchMap","Inject","Directive","ElementRef","ChangeDetectorRef","Input","Pipe","NgModule"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;IAcA;IAEA,IAAI,aAAa,GAAG,UAAS,CAAC,EAAE,CAAC;QAC7B,aAAa,GAAG,MAAM,CAAC,cAAc;aAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;gBAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;oBAAE,CAAC,CAAC,CAAC,CAAC,GAAG,C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,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAC;oBAC9C,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,cAAc,EAAC;oBAC5D,EAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAC;oBAC9C,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,eAAe,EAAC;oBAC7D,gBAAgB;iBACjB;aACF,CAAC;SACH;;;;gBAlDFG,aAAQ,SAAC;oBACR,YAAY,EAAE;wBACZ,aAAa;wBACb,kBAAkB;qBACnB;oBACD,OAAO,EAAE;wBACP,aAAa;wBACb,kBAAkB;qBACnB;iBACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.min.js b/frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.min.js new file mode 100644 index 000000000..8a562d4b5 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.min.js @@ -0,0 +1,16 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@ngx-translate/core",["exports","@angular/core","rxjs","rxjs/operators"],e):e(((t=t||self)["ngx-translate"]=t["ngx-translate"]||{},t["ngx-translate"].core={}),t.ng.core,t.rxjs,t.rxjs.operators)}(this,(function(t,e,n,r){"use strict"; +/*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.create;function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,a,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){a={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s}function u(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(o(arguments[e]));return t}Object.create;var l=function(){};var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getTranslation=function(t){return n.of({})},e}(l);h.decorators=[{type:e.Injectable}];var c=function(){};var g=function(){function t(){}return t.prototype.handle=function(t){return t.key},t}();function f(t,e){if(t===e)return!0;if(null===t||null===e)return!1;if(t!=t&&e!=e)return!0;var n,r,a,i=typeof t;if(i==typeof e&&"object"==i){if(!Array.isArray(t)){if(Array.isArray(e))return!1;for(r in a=Object.create(null),t){if(!f(t[r],e[r]))return!1;a[r]=!0}for(r in e)if(!(r in a)&&void 0!==e[r])return!1;return!0}if(!Array.isArray(e))return!1;if((n=t.length)==e.length){for(r=0;r<n;r++)if(!f(t[r],e[r]))return!1;return!0}}return!1}function p(t){return null!=t}function d(t){return t&&"object"==typeof t&&!Array.isArray(t)}g.decorators=[{type:e.Injectable}];var y=function(){};var v=function(t){function e(){var e=t.apply(this,u(arguments))||this;return e.templateMatcher=/{{\s?([^{}\s]*)\s?}}/g,e}return i(e,t),e.prototype.interpolate=function(t,e){return"string"==typeof t?this.interpolateString(t,e):"function"==typeof t?this.interpolateFunction(t,e):t},e.prototype.getValue=function(t,e){var n="string"==typeof e?e.split("."):[e];e="";do{e+=n.shift(),!p(t)||!p(t[e])||"object"!=typeof t[e]&&n.length?n.length?e+=".":t=void 0:(t=t[e],e="")}while(n.length);return t},e.prototype.interpolateFunction=function(t,e){return t(e)},e.prototype.interpolateString=function(t,e){var n=this;return e?t.replace(this.templateMatcher,(function(t,r){var a=n.getValue(e,r);return p(a)?a:t})):t},e}(y);v.decorators=[{type:e.Injectable}];var b=function(){};var L=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.compile=function(t,e){return t},e.prototype.compileTranslations=function(t,e){return t},e}(b);L.decorators=[{type:e.Injectable}];var C=function(){this.currentLang=this.defaultLang,this.translations={},this.langs=[],this.onTranslationChange=new e.EventEmitter,this.onLangChange=new e.EventEmitter,this.onDefaultLangChange=new e.EventEmitter};var m=new e.InjectionToken("USE_STORE"),T=new e.InjectionToken("USE_DEFAULT_LANG"),w=new e.InjectionToken("DEFAULT_LANGUAGE"),_=new e.InjectionToken("USE_EXTEND");var j=function(){function t(t,n,r,a,i,s,o,u,l){void 0===s&&(s=!0),void 0===o&&(o=!1),void 0===u&&(u=!1),this.store=t,this.currentLoader=n,this.compiler=r,this.parser=a,this.missingTranslationHandler=i,this.useDefaultLang=s,this.isolate=o,this.extend=u,this.pending=!1,this._onTranslationChange=new e.EventEmitter,this._onLangChange=new e.EventEmitter,this._onDefaultLangChange=new e.EventEmitter,this._langs=[],this._translations={},this._translationRequests={},l&&this.setDefaultLang(l)}return Object.defineProperty(t.prototype,"onTranslationChange",{get:function(){return this.isolate?this._onTranslationChange:this.store.onTranslationChange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onLangChange",{get:function(){return this.isolate?this._onLangChange:this.store.onLangChange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDefaultLangChange",{get:function(){return this.isolate?this._onDefaultLangChange:this.store.onDefaultLangChange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultLang",{get:function(){return this.isolate?this._defaultLang:this.store.defaultLang},set:function(t){this.isolate?this._defaultLang=t:this.store.defaultLang=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentLang",{get:function(){return this.isolate?this._currentLang:this.store.currentLang},set:function(t){this.isolate?this._currentLang=t:this.store.currentLang=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"langs",{get:function(){return this.isolate?this._langs:this.store.langs},set:function(t){this.isolate?this._langs=t:this.store.langs=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"translations",{get:function(){return this.isolate?this._translations:this.store.translations},set:function(t){this.isolate?this._translations=t:this.store.translations=t},enumerable:!1,configurable:!0}),t.prototype.setDefaultLang=function(t){var e=this;if(t!==this.defaultLang){var n=this.retrieveTranslations(t);void 0!==n?(null==this.defaultLang&&(this.defaultLang=t),n.pipe(r.take(1)).subscribe((function(n){e.changeDefaultLang(t)}))):this.changeDefaultLang(t)}},t.prototype.getDefaultLang=function(){return this.defaultLang},t.prototype.use=function(t){var e=this;if(t===this.currentLang)return n.of(this.translations[t]);var a=this.retrieveTranslations(t);return void 0!==a?(this.currentLang||(this.currentLang=t),a.pipe(r.take(1)).subscribe((function(n){e.changeLang(t)})),a):(this.changeLang(t),n.of(this.translations[t]))},t.prototype.retrieveTranslations=function(t){var e;return(void 0===this.translations[t]||this.extend)&&(this._translationRequests[t]=this._translationRequests[t]||this.getTranslation(t),e=this._translationRequests[t]),e},t.prototype.getTranslation=function(t){var e=this;this.pending=!0;var n=this.currentLoader.getTranslation(t).pipe(r.shareReplay(1),r.take(1));return this.loadingTranslations=n.pipe(r.map((function(n){return e.compiler.compileTranslations(n,t)})),r.shareReplay(1),r.take(1)),this.loadingTranslations.subscribe({next:function(n){e.translations[t]=e.extend&&e.translations[t]?Object.assign(Object.assign({},n),e.translations[t]):n,e.updateLangs(),e.pending=!1},error:function(t){e.pending=!1}}),n},t.prototype.setTranslation=function(t,e,n){void 0===n&&(n=!1),e=this.compiler.compileTranslations(e,t),(n||this.extend)&&this.translations[t]?this.translations[t]=function t(e,n){var r=Object.assign({},e);return d(e)&&d(n)&&Object.keys(n).forEach((function(a){var i,s;d(n[a])?a in e?r[a]=t(e[a],n[a]):Object.assign(r,((i={})[a]=n[a],i)):Object.assign(r,((s={})[a]=n[a],s))})),r}(this.translations[t],e):this.translations[t]=e,this.updateLangs(),this.onTranslationChange.emit({lang:t,translations:this.translations[t]})},t.prototype.getLangs=function(){return this.langs},t.prototype.addLangs=function(t){var e=this;t.forEach((function(t){-1===e.langs.indexOf(t)&&e.langs.push(t)}))},t.prototype.updateLangs=function(){this.addLangs(Object.keys(this.translations))},t.prototype.getParsedResult=function(t,e,a){var i,o,u;if(e instanceof Array){var l={},h=!1;try{for(var c=s(e),g=c.next();!g.done;g=c.next()){var f=g.value;l[f]=this.getParsedResult(t,f,a),n.isObservable(l[f])&&(h=!0)}}catch(t){i={error:t}}finally{try{g&&!g.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}if(h){var p=e.map((function(t){return n.isObservable(l[t])?l[t]:n.of(l[t])}));return n.forkJoin(p).pipe(r.map((function(t){var n={};return t.forEach((function(t,r){n[e[r]]=t})),n})))}return l}if(t&&(u=this.parser.interpolate(this.parser.getValue(t,e),a)),void 0===u&&null!=this.defaultLang&&this.defaultLang!==this.currentLang&&this.useDefaultLang&&(u=this.parser.interpolate(this.parser.getValue(this.translations[this.defaultLang],e),a)),void 0===u){var d={key:e,translateService:this};void 0!==a&&(d.interpolateParams=a),u=this.missingTranslationHandler.handle(d)}return void 0!==u?u:e},t.prototype.get=function(t,e){var a=this;if(!p(t)||!t.length)throw new Error('Parameter "key" required');if(this.pending)return this.loadingTranslations.pipe(r.concatMap((function(r){return r=a.getParsedResult(r,t,e),n.isObservable(r)?r:n.of(r)})));var i=this.getParsedResult(this.translations[this.currentLang],t,e);return n.isObservable(i)?i:n.of(i)},t.prototype.getStreamOnTranslationChange=function(t,e){var a=this;if(!p(t)||!t.length)throw new Error('Parameter "key" required');return n.concat(n.defer((function(){return a.get(t,e)})),this.onTranslationChange.pipe(r.switchMap((function(r){var i=a.getParsedResult(r.translations,t,e);return"function"==typeof i.subscribe?i:n.of(i)}))))},t.prototype.stream=function(t,e){var a=this;if(!p(t)||!t.length)throw new Error('Parameter "key" required');return n.concat(n.defer((function(){return a.get(t,e)})),this.onLangChange.pipe(r.switchMap((function(r){var i=a.getParsedResult(r.translations,t,e);return n.isObservable(i)?i:n.of(i)}))))},t.prototype.instant=function(t,e){if(!p(t)||!t.length)throw new Error('Parameter "key" required');var r=this.getParsedResult(this.translations[this.currentLang],t,e);if(n.isObservable(r)){if(t instanceof Array){var a={};return t.forEach((function(e,n){a[t[n]]=t[n]})),a}return t}return r},t.prototype.set=function(t,e,n){void 0===n&&(n=this.currentLang),this.translations[n][t]=this.compiler.compile(e,n),this.updateLangs(),this.onTranslationChange.emit({lang:n,translations:this.translations[n]})},t.prototype.changeLang=function(t){this.currentLang=t,this.onLangChange.emit({lang:t,translations:this.translations[t]}),null==this.defaultLang&&this.changeDefaultLang(t)},t.prototype.changeDefaultLang=function(t){this.defaultLang=t,this.onDefaultLangChange.emit({lang:t,translations:this.translations[t]})},t.prototype.reloadLang=function(t){return this.resetLang(t),this.getTranslation(t)},t.prototype.resetLang=function(t){this._translationRequests[t]=void 0,this.translations[t]=void 0},t.prototype.getBrowserLang=function(){if("undefined"!=typeof window&&void 0!==window.navigator){var t=window.navigator.languages?window.navigator.languages[0]:null;if(void 0!==(t=t||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage))return-1!==t.indexOf("-")&&(t=t.split("-")[0]),-1!==t.indexOf("_")&&(t=t.split("_")[0]),t}},t.prototype.getBrowserCultureLang=function(){if("undefined"!=typeof window&&void 0!==window.navigator){var t=window.navigator.languages?window.navigator.languages[0]:null;return t=t||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage}},t}();j.decorators=[{type:e.Injectable}],j.ctorParameters=function(){return[{type:C},{type:l},{type:b},{type:y},{type:c},{type:Boolean,decorators:[{type:e.Inject,args:[T]}]},{type:Boolean,decorators:[{type:e.Inject,args:[m]}]},{type:Boolean,decorators:[{type:e.Inject,args:[_]}]},{type:String,decorators:[{type:e.Inject,args:[w]}]}]};var P=function(){function t(t,e,n){var r=this;this.translateService=t,this.element=e,this._ref=n,this.onTranslationChangeSub||(this.onTranslationChangeSub=this.translateService.onTranslationChange.subscribe((function(t){t.lang===r.translateService.currentLang&&r.checkNodes(!0,t.translations)}))),this.onLangChangeSub||(this.onLangChangeSub=this.translateService.onLangChange.subscribe((function(t){r.checkNodes(!0,t.translations)}))),this.onDefaultLangChangeSub||(this.onDefaultLangChangeSub=this.translateService.onDefaultLangChange.subscribe((function(t){r.checkNodes(!0)})))}return Object.defineProperty(t.prototype,"translate",{set:function(t){t&&(this.key=t,this.checkNodes())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"translateParams",{set:function(t){f(this.currentParams,t)||(this.currentParams=t,this.checkNodes(!0))},enumerable:!1,configurable:!0}),t.prototype.ngAfterViewChecked=function(){this.checkNodes()},t.prototype.checkNodes=function(t,e){void 0===t&&(t=!1);var n=this.element.nativeElement.childNodes;n.length||(this.setContent(this.element.nativeElement,this.key),n=this.element.nativeElement.childNodes);for(var r=0;r<n.length;++r){var a=n[r];if(3===a.nodeType){var i=void 0;if(t&&(a.lastKey=null),p(a.lookupKey))i=a.lookupKey;else if(this.key)i=this.key;else{var s=this.getContent(a),o=s.trim();o.length&&(a.lookupKey=o,s!==a.currentValue?(i=o,a.originalContent=s||a.originalContent):a.originalContent?i=a.originalContent.trim():s!==a.currentValue&&(i=o,a.originalContent=s||a.originalContent))}this.updateValue(i,a,e)}}},t.prototype.updateValue=function(t,e,r){var a=this;if(t){if(e.lastKey===t&&this.lastParams===this.currentParams)return;this.lastParams=this.currentParams;var i=function(n){n!==t&&(e.lastKey=t),e.originalContent||(e.originalContent=a.getContent(e)),e.currentValue=p(n)?n:e.originalContent||t,a.setContent(e,a.key?e.currentValue:e.originalContent.replace(t,e.currentValue)),a._ref.markForCheck()};if(p(r)){var s=this.translateService.getParsedResult(r,t,this.currentParams);n.isObservable(s)?s.subscribe(i):i(s)}else this.translateService.get(t,this.currentParams).subscribe(i)}},t.prototype.getContent=function(t){return p(t.textContent)?t.textContent:t.data},t.prototype.setContent=function(t,e){p(t.textContent)?t.textContent=e:t.data=e},t.prototype.ngOnDestroy=function(){this.onLangChangeSub&&this.onLangChangeSub.unsubscribe(),this.onDefaultLangChangeSub&&this.onDefaultLangChangeSub.unsubscribe(),this.onTranslationChangeSub&&this.onTranslationChangeSub.unsubscribe()},t}();P.decorators=[{type:e.Directive,args:[{selector:"[translate],[ngx-translate]"}]}],P.ctorParameters=function(){return[{type:j},{type:e.ElementRef},{type:e.ChangeDetectorRef}]},P.propDecorators={translate:[{type:e.Input}],translateParams:[{type:e.Input}]};var E=function(){function t(t,e){this.translate=t,this._ref=e,this.value=""}return t.prototype.updateValue=function(t,e,r){var a=this,i=function(e){a.value=void 0!==e?e:t,a.lastKey=t,a._ref.markForCheck()};if(r){var s=this.translate.getParsedResult(r,t,e);n.isObservable(s.subscribe)?s.subscribe(i):i(s)}this.translate.get(t,e).subscribe(i)},t.prototype.transform=function(t){for(var e,n=this,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];if(!t||!t.length)return t;if(f(t,this.lastKey)&&f(r,this.lastParams))return this.value;if(p(r[0])&&r.length)if("string"==typeof r[0]&&r[0].length){var i=r[0].replace(/(\')?([a-zA-Z0-9_]+)(\')?(\s)?:/g,'"$2":').replace(/:(\s)?(\')(.*?)(\')/g,':"$3"');try{e=JSON.parse(i)}catch(t){throw new SyntaxError("Wrong parameter in TranslatePipe. Expected a valid Object, received: "+r[0])}}else"object"!=typeof r[0]||Array.isArray(r[0])||(e=r[0]);return this.lastKey=t,this.lastParams=r,this.updateValue(t,e),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe((function(r){n.lastKey&&r.lang===n.translate.currentLang&&(n.lastKey=null,n.updateValue(t,e,r.translations))}))),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe((function(r){n.lastKey&&(n.lastKey=null,n.updateValue(t,e,r.translations))}))),this.onDefaultLangChange||(this.onDefaultLangChange=this.translate.onDefaultLangChange.subscribe((function(){n.lastKey&&(n.lastKey=null,n.updateValue(t,e))}))),this.value},t.prototype._dispose=function(){void 0!==this.onTranslationChange&&(this.onTranslationChange.unsubscribe(),this.onTranslationChange=void 0),void 0!==this.onLangChange&&(this.onLangChange.unsubscribe(),this.onLangChange=void 0),void 0!==this.onDefaultLangChange&&(this.onDefaultLangChange.unsubscribe(),this.onDefaultLangChange=void 0)},t.prototype.ngOnDestroy=function(){this._dispose()},t}();E.decorators=[{type:e.Injectable},{type:e.Pipe,args:[{name:"translate",pure:!1}]}],E.ctorParameters=function(){return[{type:j},{type:e.ChangeDetectorRef}]};var O=function(){function t(){}return t.forRoot=function(e){return void 0===e&&(e={}),{ngModule:t,providers:[e.loader||{provide:l,useClass:h},e.compiler||{provide:b,useClass:L},e.parser||{provide:y,useClass:v},e.missingTranslationHandler||{provide:c,useClass:g},C,{provide:m,useValue:e.isolate},{provide:T,useValue:e.useDefaultLang},{provide:_,useValue:e.extend},{provide:w,useValue:e.defaultLanguage},j]}},t.forChild=function(e){return void 0===e&&(e={}),{ngModule:t,providers:[e.loader||{provide:l,useClass:h},e.compiler||{provide:b,useClass:L},e.parser||{provide:y,useClass:v},e.missingTranslationHandler||{provide:c,useClass:g},{provide:m,useValue:e.isolate},{provide:T,useValue:e.useDefaultLang},{provide:_,useValue:e.extend},{provide:w,useValue:e.defaultLanguage},j]}},t}();O.decorators=[{type:e.NgModule,args:[{declarations:[E,P],exports:[E,P]}]}],t.DEFAULT_LANGUAGE=w,t.FakeMissingTranslationHandler=g,t.MissingTranslationHandler=c,t.TranslateCompiler=b,t.TranslateDefaultParser=v,t.TranslateDirective=P,t.TranslateFakeCompiler=L,t.TranslateFakeLoader=h,t.TranslateLoader=l,t.TranslateModule=O,t.TranslateParser=y,t.TranslatePipe=E,t.TranslateService=j,t.TranslateStore=C,t.USE_DEFAULT_LANG=T,t.USE_EXTEND=_,t.USE_STORE=m,Object.defineProperty(t,"__esModule",{value:!0})})); +//# sourceMappingURL=ngx-translate-core.umd.min.js.map \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.min.js.map b/frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.min.js.map new file mode 100644 index 000000000..f192e4f3b --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/bundles/ngx-translate-core.umd.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../node_modules/tslib/tslib.es6.js","../../../../projects/ngx-translate/core/src/lib/translate.loader.ts","../../../../projects/ngx-translate/core/src/lib/missing-translation-handler.ts","../../../../projects/ngx-translate/core/src/lib/util.ts","../../../../projects/ngx-translate/core/src/lib/translate.parser.ts","../../../../projects/ngx-translate/core/src/lib/translate.compiler.ts","../../../../projects/ngx-translate/core/src/lib/translate.store.ts","../../../../projects/ngx-translate/core/src/lib/translate.service.ts","../../../../projects/ngx-translate/core/src/lib/translate.directive.ts","../../../../projects/ngx-translate/core/src/lib/translate.pipe.ts","../../../../projects/ngx-translate/core/src/public_api.ts"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","this","constructor","prototype","create","__values","o","s","Symbol","iterator","m","i","call","length","next","value","done","TypeError","__read","n","r","e","ar","push","error","__spread","arguments","concat","TranslateFakeLoader","_super","getTranslation","lang","of","TranslateLoader","Injectable","FakeMissingTranslationHandler","handle","params","key","equals","o1","o2","keySet","t1","isArray","isDefined","isObject","item","TranslateDefaultParser","_this","apply","templateMatcher","interpolate","expr","interpolateString","interpolateFunction","getValue","target","keys","split","shift","undefined","fn","replace","substring","TranslateParser","TranslateFakeCompiler","compile","compileTranslations","translations","TranslateCompiler","currentLang","defaultLang","langs","onTranslationChange","EventEmitter","onLangChange","onDefaultLangChange","USE_STORE","InjectionToken","USE_DEFAULT_LANG","DEFAULT_LANGUAGE","USE_EXTEND","TranslateService","store","currentLoader","compiler","parser","missingTranslationHandler","useDefaultLang","isolate","extend","defaultLanguage","pending","_onTranslationChange","_onLangChange","_onDefaultLangChange","_langs","_translations","_translationRequests","setDefaultLang","defineProperty","_defaultLang","_currentLang","retrieveTranslations","pipe","take","subscribe","res","changeDefaultLang","getDefaultLang","use","changeLang","loadingTranslations","shareReplay","map","assign","updateLangs","err","setTranslation","shouldMerge","mergeDeep","source","output","forEach","_a","_b","emit","getLangs","addLangs","indexOf","getParsedResult","interpolateParams","result_1","observables","key_1","key_1_1","k","isObservable","sources","forkJoin","arr","obj","index","translateService","get","Error","concatMap","getStreamOnTranslationChange","defer","switchMap","event","stream","instant","obj_1","set","reloadLang","resetLang","getBrowserLang","window","navigator","browserLang","languages","language","browserLanguage","userLanguage","getBrowserCultureLang","browserCultureLang","TranslateStore","MissingTranslationHandler","Inject","args","TranslateDirective","element","_ref","onTranslationChangeSub","checkNodes","onLangChangeSub","onDefaultLangChangeSub","currentParams","ngAfterViewChecked","forceUpdate","nodes","nativeElement","childNodes","setContent","node","nodeType","lastKey","lookupKey","content","getContent","trimmedContent","trim","currentValue","originalContent","updateValue","lastParams","onTranslation","markForCheck","textContent","data","ngOnDestroy","unsubscribe","Directive","selector","ElementRef","ChangeDetectorRef","Input","TranslatePipe","translate","transform","query","_i","validArgs","JSON","parse","SyntaxError","_dispose","Pipe","name","pure","TranslateModule","forRoot","config","ngModule","providers","loader","provide","useClass","useValue","forChild","NgModule","declarations","exports"],"mappings":";;;;;;;;;;;;;;oFAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOA,EAAEM,eAAeD,KAAIN,EAAEM,GAAKL,EAAEK,MACpDN,EAAGC,aAGZO,EAAUR,EAAGC,GAEzB,SAASQ,IAAOC,KAAKC,YAAcX,EADnCD,EAAcC,EAAGC,GAEjBD,EAAEY,UAAkB,OAANX,EAAaC,OAAOW,OAAOZ,IAAMQ,EAAGG,UAAYX,EAAEW,UAAW,IAAIH,GA+EtDP,OAAOW,gBAYpBC,EAASC,GACrB,IAAIC,EAAsB,mBAAXC,QAAyBA,OAAOC,SAAUC,EAAIH,GAAKD,EAAEC,GAAII,EAAI,EAC5E,GAAID,EAAG,OAAOA,EAAEE,KAAKN,GACrB,GAAIA,GAAyB,iBAAbA,EAAEO,OAAqB,MAAO,CAC1CC,KAAM,WAEF,OADIR,GAAKK,GAAKL,EAAEO,SAAQP,OAAI,GACrB,CAAES,MAAOT,GAAKA,EAAEK,KAAMK,MAAOV,KAG5C,MAAM,IAAIW,UAAUV,EAAI,0BAA4B,4CAGxCW,EAAOZ,EAAGa,GACtB,IAAIT,EAAsB,mBAAXF,QAAyBF,EAAEE,OAAOC,UACjD,IAAKC,EAAG,OAAOJ,EACf,IAAmBc,EAAYC,EAA3BV,EAAID,EAAEE,KAAKN,GAAOgB,EAAK,GAC3B,IACI,WAAc,IAANH,GAAgBA,KAAM,MAAQC,EAAIT,EAAEG,QAAQE,MAAMM,EAAGC,KAAKH,EAAEL,OAExE,MAAOS,GAASH,EAAI,CA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tDoM,EAAO1I,UAAY,CAAC8I,QAAS9J,EAAmB+J,SAAUnK,GAC1D8J,EAAOzI,QAAU,CAAC6I,QAASnK,EAAiBoK,SAAUrL,GACtDgL,EAAOxI,2BAA6B,CAAC4I,QAAS3D,EAA2B4D,SAAUlM,GACnFqI,EACA,CAAC4D,QAAStJ,EAAWwJ,SAAUN,EAAOtI,SACtC,CAAC0I,QAASpJ,EAAkBsJ,SAAUN,EAAOvI,gBAC7C,CAAC2I,QAASlJ,EAAYoJ,SAAUN,EAAOrI,QACvC,CAACyI,QAASnJ,EAAkBqJ,SAAUN,EAAOpI,iBAC7CT,KAQC2I,EAAAS,SAAP,SAAgBP,GACd,YADc,IAAAA,IAAAA,EAAA,IACP,CACLC,SAAUH,EACVI,UAAW,CACTF,EAAOG,QAAU,CAACC,QAASnM,EAAiBoM,SAAUzM,GACtDoM,EAAO1I,UAAY,CAAC8I,QAAS9J,EAAmB+J,SAAUnK,GAC1D8J,EAAOzI,QAAU,CAAC6I,QAASnK,EAAiBoK,SAAUrL,GACtDgL,EAAOxI,2BAA6B,CAAC4I,QAAS3D,EAA2B4D,SAAUlM,GACnF,CAACiM,QAAStJ,EAAWwJ,SAAUN,EAAOtI,SACtC,CAAC0I,QAASpJ,EAAkBsJ,SAAUN,EAAOvI,gBAC7C,CAAC2I,QAASlJ,EAAYoJ,SAAUN,EAAOrI,QACvC,CAACyI,QAASnJ,EAAkBqJ,SAAUN,EAAOpI,iBAC7CT,8BA/CPqJ,EAAAA,SAAQ7D,KAAA,CAAC,CACR8D,aAAc,CACZxB,EACArC,GAEF8D,QAAS,CACPzB,EACArC","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import {Injectable} from \"@angular/core\";\nimport {Observable, of} from \"rxjs\";\n\nexport abstract class TranslateLoader {\n abstract getTranslation(lang: string): Observable<any>;\n}\n\n/**\n * This loader is just a placeholder that does nothing, in case you don't need a loader at all\n */\n@Injectable()\nexport class TranslateFakeLoader extends TranslateLoader {\n getTranslation(lang: string): Observable<any> {\n return of({});\n }\n}\n","import {Injectable} from \"@angular/core\";\nimport {TranslateService} from \"./translate.service\";\n\nexport interface MissingTranslationHandlerParams {\n /**\n * the key that's missing in translation files\n */\n key: string;\n\n /**\n * an instance of the service that was unable to translate the key.\n */\n translateService: TranslateService;\n\n /**\n * interpolation params that were passed along for translating the given key.\n */\n interpolateParams?: Object;\n}\n\nexport abstract class MissingTranslationHandler {\n /**\n * A function that handles missing translations.\n *\n * @param params context for resolving a missing translation\n * @returns a value or an observable\n * If it returns a value, then this value is used.\n * If it return an observable, the value returned by this observable will be used (except if the method was \"instant\").\n * If it doesn't return then the key will be used as a value\n */\n abstract handle(params: MissingTranslationHandlerParams): any;\n}\n\n/**\n * This handler is just a placeholder that does nothing, in case you don't need a missing translation handler at all\n */\n@Injectable()\nexport class FakeMissingTranslationHandler implements MissingTranslationHandler {\n handle(params: MissingTranslationHandlerParams): string {\n return params.key;\n }\n}\n","/* tslint:disable */\n/**\n * Determines if two objects or two values are equivalent.\n *\n * Two objects or values are considered equivalent if at least one of the following is true:\n *\n * * Both objects or values pass `===` comparison.\n * * Both objects or values are of the same type and all of their properties are equal by\n * comparing them with `equals`.\n *\n * @param o1 Object or value to compare.\n * @param o2 Object or value to compare.\n * @returns true if arguments are equal.\n */\nexport function equals(o1: any, o2: any): boolean {\n if (o1 === o2) return true;\n if (o1 === null || o2 === null) return false;\n if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\n let t1 = typeof o1, t2 = typeof o2, length: number, key: any, keySet: any;\n if (t1 == t2 && t1 == 'object') {\n if (Array.isArray(o1)) {\n if (!Array.isArray(o2)) return false;\n if ((length = o1.length) == o2.length) {\n for (key = 0; key < length; key++) {\n if (!equals(o1[key], o2[key])) return false;\n }\n return true;\n }\n } else {\n if (Array.isArray(o2)) {\n return false;\n }\n keySet = Object.create(null);\n for (key in o1) {\n if (!equals(o1[key], o2[key])) {\n return false;\n }\n keySet[key] = true;\n }\n for (key in o2) {\n if (!(key in keySet) && typeof o2[key] !== 'undefined') {\n return false;\n }\n }\n return true;\n }\n }\n return false;\n}\n/* tslint:enable */\n\nexport function isDefined(value: any): boolean {\n return typeof value !== 'undefined' && value !== null;\n}\n\nexport function isObject(item: any): boolean {\n return (item && typeof item === 'object' && !Array.isArray(item));\n}\n\nexport function mergeDeep(target: any, source: any): any {\n let output = Object.assign({}, target);\n if (isObject(target) && isObject(source)) {\n Object.keys(source).forEach((key: any) => {\n if (isObject(source[key])) {\n if (!(key in target)) {\n Object.assign(output, {[key]: source[key]});\n } else {\n output[key] = mergeDeep(target[key], source[key]);\n }\n } else {\n Object.assign(output, {[key]: source[key]});\n }\n });\n }\n return output;\n}\n","import {Injectable} from \"@angular/core\";\nimport {isDefined} from \"./util\";\n\nexport abstract class TranslateParser {\n /**\n * Interpolates a string to replace parameters\n * \"This is a {{ key }}\" ==> \"This is a value\", with params = { key: \"value\" }\n * @param expr\n * @param params\n */\n abstract interpolate(expr: string | Function, params?: any): string;\n\n /**\n * Gets a value from an object by composed key\n * parser.getValue({ key1: { keyA: 'valueI' }}, 'key1.keyA') ==> 'valueI'\n * @param target\n * @param key\n */\n abstract getValue(target: any, key: string): any\n}\n\n@Injectable()\nexport class TranslateDefaultParser extends TranslateParser {\n templateMatcher: RegExp = /{{\\s?([^{}\\s]*)\\s?}}/g;\n\n public interpolate(expr: string | Function, params?: any): string {\n let result: string;\n\n if (typeof expr === 'string') {\n result = this.interpolateString(expr, params);\n } else if (typeof expr === 'function') {\n result = this.interpolateFunction(expr, params);\n } else {\n // this should not happen, but an unrelated TranslateService test depends on it\n result = expr as string;\n }\n\n return result;\n }\n\n getValue(target: any, key: string): any {\n let keys = typeof key === 'string' ? key.split('.') : [key];\n key = '';\n do {\n key += keys.shift();\n if (isDefined(target) && isDefined(target[key]) && (typeof target[key] === 'object' || !keys.length)) {\n target = target[key];\n key = '';\n } else if (!keys.length) {\n target = undefined;\n } else {\n key += '.';\n }\n } while (keys.length);\n\n return target;\n }\n\n private interpolateFunction(fn: Function, params?: any) {\n return fn(params);\n }\n\n private interpolateString(expr: string, params?: any) {\n if (!params) {\n return expr;\n }\n\n return expr.replace(this.templateMatcher, (substring: string, b: string) => {\n let r = this.getValue(params, b);\n return isDefined(r) ? r : substring;\n });\n }\n}\n","import {Injectable} from \"@angular/core\";\n\nexport abstract class TranslateCompiler {\n abstract compile(value: string, lang: string): string | Function;\n\n abstract compileTranslations(translations: any, lang: string): any;\n}\n\n/**\n * This compiler is just a placeholder that does nothing, in case you don't need a compiler at all\n */\n@Injectable()\nexport class TranslateFakeCompiler extends TranslateCompiler {\n compile(value: string, lang: string): string | Function {\n return value;\n }\n\n compileTranslations(translations: any, lang: string): any {\n return translations;\n }\n}\n","import {EventEmitter} from \"@angular/core\";\nimport {DefaultLangChangeEvent, LangChangeEvent, TranslationChangeEvent} from \"./translate.service\";\n\nexport class TranslateStore {\n /**\n * The default lang to fallback when translations are missing on the current lang\n */\n public defaultLang: string;\n\n /**\n * The lang currently used\n */\n public currentLang: string = this.defaultLang;\n\n /**\n * a list of translations per lang\n */\n public translations: any = {};\n\n /**\n * an array of langs\n */\n public langs: Array<string> = [];\n\n /**\n * An EventEmitter to listen to translation change events\n * onTranslationChange.subscribe((params: TranslationChangeEvent) => {\n * // do something\n * });\n */\n public onTranslationChange: EventEmitter<TranslationChangeEvent> = new EventEmitter<TranslationChangeEvent>();\n\n /**\n * An EventEmitter to listen to lang change events\n * onLangChange.subscribe((params: LangChangeEvent) => {\n * // do something\n * });\n */\n public onLangChange: EventEmitter<LangChangeEvent> = new EventEmitter<LangChangeEvent>();\n\n /**\n * An EventEmitter to listen to default lang change events\n * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => {\n * // do something\n * });\n */\n public onDefaultLangChange: EventEmitter<DefaultLangChangeEvent> = new EventEmitter<DefaultLangChangeEvent>();\n}\n","import {EventEmitter, Inject, Injectable, InjectionToken} from \"@angular/core\";\nimport {concat, forkJoin, isObservable, Observable, of, defer} from \"rxjs\";\nimport {concatMap, map, shareReplay, switchMap, take} from \"rxjs/operators\";\nimport {MissingTranslationHandler, MissingTranslationHandlerParams} from \"./missing-translation-handler\";\nimport {TranslateCompiler} from \"./translate.compiler\";\nimport {TranslateLoader} from \"./translate.loader\";\nimport {TranslateParser} from \"./translate.parser\";\n\nimport {TranslateStore} from \"./translate.store\";\nimport {isDefined, mergeDeep} from \"./util\";\n\nexport const USE_STORE = new InjectionToken<string>('USE_STORE');\nexport const USE_DEFAULT_LANG = new InjectionToken<string>('USE_DEFAULT_LANG');\nexport const DEFAULT_LANGUAGE = new InjectionToken<string>('DEFAULT_LANGUAGE');\nexport const USE_EXTEND = new InjectionToken<string>('USE_EXTEND');\n\nexport interface TranslationChangeEvent {\n translations: any;\n lang: string;\n}\n\nexport interface LangChangeEvent {\n lang: string;\n translations: any;\n}\n\nexport interface DefaultLangChangeEvent {\n lang: string;\n translations: any;\n}\n\ndeclare interface Window {\n navigator: any;\n}\n\ndeclare const window: Window;\n\n@Injectable()\nexport class TranslateService {\n private loadingTranslations: Observable<any>;\n private pending: boolean = false;\n private _onTranslationChange: EventEmitter<TranslationChangeEvent> = new EventEmitter<TranslationChangeEvent>();\n private _onLangChange: EventEmitter<LangChangeEvent> = new EventEmitter<LangChangeEvent>();\n private _onDefaultLangChange: EventEmitter<DefaultLangChangeEvent> = new EventEmitter<DefaultLangChangeEvent>();\n private _defaultLang: string;\n private _currentLang: string;\n private _langs: Array<string> = [];\n private _translations: any = {};\n private _translationRequests: any = {};\n\n /**\n * An EventEmitter to listen to translation change events\n * onTranslationChange.subscribe((params: TranslationChangeEvent) => {\n * // do something\n * });\n */\n get onTranslationChange(): EventEmitter<TranslationChangeEvent> {\n return this.isolate ? this._onTranslationChange : this.store.onTranslationChange;\n }\n\n /**\n * An EventEmitter to listen to lang change events\n * onLangChange.subscribe((params: LangChangeEvent) => {\n * // do something\n * });\n */\n get onLangChange(): EventEmitter<LangChangeEvent> {\n return this.isolate ? this._onLangChange : this.store.onLangChange;\n }\n\n /**\n * An EventEmitter to listen to default lang change events\n * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => {\n * // do something\n * });\n */\n get onDefaultLangChange() {\n return this.isolate ? this._onDefaultLangChange : this.store.onDefaultLangChange;\n }\n\n /**\n * The default lang to fallback when translations are missing on the current lang\n */\n get defaultLang(): string {\n return this.isolate ? this._defaultLang : this.store.defaultLang;\n }\n\n set defaultLang(defaultLang: string) {\n if (this.isolate) {\n this._defaultLang = defaultLang;\n } else {\n this.store.defaultLang = defaultLang;\n }\n }\n\n /**\n * The lang currently used\n */\n get currentLang(): string {\n return this.isolate ? this._currentLang : this.store.currentLang;\n }\n\n set currentLang(currentLang: string) {\n if (this.isolate) {\n this._currentLang = currentLang;\n } else {\n this.store.currentLang = currentLang;\n }\n }\n\n /**\n * an array of langs\n */\n get langs(): string[] {\n return this.isolate ? this._langs : this.store.langs;\n }\n\n set langs(langs: string[]) {\n if (this.isolate) {\n this._langs = langs;\n } else {\n this.store.langs = langs;\n }\n }\n\n /**\n * a list of translations per lang\n */\n get translations(): any {\n return this.isolate ? this._translations : this.store.translations;\n }\n\n set translations(translations: any) {\n if (this.isolate) {\n this._translations = translations;\n } else {\n this.store.translations = translations;\n }\n }\n\n /**\n *\n * @param store an instance of the store (that is supposed to be unique)\n * @param currentLoader An instance of the loader currently used\n * @param compiler An instance of the compiler currently used\n * @param parser An instance of the parser currently used\n * @param missingTranslationHandler A handler for missing translations.\n * @param useDefaultLang whether we should use default language translation when current language translation is missing.\n * @param isolate whether this service should use the store or not\n * @param extend To make a child module extend (and use) translations from parent modules.\n * @param defaultLanguage Set the default language using configuration\n */\n constructor(public store: TranslateStore,\n public currentLoader: TranslateLoader,\n public compiler: TranslateCompiler,\n public parser: TranslateParser,\n public missingTranslationHandler: MissingTranslationHandler,\n @Inject(USE_DEFAULT_LANG) private useDefaultLang: boolean = true,\n @Inject(USE_STORE) private isolate: boolean = false,\n @Inject(USE_EXTEND) private extend: boolean = false,\n @Inject(DEFAULT_LANGUAGE) defaultLanguage: string) {\n /** set the default language from configuration */\n if (defaultLanguage) {\n this.setDefaultLang(defaultLanguage);\n }\n }\n\n /**\n * Sets the default language to use as a fallback\n */\n public setDefaultLang(lang: string): void {\n if (lang === this.defaultLang) {\n return;\n }\n\n let pending: Observable<any> = this.retrieveTranslations(lang);\n\n if (typeof pending !== \"undefined\") {\n // on init set the defaultLang immediately\n if (this.defaultLang == null) {\n this.defaultLang = lang;\n }\n\n pending.pipe(take(1))\n .subscribe((res: any) => {\n this.changeDefaultLang(lang);\n });\n } else { // we already have this language\n this.changeDefaultLang(lang);\n }\n }\n\n /**\n * Gets the default language used\n */\n public getDefaultLang(): string {\n return this.defaultLang;\n }\n\n /**\n * Changes the lang currently used\n */\n public use(lang: string): Observable<any> {\n // don't change the language if the language given is already selected\n if (lang === this.currentLang) {\n return of(this.translations[lang]);\n }\n\n let pending: Observable<any> = this.retrieveTranslations(lang);\n\n if (typeof pending !== \"undefined\") {\n // on init set the currentLang immediately\n if (!this.currentLang) {\n this.currentLang = lang;\n }\n\n pending.pipe(take(1))\n .subscribe((res: any) => {\n this.changeLang(lang);\n });\n\n return pending;\n } else { // we have this language, return an Observable\n this.changeLang(lang);\n\n return of(this.translations[lang]);\n }\n }\n\n /**\n * Retrieves the given translations\n */\n private retrieveTranslations(lang: string): Observable<any> {\n let pending: Observable<any>;\n\n // if this language is unavailable or extend is true, ask for it\n if (typeof this.translations[lang] === \"undefined\" || this.extend) {\n this._translationRequests[lang] = this._translationRequests[lang] || this.getTranslation(lang);\n pending = this._translationRequests[lang];\n }\n\n return pending;\n }\n\n /**\n * Gets an object of translations for a given language with the current loader\n * and passes it through the compiler\n */\n public getTranslation(lang: string): Observable<any> {\n this.pending = true;\n const loadingTranslations = this.currentLoader.getTranslation(lang).pipe(\n shareReplay(1),\n take(1),\n );\n\n this.loadingTranslations = loadingTranslations.pipe(\n map((res: Object) => this.compiler.compileTranslations(res, lang)),\n shareReplay(1),\n take(1),\n );\n\n this.loadingTranslations\n .subscribe({\n next: (res: Object) => {\n this.translations[lang] = this.extend && this.translations[lang] ? { ...res, ...this.translations[lang] } : res;\n this.updateLangs();\n this.pending = false;\n },\n error: (err: any) => {\n this.pending = false;\n }\n });\n\n return loadingTranslations;\n }\n\n /**\n * Manually sets an object of translations for a given language\n * after passing it through the compiler\n */\n public setTranslation(lang: string, translations: Object, shouldMerge: boolean = false): void {\n translations = this.compiler.compileTranslations(translations, lang);\n if ((shouldMerge || this.extend) && this.translations[lang]) {\n this.translations[lang] = mergeDeep(this.translations[lang], translations);\n } else {\n this.translations[lang] = translations;\n }\n this.updateLangs();\n this.onTranslationChange.emit({lang: lang, translations: this.translations[lang]});\n }\n\n /**\n * Returns an array of currently available langs\n */\n public getLangs(): Array<string> {\n return this.langs;\n }\n\n /**\n * Add available langs\n */\n public addLangs(langs: Array<string>): void {\n langs.forEach((lang: string) => {\n if (this.langs.indexOf(lang) === -1) {\n this.langs.push(lang);\n }\n });\n }\n\n /**\n * Update the list of available langs\n */\n private updateLangs(): void {\n this.addLangs(Object.keys(this.translations));\n }\n\n /**\n * Returns the parsed result of the translations\n */\n public getParsedResult(translations: any, key: any, interpolateParams?: Object): any {\n let res: string | Observable<string>;\n\n if (key instanceof Array) {\n let result: any = {},\n observables: boolean = false;\n for (let k of key) {\n result[k] = this.getParsedResult(translations, k, interpolateParams);\n if (isObservable(result[k])) {\n observables = true;\n }\n }\n if (observables) {\n const sources = key.map(k => isObservable(result[k]) ? result[k] : of(result[k] as string));\n return forkJoin(sources).pipe(\n map((arr: Array<string>) => {\n let obj: any = {};\n arr.forEach((value: string, index: number) => {\n obj[key[index]] = value;\n });\n return obj;\n })\n );\n }\n return result;\n }\n\n if (translations) {\n res = this.parser.interpolate(this.parser.getValue(translations, key), interpolateParams);\n }\n\n if (typeof res === \"undefined\" && this.defaultLang != null && this.defaultLang !== this.currentLang && this.useDefaultLang) {\n res = this.parser.interpolate(this.parser.getValue(this.translations[this.defaultLang], key), interpolateParams);\n }\n\n if (typeof res === \"undefined\") {\n let params: MissingTranslationHandlerParams = {key, translateService: this};\n if (typeof interpolateParams !== 'undefined') {\n params.interpolateParams = interpolateParams;\n }\n res = this.missingTranslationHandler.handle(params);\n }\n\n return typeof res !== \"undefined\" ? res : key;\n }\n\n /**\n * Gets the translated value of a key (or an array of keys)\n * @returns the translated key, or an object of translated keys\n */\n public get(key: string | Array<string>, interpolateParams?: Object): Observable<string | any> {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n // check if we are loading a new translation to use\n if (this.pending) {\n return this.loadingTranslations.pipe(\n concatMap((res: any) => {\n res = this.getParsedResult(res, key, interpolateParams);\n return isObservable(res) ? res : of(res);\n }),\n );\n } else {\n let res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams);\n return isObservable(res) ? res : of(res);\n }\n }\n\n /**\n * Returns a stream of translated values of a key (or an array of keys) which updates\n * whenever the translation changes.\n * @returns A stream of the translated key, or an object of translated keys\n */\n public getStreamOnTranslationChange(key: string | Array<string>, interpolateParams?: Object): Observable<string | any> {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n\n return concat(\n defer(() => this.get(key, interpolateParams)),\n this.onTranslationChange.pipe(\n switchMap((event: TranslationChangeEvent) => {\n const res = this.getParsedResult(event.translations, key, interpolateParams);\n if (typeof res.subscribe === 'function') {\n return res;\n } else {\n return of(res);\n }\n })\n )\n );\n }\n\n /**\n * Returns a stream of translated values of a key (or an array of keys) which updates\n * whenever the language changes.\n * @returns A stream of the translated key, or an object of translated keys\n */\n public stream(key: string | Array<string>, interpolateParams?: Object): Observable<string | any> {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n\n return concat(\n defer(() => this.get(key, interpolateParams)),\n this.onLangChange.pipe(\n switchMap((event: LangChangeEvent) => {\n const res = this.getParsedResult(event.translations, key, interpolateParams);\n return isObservable(res) ? res : of(res);\n })\n ));\n }\n\n /**\n * Returns a translation instantly from the internal state of loaded translation.\n * All rules regarding the current language, the preferred language of even fallback languages will be used except any promise handling.\n */\n public instant(key: string | Array<string>, interpolateParams?: Object): string | any {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n\n let res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams);\n if (isObservable(res)) {\n if (key instanceof Array) {\n let obj: any = {};\n key.forEach((value: string, index: number) => {\n obj[key[index]] = key[index];\n });\n return obj;\n }\n return key;\n } else {\n return res;\n }\n }\n\n /**\n * Sets the translated value of a key, after compiling it\n */\n public set(key: string, value: string, lang: string = this.currentLang): void {\n this.translations[lang][key] = this.compiler.compile(value, lang);\n this.updateLangs();\n this.onTranslationChange.emit({lang: lang, translations: this.translations[lang]});\n }\n\n /**\n * Changes the current lang\n */\n private changeLang(lang: string): void {\n this.currentLang = lang;\n this.onLangChange.emit({lang: lang, translations: this.translations[lang]});\n\n // if there is no default lang, use the one that we just set\n if (this.defaultLang == null) {\n this.changeDefaultLang(lang);\n }\n }\n\n /**\n * Changes the default lang\n */\n private changeDefaultLang(lang: string): void {\n this.defaultLang = lang;\n this.onDefaultLangChange.emit({lang: lang, translations: this.translations[lang]});\n }\n\n /**\n * Allows to reload the lang file from the file\n */\n public reloadLang(lang: string): Observable<any> {\n this.resetLang(lang);\n return this.getTranslation(lang);\n }\n\n /**\n * Deletes inner translation\n */\n public resetLang(lang: string): void {\n this._translationRequests[lang] = undefined;\n this.translations[lang] = undefined;\n }\n\n /**\n * Returns the language code name from the browser, e.g. \"de\"\n */\n public getBrowserLang(): string {\n if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {\n return undefined;\n }\n\n let browserLang: any = window.navigator.languages ? window.navigator.languages[0] : null;\n browserLang = browserLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage;\n\n if (typeof browserLang === 'undefined') {\n return undefined\n }\n\n if (browserLang.indexOf('-') !== -1) {\n browserLang = browserLang.split('-')[0];\n }\n\n if (browserLang.indexOf('_') !== -1) {\n browserLang = browserLang.split('_')[0];\n }\n\n return browserLang;\n }\n\n /**\n * Returns the culture language code name from the browser, e.g. \"de-DE\"\n */\n public getBrowserCultureLang(): string {\n if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {\n return undefined;\n }\n\n let browserCultureLang: any = window.navigator.languages ? window.navigator.languages[0] : null;\n browserCultureLang = browserCultureLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage;\n\n return browserCultureLang;\n }\n}\n","import {AfterViewChecked, ChangeDetectorRef, Directive, ElementRef, Input, OnDestroy} from '@angular/core';\nimport {Subscription, isObservable} from 'rxjs';\nimport {DefaultLangChangeEvent, LangChangeEvent, TranslateService, TranslationChangeEvent} from './translate.service';\nimport {equals, isDefined} from './util';\n\n@Directive({\n selector: '[translate],[ngx-translate]'\n})\nexport class TranslateDirective implements AfterViewChecked, OnDestroy {\n key: string;\n lastParams: any;\n currentParams: any;\n onLangChangeSub: Subscription;\n onDefaultLangChangeSub: Subscription;\n onTranslationChangeSub: Subscription;\n\n @Input() set translate(key: string) {\n if (key) {\n this.key = key;\n this.checkNodes();\n }\n }\n\n @Input() set translateParams(params: any) {\n if (!equals(this.currentParams, params)) {\n this.currentParams = params;\n this.checkNodes(true);\n }\n }\n\n constructor(private translateService: TranslateService, private element: ElementRef, private _ref: ChangeDetectorRef) {\n // subscribe to onTranslationChange event, in case the translations of the current lang change\n if (!this.onTranslationChangeSub) {\n this.onTranslationChangeSub = this.translateService.onTranslationChange.subscribe((event: TranslationChangeEvent) => {\n if (event.lang === this.translateService.currentLang) {\n this.checkNodes(true, event.translations);\n }\n });\n }\n\n // subscribe to onLangChange event, in case the language changes\n if (!this.onLangChangeSub) {\n this.onLangChangeSub = this.translateService.onLangChange.subscribe((event: LangChangeEvent) => {\n this.checkNodes(true, event.translations);\n });\n }\n\n // subscribe to onDefaultLangChange event, in case the default language changes\n if (!this.onDefaultLangChangeSub) {\n this.onDefaultLangChangeSub = this.translateService.onDefaultLangChange.subscribe((event: DefaultLangChangeEvent) => {\n this.checkNodes(true);\n });\n }\n }\n\n ngAfterViewChecked() {\n this.checkNodes();\n }\n\n checkNodes(forceUpdate = false, translations?: any) {\n let nodes: NodeList = this.element.nativeElement.childNodes;\n // if the element is empty\n if (!nodes.length) {\n // we add the key as content\n this.setContent(this.element.nativeElement, this.key);\n nodes = this.element.nativeElement.childNodes;\n }\n for (let i = 0; i < nodes.length; ++i) {\n let node: any = nodes[i];\n if (node.nodeType === 3) { // node type 3 is a text node\n let key: string;\n if (forceUpdate) {\n node.lastKey = null;\n }\n if(isDefined(node.lookupKey)) {\n key = node.lookupKey;\n } else if (this.key) {\n key = this.key;\n } else {\n let content = this.getContent(node);\n let trimmedContent = content.trim();\n if (trimmedContent.length) {\n node.lookupKey = trimmedContent;\n // we want to use the content as a key, not the translation value\n if (content !== node.currentValue) {\n key = trimmedContent;\n // the content was changed from the user, we'll use it as a reference if needed\n node.originalContent = content || node.originalContent;\n } else if (node.originalContent) { // the content seems ok, but the lang has changed\n // the current content is the translation, not the key, use the last real content as key\n key = node.originalContent.trim();\n } else if (content !== node.currentValue) {\n // we want to use the content as a key, not the translation value\n key = trimmedContent;\n // the content was changed from the user, we'll use it as a reference if needed\n node.originalContent = content || node.originalContent;\n }\n }\n }\n this.updateValue(key, node, translations);\n }\n }\n }\n\n updateValue(key: string, node: any, translations: any) {\n if (key) {\n if (node.lastKey === key && this.lastParams === this.currentParams) {\n return;\n }\n\n this.lastParams = this.currentParams;\n\n let onTranslation = (res: string) => {\n if (res !== key) {\n node.lastKey = key;\n }\n if (!node.originalContent) {\n node.originalContent = this.getContent(node);\n }\n node.currentValue = isDefined(res) ? res : (node.originalContent || key);\n // we replace in the original content to preserve spaces that we might have trimmed\n this.setContent(node, this.key ? node.currentValue : node.originalContent.replace(key, node.currentValue));\n this._ref.markForCheck();\n };\n\n if (isDefined(translations)) {\n let res = this.translateService.getParsedResult(translations, key, this.currentParams);\n if (isObservable(res)) {\n res.subscribe(onTranslation);\n } else {\n onTranslation(res);\n }\n } else {\n this.translateService.get(key, this.currentParams).subscribe(onTranslation);\n }\n }\n }\n\n getContent(node: any): string {\n return isDefined(node.textContent) ? node.textContent : node.data;\n }\n\n setContent(node: any, content: string): void {\n if (isDefined(node.textContent)) {\n node.textContent = content;\n } else {\n node.data = content;\n }\n }\n\n ngOnDestroy() {\n if (this.onLangChangeSub) {\n this.onLangChangeSub.unsubscribe();\n }\n\n if (this.onDefaultLangChangeSub) {\n this.onDefaultLangChangeSub.unsubscribe();\n }\n\n if (this.onTranslationChangeSub) {\n this.onTranslationChangeSub.unsubscribe();\n }\n }\n}\n","import {ChangeDetectorRef, EventEmitter, Injectable, OnDestroy, Pipe, PipeTransform} from '@angular/core';\nimport {isObservable} from 'rxjs';\nimport {DefaultLangChangeEvent, LangChangeEvent, TranslateService, TranslationChangeEvent} from './translate.service';\nimport {equals, isDefined} from './util';\nimport { Subscription } from 'rxjs';\n\n@Injectable()\n@Pipe({\n name: 'translate',\n pure: false // required to update the value when the promise is resolved\n})\nexport class TranslatePipe implements PipeTransform, OnDestroy {\n value: string = '';\n lastKey: string;\n lastParams: any[];\n onTranslationChange: Subscription;\n onLangChange: Subscription;\n onDefaultLangChange: Subscription;\n\n constructor(private translate: TranslateService, private _ref: ChangeDetectorRef) {\n }\n\n updateValue(key: string, interpolateParams?: Object, translations?: any): void {\n let onTranslation = (res: string) => {\n this.value = res !== undefined ? res : key;\n this.lastKey = key;\n this._ref.markForCheck();\n };\n if (translations) {\n let res = this.translate.getParsedResult(translations, key, interpolateParams);\n if (isObservable(res.subscribe)) {\n res.subscribe(onTranslation);\n } else {\n onTranslation(res);\n }\n }\n this.translate.get(key, interpolateParams).subscribe(onTranslation);\n }\n\n transform(query: string, ...args: any[]): any {\n if (!query || !query.length) {\n return query;\n }\n\n // if we ask another time for the same key, return the last value\n if (equals(query, this.lastKey) && equals(args, this.lastParams)) {\n return this.value;\n }\n\n let interpolateParams: Object;\n if (isDefined(args[0]) && args.length) {\n if (typeof args[0] === 'string' && args[0].length) {\n // we accept objects written in the template such as {n:1}, {'n':1}, {n:'v'}\n // which is why we might need to change it to real JSON objects such as {\"n\":1} or {\"n\":\"v\"}\n let validArgs: string = args[0]\n .replace(/(\\')?([a-zA-Z0-9_]+)(\\')?(\\s)?:/g, '\"$2\":')\n .replace(/:(\\s)?(\\')(.*?)(\\')/g, ':\"$3\"');\n try {\n interpolateParams = JSON.parse(validArgs);\n } catch (e) {\n throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${args[0]}`);\n }\n } else if (typeof args[0] === 'object' && !Array.isArray(args[0])) {\n interpolateParams = args[0];\n }\n }\n\n // store the query, in case it changes\n this.lastKey = query;\n\n // store the params, in case they change\n this.lastParams = args;\n\n // set the value\n this.updateValue(query, interpolateParams);\n\n // if there is a subscription to onLangChange, clean it\n this._dispose();\n\n // subscribe to onTranslationChange event, in case the translations change\n if (!this.onTranslationChange) {\n this.onTranslationChange = this.translate.onTranslationChange.subscribe((event: TranslationChangeEvent) => {\n if (this.lastKey && event.lang === this.translate.currentLang) {\n this.lastKey = null;\n this.updateValue(query, interpolateParams, event.translations);\n }\n });\n }\n\n // subscribe to onLangChange event, in case the language changes\n if (!this.onLangChange) {\n this.onLangChange = this.translate.onLangChange.subscribe((event: LangChangeEvent) => {\n if (this.lastKey) {\n this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated\n this.updateValue(query, interpolateParams, event.translations);\n }\n });\n }\n\n // subscribe to onDefaultLangChange event, in case the default language changes\n if (!this.onDefaultLangChange) {\n this.onDefaultLangChange = this.translate.onDefaultLangChange.subscribe(() => {\n if (this.lastKey) {\n this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated\n this.updateValue(query, interpolateParams);\n }\n });\n }\n\n return this.value;\n }\n\n /**\n * Clean any existing subscription to change events\n */\n private _dispose(): void {\n if (typeof this.onTranslationChange !== 'undefined') {\n this.onTranslationChange.unsubscribe();\n this.onTranslationChange = undefined;\n }\n if (typeof this.onLangChange !== 'undefined') {\n this.onLangChange.unsubscribe();\n this.onLangChange = undefined;\n }\n if (typeof this.onDefaultLangChange !== 'undefined') {\n this.onDefaultLangChange.unsubscribe();\n this.onDefaultLangChange = undefined;\n }\n }\n\n ngOnDestroy(): void {\n this._dispose();\n }\n}\n","import {NgModule, ModuleWithProviders, Provider} from \"@angular/core\";\nimport {TranslateLoader, TranslateFakeLoader} from \"./lib/translate.loader\";\nimport {MissingTranslationHandler, FakeMissingTranslationHandler} from \"./lib/missing-translation-handler\";\nimport {TranslateParser, TranslateDefaultParser} from \"./lib/translate.parser\";\nimport {TranslateCompiler, TranslateFakeCompiler} from \"./lib/translate.compiler\";\nimport {TranslateDirective} from \"./lib/translate.directive\";\nimport {TranslatePipe} from \"./lib/translate.pipe\";\nimport {TranslateStore} from \"./lib/translate.store\";\nimport {USE_DEFAULT_LANG, DEFAULT_LANGUAGE, USE_STORE, TranslateService, USE_EXTEND} from \"./lib/translate.service\";\n\nexport * from \"./lib/translate.loader\";\nexport * from \"./lib/translate.service\";\nexport * from \"./lib/missing-translation-handler\";\nexport * from \"./lib/translate.parser\";\nexport * from \"./lib/translate.compiler\";\nexport * from \"./lib/translate.directive\";\nexport * from \"./lib/translate.pipe\";\nexport * from \"./lib/translate.store\";\n\nexport interface TranslateModuleConfig {\n loader?: Provider;\n compiler?: Provider;\n parser?: Provider;\n missingTranslationHandler?: Provider;\n // isolate the service instance, only works for lazy loaded modules or components with the \"providers\" property\n isolate?: boolean;\n // extends translations for a given language instead of ignoring them if present\n extend?: boolean;\n useDefaultLang?: boolean;\n defaultLanguage?: string;\n}\n\n@NgModule({\n declarations: [\n TranslatePipe,\n TranslateDirective\n ],\n exports: [\n TranslatePipe,\n TranslateDirective\n ]\n})\nexport class TranslateModule {\n /**\n * Use this method in your root module to provide the TranslateService\n */\n static forRoot(config: TranslateModuleConfig = {}): ModuleWithProviders<TranslateModule> {\n return {\n ngModule: TranslateModule,\n providers: [\n config.loader || {provide: TranslateLoader, useClass: TranslateFakeLoader},\n config.compiler || {provide: TranslateCompiler, useClass: TranslateFakeCompiler},\n config.parser || {provide: TranslateParser, useClass: TranslateDefaultParser},\n config.missingTranslationHandler || {provide: MissingTranslationHandler, useClass: FakeMissingTranslationHandler},\n TranslateStore,\n {provide: USE_STORE, useValue: config.isolate},\n {provide: USE_DEFAULT_LANG, useValue: config.useDefaultLang},\n {provide: USE_EXTEND, useValue: config.extend},\n {provide: DEFAULT_LANGUAGE, useValue: config.defaultLanguage},\n TranslateService\n ]\n };\n }\n\n /**\n * Use this method in your other (non root) modules to import the directive/pipe\n */\n static forChild(config: TranslateModuleConfig = {}): ModuleWithProviders<TranslateModule> {\n return {\n ngModule: TranslateModule,\n providers: [\n config.loader || {provide: TranslateLoader, useClass: TranslateFakeLoader},\n config.compiler || {provide: TranslateCompiler, useClass: TranslateFakeCompiler},\n config.parser || {provide: TranslateParser, useClass: TranslateDefaultParser},\n config.missingTranslationHandler || {provide: MissingTranslationHandler, useClass: FakeMissingTranslationHandler},\n {provide: USE_STORE, useValue: config.isolate},\n {provide: USE_DEFAULT_LANG, useValue: config.useDefaultLang},\n {provide: USE_EXTEND, useValue: config.extend},\n {provide: DEFAULT_LANGUAGE, useValue: config.defaultLanguage},\n TranslateService\n ]\n };\n }\n}\n"]} \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/core/esm2015/lib/missing-translation-handler.js b/frontend/node_modules/@ngx-translate/core/esm2015/lib/missing-translation-handler.js new file mode 100644 index 000000000..3333d797e --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/esm2015/lib/missing-translation-handler.js @@ -0,0 +1,61 @@ +/** + * @fileoverview added by tsickle + * Generated from: lib/missing-translation-handler.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +import { Injectable } from "@angular/core"; +/** + * @record + */ +export function MissingTranslationHandlerParams() { } +if (false) { + /** + * the key that's missing in translation files + * @type {?} + */ + MissingTranslationHandlerParams.prototype.key; + /** + * an instance of the service that was unable to translate the key. + * @type {?} + */ + MissingTranslationHandlerParams.prototype.translateService; + /** + * interpolation params that were passed along for translating the given key. + * @type {?|undefined} + */ + MissingTranslationHandlerParams.prototype.interpolateParams; +} +/** + * @abstract + */ +export class MissingTranslationHandler { +} +if (false) { + /** + * A function that handles missing translations. + * + * @abstract + * @param {?} params context for resolving a missing translation + * @return {?} a value or an observable + * If it returns a value, then this value is used. + * If it return an observable, the value returned by this observable will be used (except if the method was "instant"). + * If it doesn't return then the key will be used as a value + */ + MissingTranslationHandler.prototype.handle = function (params) { }; +} +/** + * This handler is just a placeholder that does nothing, in case you don't need a missing translation handler at all + */ +export class FakeMissingTranslationHandler { + /** + * @param {?} params + * @return {?} + */ + handle(params) { + return params.key; + } +} +FakeMissingTranslationHandler.decorators = [ + { type: Injectable } +]; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlzc2luZy10cmFuc2xhdGlvbi1oYW5kbGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXRyYW5zbGF0ZS9jb3JlL3NyYy9saWIvbWlzc2luZy10cmFuc2xhdGlvbi1oYW5kbGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFDLFVBQVUsRUFBQyxNQUFNLGVBQWUsQ0FBQzs7OztBQUd6QyxxREFlQzs7Ozs7O0lBWEMsOENBQVk7Ozs7O0lBS1osMkRBQW1DOzs7OztJQUtuQyw0REFBMkI7Ozs7O0FBRzdCLE1BQU0sT0FBZ0IseUJBQXlCO0NBVzlDOzs7Ozs7Ozs7Ozs7SUFEQyxtRUFBOEQ7Ozs7O0FBT2hFLE1BQU0sT0FB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ybnMgYSB2YWx1ZSBvciBhbiBvYnNlcnZhYmxlXG4gICAqIElmIGl0IHJldHVybnMgYSB2YWx1ZSwgdGhlbiB0aGlzIHZhbHVlIGlzIHVzZWQuXG4gICAqIElmIGl0IHJldHVybiBhbiBvYnNlcnZhYmxlLCB0aGUgdmFsdWUgcmV0dXJuZWQgYnkgdGhpcyBvYnNlcnZhYmxlIHdpbGwgYmUgdXNlZCAoZXhjZXB0IGlmIHRoZSBtZXRob2Qgd2FzIFwiaW5zdGFudFwiKS5cbiAgICogSWYgaXQgZG9lc24ndCByZXR1cm4gdGhlbiB0aGUga2V5IHdpbGwgYmUgdXNlZCBhcyBhIHZhbHVlXG4gICAqL1xuICBhYnN0cmFjdCBoYW5kbGUocGFyYW1zOiBNaXNzaW5nVHJhbnNsYXRpb25IYW5kbGVyUGFyYW1zKTogYW55O1xufVxuXG4vKipcbiAqIFRoaXMgaGFuZGxlciBpcyBqdXN0IGEgcGxhY2Vob2xkZXIgdGhhdCBkb2VzIG5vdGhpbmcsIGluIGNhc2UgeW91IGRvbid0IG5lZWQgYSBtaXNzaW5nIHRyYW5zbGF0aW9uIGhhbmRsZXIgYXQgYWxsXG4gKi9cbkBJbmplY3RhYmxlKClcbmV4cG9ydCBjbGFzcyBGYWtlTWlzc2luZ1RyYW5zbGF0aW9uSGFuZGxlciBpbXBsZW1lbnRzIE1pc3NpbmdUcmFuc2xhdGlvbkhhbmRsZXIge1xuICBoYW5kbGUocGFyYW1zOiBNaXNzaW5nVHJhbnNsYXRpb25IYW5kbGVyUGFyYW1zKTogc3RyaW5nIHtcbiAgICByZXR1cm4gcGFyYW1zLmtleTtcbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.compiler.js b/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.compiler.js new file mode 100644 index 000000000..06c3a3872 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.compiler.js @@ -0,0 +1,52 @@ +/** + * @fileoverview added by tsickle + * Generated from: lib/translate.compiler.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +import { Injectable } from "@angular/core"; +/** + * @abstract + */ +export class TranslateCompiler { +} +if (false) { + /** + * @abstract + * @param {?} value + * @param {?} lang + * @return {?} + */ + TranslateCompiler.prototype.compile = function (value, lang) { }; + /** + * @abstract + * @param {?} translations + * @param {?} lang + * @return {?} + */ + TranslateCompiler.prototype.compileTranslations = function (translations, lang) { }; +} +/** + * This compiler is just a placeholder that does nothing, in case you don't need a compiler at all + */ +export class TranslateFakeCompiler extends TranslateCompiler { + /** + * @param {?} value + * @param {?} lang + * @return {?} + */ + compile(value, lang) { + return value; + } + /** + * @param {?} translations + * @param {?} lang + * @return {?} + */ + compileTranslations(translations, lang) { + return translations; + } +} +TranslateFakeCompiler.decorators = [ + { type: Injectable } +]; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRlLmNvbXBpbGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXRyYW5zbGF0ZS9jb3JlL3NyYy9saWIvdHJhbnNsYXRlLmNvbXBpbGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFDLFVBQVUsRUFBQyxNQUFNLGVBQWUsQ0FBQzs7OztBQUV6QyxNQUFNLE9BQWdCLGlCQUFpQjtDQUl0Qzs7Ozs7Ozs7SUFIQyxpRUFBaUU7Ozs7Ozs7SUFFakUsb0ZBQW1FOzs7OztBQU9yRSxNQUFNLE9BQU8scUJBQXNCLFNBQVEsaUJBQWlCOzs7Ozs7SUFDMUQsT0FBTyxDQUFDLEtBQWEsRUFBRSxJQUFZO1FBQ2pDLE9BQU8sS0FBSyxDQUFDO0lBQ2YsQ0FBQzs7Ozs7O0lBRUQsbUJBQW1CLENBQUMsWUFBaUIsRUFBRSxJQUFZO1FBQ2pELE9BQU8sWUFBWSxDQUFDO0lBQ3RCLENBQUM7OztZQVJGLFVBQVUiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge0luamVjdGFibGV9IGZyb20gXCJAYW5ndWxhci9jb3JlXCI7XG5cbmV4cG9ydCBhYnN0cmFjdCBjbGFzcyBUcmFuc2xhdGVDb21waWxlciB7XG4gIGFic3RyYWN0IGNvbXBpbGUodmFsdWU6IHN0cmluZywgbGFuZzogc3RyaW5nKTogc3RyaW5nIHwgRnVuY3Rpb247XG5cbiAgYWJzdHJhY3QgY29tcGlsZVRyYW5zbGF0aW9ucyh0cmFuc2xhdGlvbnM6IGFueSwgbGFuZzogc3RyaW5nKTogYW55O1xufVxuXG4vKipcbiAqIFRoaXMgY29tcGlsZXIgaXMganVzdCBhIHBsYWNlaG9sZGVyIHRoYXQgZG9lcyBub3RoaW5nLCBpbiBjYXNlIHlvdSBkb24ndCBuZWVkIGEgY29tcGlsZXIgYXQgYWxsXG4gKi9cbkBJbmplY3RhYmxlKClcbmV4cG9ydCBjbGFzcyBUcmFuc2xhdGVGYWtlQ29tcGlsZXIgZXh0ZW5kcyBUcmFuc2xhdGVDb21waWxlciB7XG4gIGNvbXBpbGUodmFsdWU6IHN0cmluZywgbGFuZzogc3RyaW5nKTogc3RyaW5nIHwgRnVuY3Rpb24ge1xuICAgIHJldHVybiB2YWx1ZTtcbiAgfVxuXG4gIGNvbXBpbGVUcmFuc2xhdGlvbnModHJhbnNsYXRpb25zOiBhbnksIGxhbmc6IHN0cmluZyk6IGFueSB7XG4gICAgcmV0dXJuIHRyYW5zbGF0aW9ucztcbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.directive.js b/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.directive.js new file mode 100644 index 000000000..61ecd8d48 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.directive.js @@ -0,0 +1,261 @@ +/** + * @fileoverview added by tsickle + * Generated from: lib/translate.directive.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +import { ChangeDetectorRef, Directive, ElementRef, Input } from '@angular/core'; +import { isObservable } from 'rxjs'; +import { TranslateService } from './translate.service'; +import { equals, isDefined } from './util'; +export class TranslateDirective { + /** + * @param {?} translateService + * @param {?} element + * @param {?} _ref + */ + constructor(translateService, element, _ref) { + this.translateService = translateService; + this.element = element; + this._ref = _ref; + // subscribe to onTranslationChange event, in case the translations of the current lang change + if (!this.onTranslationChangeSub) { + this.onTranslationChangeSub = this.translateService.onTranslationChange.subscribe((/** + * @param {?} event + * @return {?} + */ + (event) => { + if (event.lang === this.translateService.currentLang) { + this.checkNodes(true, event.translations); + } + })); + } + // subscribe to onLangChange event, in case the language changes + if (!this.onLangChangeSub) { + this.onLangChangeSub = this.translateService.onLangChange.subscribe((/** + * @param {?} event + * @return {?} + */ + (event) => { + this.checkNodes(true, event.translations); + })); + } + // subscribe to onDefaultLangChange event, in case the default language changes + if (!this.onDefaultLangChangeSub) { + this.onDefaultLangChangeSub = this.translateService.onDefaultLangChange.subscribe((/** + * @param {?} event + * @return {?} + */ + (event) => { + this.checkNodes(true); + })); + } + } + /** + * @param {?} key + * @return {?} + */ + set translate(key) { + if (key) { + this.key = key; + this.checkNodes(); + } + } + /** + * @param {?} params + * @return {?} + */ + set translateParams(params) { + if (!equals(this.currentParams, params)) { + this.currentParams = params; + this.checkNodes(true); + } + } + /** + * @return {?} + */ + ngAfterViewChecked() { + this.checkNodes(); + } + /** + * @param {?=} forceUpdate + * @param {?=} translations + * @return {?} + */ + checkNodes(forceUpdate = false, translations) { + /** @type {?} */ + let nodes = this.element.nativeElement.childNodes; + // if the element is empty + if (!nodes.length) { + // we add the key as content + this.setContent(this.element.nativeElement, this.key); + nodes = this.element.nativeElement.childNodes; + } + for (let i = 0; i < nodes.length; ++i) { + /** @type {?} */ + let node = nodes[i]; + if (node.nodeType === 3) { // node type 3 is a text node + // node type 3 is a text node + /** @type {?} */ + let key; + if (forceUpdate) { + node.lastKey = null; + } + if (isDefined(node.lookupKey)) { + key = node.lookupKey; + } + else if (this.key) { + key = this.key; + } + else { + /** @type {?} */ + let content = this.getContent(node); + /** @type {?} */ + let trimmedContent = content.trim(); + if (trimmedContent.length) { + node.lookupKey = trimmedContent; + // we want to use the content as a key, not the translation value + if (content !== node.currentValue) { + key = trimmedContent; + // the content was changed from the user, we'll use it as a reference if needed + node.originalContent = content || node.originalContent; + } + else if (node.originalContent) { // the content seems ok, but the lang has changed + // the current content is the translation, not the key, use the last real content as key + key = node.originalContent.trim(); + } + else if (content !== node.currentValue) { + // we want to use the content as a key, not the translation value + key = trimmedContent; + // the content was changed from the user, we'll use it as a reference if needed + node.originalContent = content || node.originalContent; + } + } + } + this.updateValue(key, node, translations); + } + } + } + /** + * @param {?} key + * @param {?} node + * @param {?} translations + * @return {?} + */ + updateValue(key, node, translations) { + if (key) { + if (node.lastKey === key && this.lastParams === this.currentParams) { + return; + } + this.lastParams = this.currentParams; + /** @type {?} */ + let onTranslation = (/** + * @param {?} res + * @return {?} + */ + (res) => { + if (res !== key) { + node.lastKey = key; + } + if (!node.originalContent) { + node.originalContent = this.getContent(node); + } + node.currentValue = isDefined(res) ? res : (node.originalContent || key); + // we replace in the original content to preserve spaces that we might have trimmed + this.setContent(node, this.key ? node.currentValue : node.originalContent.replace(key, node.currentValue)); + this._ref.markForCheck(); + }); + if (isDefined(translations)) { + /** @type {?} */ + let res = this.translateService.getParsedResult(translations, key, this.currentParams); + if (isObservable(res)) { + res.subscribe(onTranslation); + } + else { + onTranslation(res); + } + } + else { + this.translateService.get(key, this.currentParams).subscribe(onTranslation); + } + } + } + /** + * @param {?} node + * @return {?} + */ + getContent(node) { + return isDefined(node.textContent) ? node.textContent : node.data; + } + /** + * @param {?} node + * @param {?} content + * @return {?} + */ + setContent(node, content) { + if (isDefined(node.textContent)) { + node.textContent = content; + } + else { + node.data = content; + } + } + /** + * @return {?} + */ + ngOnDestroy() { + if (this.onLangChangeSub) { + this.onLangChangeSub.unsubscribe(); + } + if (this.onDefaultLangChangeSub) { + this.onDefaultLangChangeSub.unsubscribe(); + } + if (this.onTranslationChangeSub) { + this.onTranslationChangeSub.unsubscribe(); + } + } +} +TranslateDirective.decorators = [ + { type: Directive, args: [{ + selector: '[translate],[ngx-translate]' + },] } +]; +/** @nocollapse */ +TranslateDirective.ctorParameters = () => [ + { type: TranslateService }, + { type: ElementRef }, + { type: ChangeDetectorRef } +]; +TranslateDirective.propDecorators = { + translate: [{ type: Input }], + translateParams: [{ type: Input }] +}; +if (false) { + /** @type {?} */ + TranslateDirective.prototype.key; + /** @type {?} */ + TranslateDirective.prototype.lastParams; + /** @type {?} */ + TranslateDirective.prototype.currentParams; + /** @type {?} */ + TranslateDirective.prototype.onLangChangeSub; + /** @type {?} */ + TranslateDirective.prototype.onDefaultLangChangeSub; + /** @type {?} */ + TranslateDirective.prototype.onTranslationChangeSub; + /** + * @type {?} + * @private + */ + TranslateDirective.prototype.translateService; + /** + * @type {?} + * @private + */ + TranslateDirective.prototype.element; + /** + * @type {?} + * @private + */ + TranslateDirective.prototype._ref; +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRlLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC10cmFuc2xhdGUvY29yZS9zcmMvbGliL3RyYW5zbGF0ZS5kaXJlY3RpdmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxPQUFPLEVBQW1CLGlCQUFpQixFQUFFLFNBQVMsRUFBRSxVQUFVLEVBQUUsS0FBSyxFQUFZLE1BQU0sZUFBZSxDQUFD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gICAgIHRoaXMub25MYW5nQ2hhbmdlU3ViLnVuc3Vic2NyaWJlKCk7XG4gICAgfVxuXG4gICAgaWYgKHRoaXMub25EZWZhdWx0TGFuZ0NoYW5nZVN1Yikge1xuICAgICAgdGhpcy5vbkRlZmF1bHRMYW5nQ2hhbmdlU3ViLnVuc3Vic2NyaWJlKCk7XG4gICAgfVxuXG4gICAgaWYgKHRoaXMub25UcmFuc2xhdGlvbkNoYW5nZVN1Yikge1xuICAgICAgdGhpcy5vblRyYW5zbGF0aW9uQ2hhbmdlU3ViLnVuc3Vic2NyaWJlKCk7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.loader.js b/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.loader.js new file mode 100644 index 000000000..10de16cf6 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.loader.js @@ -0,0 +1,36 @@ +/** + * @fileoverview added by tsickle + * Generated from: lib/translate.loader.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +import { Injectable } from "@angular/core"; +import { of } from "rxjs"; +/** + * @abstract + */ +export class TranslateLoader { +} +if (false) { + /** + * @abstract + * @param {?} lang + * @return {?} + */ + TranslateLoader.prototype.getTranslation = function (lang) { }; +} +/** + * This loader is just a placeholder that does nothing, in case you don't need a loader at all + */ +export class TranslateFakeLoader extends TranslateLoader { + /** + * @param {?} lang + * @return {?} + */ + getTranslation(lang) { + return of({}); + } +} +TranslateFakeLoader.decorators = [ + { type: Injectable } +]; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRlLmxvYWRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC10cmFuc2xhdGUvY29yZS9zcmMvbGliL3RyYW5z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translate/core/esm2015/lib/translate.parser.js b/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.parser.js new file mode 100644 index 000000000..bc17e1ba2 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.parser.js @@ -0,0 +1,120 @@ +/** + * @fileoverview added by tsickle + * Generated from: lib/translate.parser.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +import { Injectable } from "@angular/core"; +import { isDefined } from "./util"; +/** + * @abstract + */ +export class TranslateParser { +} +if (false) { + /** + * Interpolates a string to replace parameters + * "This is a {{ key }}" ==> "This is a value", with params = { key: "value" } + * @abstract + * @param {?} expr + * @param {?=} params + * @return {?} + */ + TranslateParser.prototype.interpolate = function (expr, params) { }; + /** + * Gets a value from an object by composed key + * parser.getValue({ key1: { keyA: 'valueI' }}, 'key1.keyA') ==> 'valueI' + * @abstract + * @param {?} target + * @param {?} key + * @return {?} + */ + TranslateParser.prototype.getValue = function (target, key) { }; +} +export class TranslateDefaultParser extends TranslateParser { + constructor() { + super(...arguments); + this.templateMatcher = /{{\s?([^{}\s]*)\s?}}/g; + } + /** + * @param {?} expr + * @param {?=} params + * @return {?} + */ + interpolate(expr, params) { + /** @type {?} */ + let result; + if (typeof expr === 'string') { + result = this.interpolateString(expr, params); + } + else if (typeof expr === 'function') { + result = this.interpolateFunction(expr, params); + } + else { + // this should not happen, but an unrelated TranslateService test depends on it + result = (/** @type {?} */ (expr)); + } + return result; + } + /** + * @param {?} target + * @param {?} key + * @return {?} + */ + getValue(target, key) { + /** @type {?} */ + let keys = typeof key === 'string' ? key.split('.') : [key]; + key = ''; + do { + key += keys.shift(); + if (isDefined(target) && isDefined(target[key]) && (typeof target[key] === 'object' || !keys.length)) { + target = target[key]; + key = ''; + } + else if (!keys.length) { + target = undefined; + } + else { + key += '.'; + } + } while (keys.length); + return target; + } + /** + * @private + * @param {?} fn + * @param {?=} params + * @return {?} + */ + interpolateFunction(fn, params) { + return fn(params); + } + /** + * @private + * @param {?} expr + * @param {?=} params + * @return {?} + */ + interpolateString(expr, params) { + if (!params) { + return expr; + } + return expr.replace(this.templateMatcher, (/** + * @param {?} substring + * @param {?} b + * @return {?} + */ + (substring, b) => { + /** @type {?} */ + let r = this.getValue(params, b); + return isDefined(r) ? r : substring; + })); + } +} +TranslateDefaultParser.decorators = [ + { type: Injectable } +]; +if (false) { + /** @type {?} */ + TranslateDefaultParser.prototype.templateMatcher; +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRlLnBhcnNlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC10cmFuc2xhdGUvY29yZS9zcmMvbGliL3RyYW5zbGF0ZS5wYXJzZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxPQUFPLEVBQUMsVUFBVSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQ3pDLE9BQU8sRUFBQyxTQUFTLEVBQUMsTUFBTSxRQUFRLENBQUM7Ozs7QUFFakMsTUFBTSxPQUFnQixlQUFlO0NBZ0JwQzs7Ozs7Ozs7OztJQVRDLG9FQUFvRTs7Ozs7Ozs7O0lBUXBFLGdFQUFnRDs7QUFJbEQsTUFBTSxPQUFPLHNCQUF1QixTQUFRLGVBQWU7SUFEM0Q7O1FBRUUsb0JBQWUsR0FBVyx1QkFBdUIsQ0FBQztJQWlEcEQsQ0FBQzs7Ozs7O0lBL0NRLFdBQVcsQ0FBQyxJQUF1QixFQUFFLE1BQVk7O1lBQ2xELE1BQWM7UUFFbEIsSUFBSSxPQUFPLElBQUksS0FBSyxRQUFRLEVBQUU7WUFDNUIsTUFBTSxHQUFHLElBQUksQ0FBQyxpQkFBaUIsQ0FBQyxJQUFJLEVBQUUsTUFBTSxDQUFDLENBQUM7U0FDL0M7YUFBTSxJ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ZXIsIChzdWJzdHJpbmc6IHN0cmluZywgYjogc3RyaW5nKSA9PiB7XG4gICAgICBsZXQgciA9IHRoaXMuZ2V0VmFsdWUocGFyYW1zLCBiKTtcbiAgICAgIHJldHVybiBpc0RlZmluZWQocikgPyByIDogc3Vic3RyaW5nO1xuICAgIH0pO1xuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.pipe.js b/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.pipe.js new file mode 100644 index 000000000..96d05f6e7 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.pipe.js @@ -0,0 +1,193 @@ +/** + * @fileoverview added by tsickle + * Generated from: lib/translate.pipe.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +import { ChangeDetectorRef, Injectable, Pipe } from '@angular/core'; +import { isObservable } from 'rxjs'; +import { TranslateService } from './translate.service'; +import { equals, isDefined } from './util'; +export class TranslatePipe { + /** + * @param {?} translate + * @param {?} _ref + */ + constructor(translate, _ref) { + this.translate = translate; + this._ref = _ref; + this.value = ''; + } + /** + * @param {?} key + * @param {?=} interpolateParams + * @param {?=} translations + * @return {?} + */ + updateValue(key, interpolateParams, translations) { + /** @type {?} */ + let onTranslation = (/** + * @param {?} res + * @return {?} + */ + (res) => { + this.value = res !== undefined ? res : key; + this.lastKey = key; + this._ref.markForCheck(); + }); + if (translations) { + /** @type {?} */ + let res = this.translate.getParsedResult(translations, key, interpolateParams); + if (isObservable(res.subscribe)) { + res.subscribe(onTranslation); + } + else { + onTranslation(res); + } + } + this.translate.get(key, interpolateParams).subscribe(onTranslation); + } + /** + * @param {?} query + * @param {...?} args + * @return {?} + */ + transform(query, ...args) { + if (!query || !query.length) { + return query; + } + // if we ask another time for the same key, return the last value + if (equals(query, this.lastKey) && equals(args, this.lastParams)) { + return this.value; + } + /** @type {?} */ + let interpolateParams; + if (isDefined(args[0]) && args.length) { + if (typeof args[0] === 'string' && args[0].length) { + // we accept objects written in the template such as {n:1}, {'n':1}, {n:'v'} + // which is why we might need to change it to real JSON objects such as {"n":1} or {"n":"v"} + /** @type {?} */ + let validArgs = args[0] + .replace(/(\')?([a-zA-Z0-9_]+)(\')?(\s)?:/g, '"$2":') + .replace(/:(\s)?(\')(.*?)(\')/g, ':"$3"'); + try { + interpolateParams = JSON.parse(validArgs); + } + catch (e) { + throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${args[0]}`); + } + } + else if (typeof args[0] === 'object' && !Array.isArray(args[0])) { + interpolateParams = args[0]; + } + } + // store the query, in case it changes + this.lastKey = query; + // store the params, in case they change + this.lastParams = args; + // set the value + this.updateValue(query, interpolateParams); + // if there is a subscription to onLangChange, clean it + this._dispose(); + // subscribe to onTranslationChange event, in case the translations change + if (!this.onTranslationChange) { + this.onTranslationChange = this.translate.onTranslationChange.subscribe((/** + * @param {?} event + * @return {?} + */ + (event) => { + if (this.lastKey && event.lang === this.translate.currentLang) { + this.lastKey = null; + this.updateValue(query, interpolateParams, event.translations); + } + })); + } + // subscribe to onLangChange event, in case the language changes + if (!this.onLangChange) { + this.onLangChange = this.translate.onLangChange.subscribe((/** + * @param {?} event + * @return {?} + */ + (event) => { + if (this.lastKey) { + this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated + this.updateValue(query, interpolateParams, event.translations); + } + })); + } + // subscribe to onDefaultLangChange event, in case the default language changes + if (!this.onDefaultLangChange) { + this.onDefaultLangChange = this.translate.onDefaultLangChange.subscribe((/** + * @return {?} + */ + () => { + if (this.lastKey) { + this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated + this.updateValue(query, interpolateParams); + } + })); + } + return this.value; + } + /** + * Clean any existing subscription to change events + * @private + * @return {?} + */ + _dispose() { + if (typeof this.onTranslationChange !== 'undefined') { + this.onTranslationChange.unsubscribe(); + this.onTranslationChange = undefined; + } + if (typeof this.onLangChange !== 'undefined') { + this.onLangChange.unsubscribe(); + this.onLangChange = undefined; + } + if (typeof this.onDefaultLangChange !== 'undefined') { + this.onDefaultLangChange.unsubscribe(); + this.onDefaultLangChange = undefined; + } + } + /** + * @return {?} + */ + ngOnDestroy() { + this._dispose(); + } +} +TranslatePipe.decorators = [ + { type: Injectable }, + { type: Pipe, args: [{ + name: 'translate', + pure: false // required to update the value when the promise is resolved + },] } +]; +/** @nocollapse */ +TranslatePipe.ctorParameters = () => [ + { type: TranslateService }, + { type: ChangeDetectorRef } +]; +if (false) { + /** @type {?} */ + TranslatePipe.prototype.value; + /** @type {?} */ + TranslatePipe.prototype.lastKey; + /** @type {?} */ + TranslatePipe.prototype.lastParams; + /** @type {?} */ + TranslatePipe.prototype.onTranslationChange; + /** @type {?} */ + TranslatePipe.prototype.onLangChange; + /** @type {?} */ + TranslatePipe.prototype.onDefaultLangChange; + /** + * @type {?} + * @private + */ + TranslatePipe.prototype.translate; + /** + * @type {?} + * @private + */ + TranslatePipe.prototype._ref; +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRlLnBpcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtdHJhbnNsYXRlL2NvcmUvc3JjL2xpYi90cmFuc2xhdGUucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFBQyxpQkFBaUIsRUFBZ0IsVUFBVSxFQUFhLElBQUksRUFBZ0IsTUFBTSxlQUFlLENBQUM7QUFDMUcsT0FBTyxFQUFDLFlBQVksRUFBQyxNQUFNLE1BQU0sQ0FBQztBQUNsQyxPQUFPLEVBQTBDLGdCQUFnQixFQUF5QixNQUFNLHFCQUFxQixDQUFDO0FBQ3RILE9BQU8sRUFBQyxNQUFNLEVBQUUsU0FBUyxFQUFDLE1BQU0sUUFBUSxDQUFDO0FBUXpD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HtcbiAgICAgIHRoaXMub25UcmFuc2xhdGlvbkNoYW5nZS51bnN1YnNjcmliZSgpO1xuICAgICAgdGhpcy5vblRyYW5zbGF0aW9uQ2hhbmdlID0gdW5kZWZpbmVkO1xuICAgIH1cbiAgICBpZiAodHlwZW9mIHRoaXMub25MYW5nQ2hhbmdlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgdGhpcy5vbkxhbmdDaGFuZ2UudW5zdWJzY3JpYmUoKTtcbiAgICAgIHRoaXMub25MYW5nQ2hhbmdlID0gdW5kZWZpbmVkO1xuICAgIH1cbiAgICBpZiAodHlwZW9mIHRoaXMub25EZWZhdWx0TGFuZ0NoYW5nZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgIHRoaXMub25EZWZhdWx0TGFuZ0NoYW5nZS51bnN1YnNjcmliZSgpO1xuICAgICAgdGhpcy5vbkRlZmF1bHRMYW5nQ2hhbmdlID0gdW5kZWZpbmVkO1xuICAgIH1cbiAgfVxuXG4gIG5nT25EZXN0cm95KCk6IHZvaWQge1xuICAgIHRoaXMuX2Rpc3Bvc2UoKTtcbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.service.js b/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.service.js new file mode 100644 index 000000000..28377d835 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.service.js @@ -0,0 +1,722 @@ +/** + * @fileoverview added by tsickle + * Generated from: lib/translate.service.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +import { EventEmitter, Inject, Injectable, InjectionToken } from "@angular/core"; +import { concat, forkJoin, isObservable, of, defer } from "rxjs"; +import { concatMap, map, shareReplay, switchMap, take } from "rxjs/operators"; +import { MissingTranslationHandler } from "./missing-translation-handler"; +import { TranslateCompiler } from "./translate.compiler"; +import { TranslateLoader } from "./translate.loader"; +import { TranslateParser } from "./translate.parser"; +import { TranslateStore } from "./translate.store"; +import { isDefined, mergeDeep } from "./util"; +/** @type {?} */ +export const USE_STORE = new InjectionToken('USE_STORE'); +/** @type {?} */ +export const USE_DEFAULT_LANG = new InjectionToken('USE_DEFAULT_LANG'); +/** @type {?} */ +export const DEFAULT_LANGUAGE = new InjectionToken('DEFAULT_LANGUAGE'); +/** @type {?} */ +export const USE_EXTEND = new InjectionToken('USE_EXTEND'); +/** + * @record + */ +export function TranslationChangeEvent() { } +if (false) { + /** @type {?} */ + TranslationChangeEvent.prototype.translations; + /** @type {?} */ + TranslationChangeEvent.prototype.lang; +} +/** + * @record + */ +export function LangChangeEvent() { } +if (false) { + /** @type {?} */ + LangChangeEvent.prototype.lang; + /** @type {?} */ + LangChangeEvent.prototype.translations; +} +/** + * @record + */ +export function DefaultLangChangeEvent() { } +if (false) { + /** @type {?} */ + DefaultLangChangeEvent.prototype.lang; + /** @type {?} */ + DefaultLangChangeEvent.prototype.translations; +} +export class TranslateService { + /** + * + * @param {?} store an instance of the store (that is supposed to be unique) + * @param {?} currentLoader An instance of the loader currently used + * @param {?} compiler An instance of the compiler currently used + * @param {?} parser An instance of the parser currently used + * @param {?} missingTranslationHandler A handler for missing translations. + * @param {?=} useDefaultLang whether we should use default language translation when current language translation is missing. + * @param {?=} isolate whether this service should use the store or not + * @param {?=} extend To make a child module extend (and use) translations from parent modules. + * @param {?=} defaultLanguage Set the default language using configuration + */ + constructor(store, currentLoader, compiler, parser, missingTranslationHandler, useDefaultLang = true, isolate = false, extend = false, defaultLanguage) { + this.store = store; + this.currentLoader = currentLoader; + this.compiler = compiler; + this.parser = parser; + this.missingTranslationHandler = missingTranslationHandler; + this.useDefaultLang = useDefaultLang; + this.isolate = isolate; + this.extend = extend; + this.pending = false; + this._onTranslationChange = new EventEmitter(); + this._onLangChange = new EventEmitter(); + this._onDefaultLangChange = new EventEmitter(); + this._langs = []; + this._translations = {}; + this._translationRequests = {}; + /** set the default language from configuration */ + if (defaultLanguage) { + this.setDefaultLang(defaultLanguage); + } + } + /** + * An EventEmitter to listen to translation change events + * onTranslationChange.subscribe((params: TranslationChangeEvent) => { + * // do something + * }); + * @return {?} + */ + get onTranslationChange() { + return this.isolate ? this._onTranslationChange : this.store.onTranslationChange; + } + /** + * An EventEmitter to listen to lang change events + * onLangChange.subscribe((params: LangChangeEvent) => { + * // do something + * }); + * @return {?} + */ + get onLangChange() { + return this.isolate ? this._onLangChange : this.store.onLangChange; + } + /** + * An EventEmitter to listen to default lang change events + * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => { + * // do something + * }); + * @return {?} + */ + get onDefaultLangChange() { + return this.isolate ? this._onDefaultLangChange : this.store.onDefaultLangChange; + } + /** + * The default lang to fallback when translations are missing on the current lang + * @return {?} + */ + get defaultLang() { + return this.isolate ? this._defaultLang : this.store.defaultLang; + } + /** + * @param {?} defaultLang + * @return {?} + */ + set defaultLang(defaultLang) { + if (this.isolate) { + this._defaultLang = defaultLang; + } + else { + this.store.defaultLang = defaultLang; + } + } + /** + * The lang currently used + * @return {?} + */ + get currentLang() { + return this.isolate ? this._currentLang : this.store.currentLang; + } + /** + * @param {?} currentLang + * @return {?} + */ + set currentLang(currentLang) { + if (this.isolate) { + this._currentLang = currentLang; + } + else { + this.store.currentLang = currentLang; + } + } + /** + * an array of langs + * @return {?} + */ + get langs() { + return this.isolate ? this._langs : this.store.langs; + } + /** + * @param {?} langs + * @return {?} + */ + set langs(langs) { + if (this.isolate) { + this._langs = langs; + } + else { + this.store.langs = langs; + } + } + /** + * a list of translations per lang + * @return {?} + */ + get translations() { + return this.isolate ? this._translations : this.store.translations; + } + /** + * @param {?} translations + * @return {?} + */ + set translations(translations) { + if (this.isolate) { + this._translations = translations; + } + else { + this.store.translations = translations; + } + } + /** + * Sets the default language to use as a fallback + * @param {?} lang + * @return {?} + */ + setDefaultLang(lang) { + if (lang === this.defaultLang) { + return; + } + /** @type {?} */ + let pending = this.retrieveTranslations(lang); + if (typeof pending !== "undefined") { + // on init set the defaultLang immediately + if (this.defaultLang == null) { + this.defaultLang = lang; + } + pending.pipe(take(1)) + .subscribe((/** + * @param {?} res + * @return {?} + */ + (res) => { + this.changeDefaultLang(lang); + })); + } + else { // we already have this language + this.changeDefaultLang(lang); + } + } + /** + * Gets the default language used + * @return {?} + */ + getDefaultLang() { + return this.defaultLang; + } + /** + * Changes the lang currently used + * @param {?} lang + * @return {?} + */ + use(lang) { + // don't change the language if the language given is already selected + if (lang === this.currentLang) { + return of(this.translations[lang]); + } + /** @type {?} */ + let pending = this.retrieveTranslations(lang); + if (typeof pending !== "undefined") { + // on init set the currentLang immediately + if (!this.currentLang) { + this.currentLang = lang; + } + pending.pipe(take(1)) + .subscribe((/** + * @param {?} res + * @return {?} + */ + (res) => { + this.changeLang(lang); + })); + return pending; + } + else { // we have this language, return an Observable + this.changeLang(lang); + return of(this.translations[lang]); + } + } + /** + * Retrieves the given translations + * @private + * @param {?} lang + * @return {?} + */ + retrieveTranslations(lang) { + /** @type {?} */ + let pending; + // if this language is unavailable or extend is true, ask for it + if (typeof this.translations[lang] === "undefined" || this.extend) { + this._translationRequests[lang] = this._translationRequests[lang] || this.getTranslation(lang); + pending = this._translationRequests[lang]; + } + return pending; + } + /** + * Gets an object of translations for a given language with the current loader + * and passes it through the compiler + * @param {?} lang + * @return {?} + */ + getTranslation(lang) { + this.pending = true; + /** @type {?} */ + const loadingTranslations = this.currentLoader.getTranslation(lang).pipe(shareReplay(1), take(1)); + this.loadingTranslations = loadingTranslations.pipe(map((/** + * @param {?} res + * @return {?} + */ + (res) => this.compiler.compileTranslations(res, lang))), shareReplay(1), take(1)); + this.loadingTranslations + .subscribe({ + next: (/** + * @param {?} res + * @return {?} + */ + (res) => { + this.translations[lang] = this.extend && this.translations[lang] ? Object.assign(Object.assign({}, res), this.translations[lang]) : res; + this.updateLangs(); + this.pending = false; + }), + error: (/** + * @param {?} err + * @return {?} + */ + (err) => { + this.pending = false; + }) + }); + return loadingTranslations; + } + /** + * Manually sets an object of translations for a given language + * after passing it through the compiler + * @param {?} lang + * @param {?} translations + * @param {?=} shouldMerge + * @return {?} + */ + setTranslation(lang, translations, shouldMerge = false) { + translations = this.compiler.compileTranslations(translations, lang); + if ((shouldMerge || this.extend) && this.translations[lang]) { + this.translations[lang] = mergeDeep(this.translations[lang], translations); + } + else { + this.translations[lang] = translations; + } + this.updateLangs(); + this.onTranslationChange.emit({ lang: lang, translations: this.translations[lang] }); + } + /** + * Returns an array of currently available langs + * @return {?} + */ + getLangs() { + return this.langs; + } + /** + * Add available langs + * @param {?} langs + * @return {?} + */ + addLangs(langs) { + langs.forEach((/** + * @param {?} lang + * @return {?} + */ + (lang) => { + if (this.langs.indexOf(lang) === -1) { + this.langs.push(lang); + } + })); + } + /** + * Update the list of available langs + * @private + * @return {?} + */ + updateLangs() { + this.addLangs(Object.keys(this.translations)); + } + /** + * Returns the parsed result of the translations + * @param {?} translations + * @param {?} key + * @param {?=} interpolateParams + * @return {?} + */ + getParsedResult(translations, key, interpolateParams) { + /** @type {?} */ + let res; + if (key instanceof Array) { + /** @type {?} */ + let result = {}; + /** @type {?} */ + let observables = false; + for (let k of key) { + result[k] = this.getParsedResult(translations, k, interpolateParams); + if (isObservable(result[k])) { + observables = true; + } + } + if (observables) { + /** @type {?} */ + const sources = key.map((/** + * @param {?} k + * @return {?} + */ + k => isObservable(result[k]) ? result[k] : of((/** @type {?} */ (result[k]))))); + return forkJoin(sources).pipe(map((/** + * @param {?} arr + * @return {?} + */ + (arr) => { + /** @type {?} */ + let obj = {}; + arr.forEach((/** + * @param {?} value + * @param {?} index + * @return {?} + */ + (value, index) => { + obj[key[index]] = value; + })); + return obj; + }))); + } + return result; + } + if (translations) { + res = this.parser.interpolate(this.parser.getValue(translations, key), interpolateParams); + } + if (typeof res === "undefined" && this.defaultLang != null && this.defaultLang !== this.currentLang && this.useDefaultLang) { + res = this.parser.interpolate(this.parser.getValue(this.translations[this.defaultLang], key), interpolateParams); + } + if (typeof res === "undefined") { + /** @type {?} */ + let params = { key, translateService: this }; + if (typeof interpolateParams !== 'undefined') { + params.interpolateParams = interpolateParams; + } + res = this.missingTranslationHandler.handle(params); + } + return typeof res !== "undefined" ? res : key; + } + /** + * Gets the translated value of a key (or an array of keys) + * @param {?} key + * @param {?=} interpolateParams + * @return {?} the translated key, or an object of translated keys + */ + get(key, interpolateParams) { + if (!isDefined(key) || !key.length) { + throw new Error(`Parameter "key" required`); + } + // check if we are loading a new translation to use + if (this.pending) { + return this.loadingTranslations.pipe(concatMap((/** + * @param {?} res + * @return {?} + */ + (res) => { + res = this.getParsedResult(res, key, interpolateParams); + return isObservable(res) ? res : of(res); + }))); + } + else { + /** @type {?} */ + let res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams); + return isObservable(res) ? res : of(res); + } + } + /** + * Returns a stream of translated values of a key (or an array of keys) which updates + * whenever the translation changes. + * @param {?} key + * @param {?=} interpolateParams + * @return {?} A stream of the translated key, or an object of translated keys + */ + getStreamOnTranslationChange(key, interpolateParams) { + if (!isDefined(key) || !key.length) { + throw new Error(`Parameter "key" required`); + } + return concat(defer((/** + * @return {?} + */ + () => this.get(key, interpolateParams))), this.onTranslationChange.pipe(switchMap((/** + * @param {?} event + * @return {?} + */ + (event) => { + /** @type {?} */ + const res = this.getParsedResult(event.translations, key, interpolateParams); + if (typeof res.subscribe === 'function') { + return res; + } + else { + return of(res); + } + })))); + } + /** + * Returns a stream of translated values of a key (or an array of keys) which updates + * whenever the language changes. + * @param {?} key + * @param {?=} interpolateParams + * @return {?} A stream of the translated key, or an object of translated keys + */ + stream(key, interpolateParams) { + if (!isDefined(key) || !key.length) { + throw new Error(`Parameter "key" required`); + } + return concat(defer((/** + * @return {?} + */ + () => this.get(key, interpolateParams))), this.onLangChange.pipe(switchMap((/** + * @param {?} event + * @return {?} + */ + (event) => { + /** @type {?} */ + const res = this.getParsedResult(event.translations, key, interpolateParams); + return isObservable(res) ? res : of(res); + })))); + } + /** + * Returns a translation instantly from the internal state of loaded translation. + * All rules regarding the current language, the preferred language of even fallback languages will be used except any promise handling. + * @param {?} key + * @param {?=} interpolateParams + * @return {?} + */ + instant(key, interpolateParams) { + if (!isDefined(key) || !key.length) { + throw new Error(`Parameter "key" required`); + } + /** @type {?} */ + let res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams); + if (isObservable(res)) { + if (key instanceof Array) { + /** @type {?} */ + let obj = {}; + key.forEach((/** + * @param {?} value + * @param {?} index + * @return {?} + */ + (value, index) => { + obj[key[index]] = key[index]; + })); + return obj; + } + return key; + } + else { + return res; + } + } + /** + * Sets the translated value of a key, after compiling it + * @param {?} key + * @param {?} value + * @param {?=} lang + * @return {?} + */ + set(key, value, lang = this.currentLang) { + this.translations[lang][key] = this.compiler.compile(value, lang); + this.updateLangs(); + this.onTranslationChange.emit({ lang: lang, translations: this.translations[lang] }); + } + /** + * Changes the current lang + * @private + * @param {?} lang + * @return {?} + */ + changeLang(lang) { + this.currentLang = lang; + this.onLangChange.emit({ lang: lang, translations: this.translations[lang] }); + // if there is no default lang, use the one that we just set + if (this.defaultLang == null) { + this.changeDefaultLang(lang); + } + } + /** + * Changes the default lang + * @private + * @param {?} lang + * @return {?} + */ + changeDefaultLang(lang) { + this.defaultLang = lang; + this.onDefaultLangChange.emit({ lang: lang, translations: this.translations[lang] }); + } + /** + * Allows to reload the lang file from the file + * @param {?} lang + * @return {?} + */ + reloadLang(lang) { + this.resetLang(lang); + return this.getTranslation(lang); + } + /** + * Deletes inner translation + * @param {?} lang + * @return {?} + */ + resetLang(lang) { + this._translationRequests[lang] = undefined; + this.translations[lang] = undefined; + } + /** + * Returns the language code name from the browser, e.g. "de" + * @return {?} + */ + getBrowserLang() { + if (typeof window === 'undefined' || typeof window.navigator === 'undefined') { + return undefined; + } + /** @type {?} */ + let browserLang = window.navigator.languages ? window.navigator.languages[0] : null; + browserLang = browserLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage; + if (typeof browserLang === 'undefined') { + return undefined; + } + if (browserLang.indexOf('-') !== -1) { + browserLang = browserLang.split('-')[0]; + } + if (browserLang.indexOf('_') !== -1) { + browserLang = browserLang.split('_')[0]; + } + return browserLang; + } + /** + * Returns the culture language code name from the browser, e.g. "de-DE" + * @return {?} + */ + getBrowserCultureLang() { + if (typeof window === 'undefined' || typeof window.navigator === 'undefined') { + return undefined; + } + /** @type {?} */ + let browserCultureLang = window.navigator.languages ? window.navigator.languages[0] : null; + browserCultureLang = browserCultureLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage; + return browserCultureLang; + } +} +TranslateService.decorators = [ + { type: Injectable } +]; +/** @nocollapse */ +TranslateService.ctorParameters = () => [ + { type: TranslateStore }, + { type: TranslateLoader }, + { type: TranslateCompiler }, + { type: TranslateParser }, + { type: MissingTranslationHandler }, + { type: Boolean, decorators: [{ type: Inject, args: [USE_DEFAULT_LANG,] }] }, + { type: Boolean, decorators: [{ type: Inject, args: [USE_STORE,] }] }, + { type: Boolean, decorators: [{ type: Inject, args: [USE_EXTEND,] }] }, + { type: String, decorators: [{ type: Inject, args: [DEFAULT_LANGUAGE,] }] } +]; +if (false) { + /** + * @type {?} + * @private + */ + TranslateService.prototype.loadingTranslations; + /** + * @type {?} + * @private + */ + TranslateService.prototype.pending; + /** + * @type {?} + * @private + */ + TranslateService.prototype._onTranslationChange; + /** + * @type {?} + * @private + */ + TranslateService.prototype._onLangChange; + /** + * @type {?} + * @private + */ + TranslateService.prototype._onDefaultLangChange; + /** + * @type {?} + * @private + */ + TranslateService.prototype._defaultLang; + /** + * @type {?} + * @private + */ + TranslateService.prototype._currentLang; + /** + * @type {?} + * @private + */ + TranslateService.prototype._langs; + /** + * @type {?} + * @private + */ + TranslateService.prototype._translations; + /** + * @type {?} + * @private + */ + TranslateService.prototype._translationRequests; + /** @type {?} */ + TranslateService.prototype.store; + /** @type {?} */ + TranslateService.prototype.currentLoader; + /** @type {?} */ + TranslateService.prototype.compiler; + /** @type {?} */ + TranslateService.prototype.parser; + /** @type {?} */ + TranslateService.prototype.missingTranslationHandler; + /** + * @type {?} + * @private + */ + TranslateService.prototype.useDefaultLang; + /** + * @type {?} + * @private + */ + TranslateService.prototype.isolate; + /** + * @type {?} + * @private + */ + TranslateService.prototype.extend; +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRlLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtdHJhbnNsYXRlL2NvcmUvc3JjL2xpYi90cmFuc2xhdGUuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFBQyxZQUFZLEVBQUUsTUFBTSxFQUFFLFVBQVUsRUFBRSxjQUFjLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDL0UsT0FBTyxFQUFDLE1BQU0sRUFBRSxRQUFRLEVBQUUsWUFBWSxFQUFjLEVBQUUsRUFBRSxLQUFLLEVBQUMsTUFBTSxNQUFNLENBQUM7QUFDM0UsT0FBTyxFQUFDLFNBQVMsRUFBRSxHQUFHLEVBQUUsV0FBVyxFQUFFLFNBQVMsRUFBRSxJQUFJLEVBQUMsTUFBTSxnQkFBZ0IsQ0FBQztBQUM1RSxPQUFPLEVBQUMseUJBQXlCLEVBQWtDLE1BQU0sK0JBQStCLENBQUM7QUFDekcsT0FBTyxFQUFDLGlCQUFpQixFQUFDLE1BQU0sc0JBQXNCLENBQUM7QUFDdkQsT0FBTyxFQUFDLGVBQWUsRUFBQyxNQUFNLG9CQUFvQixDQUFDO0FBQ25ELE9BQU8sRUFBQyxlQUFlLEVBQUMsTUFBTSxvQkFBb0IsQ0FBQztBQUVuRCxPQUFPLEVBQUMsY0FBYyxFQUFDLE1BQU0sbUJBQW1CLENBQUM7QUFDakQsT0FBTyxFQUFDLFNBQVMsRUFBRSxTQUFTLEVBQUMsTUFBTSxRQUFRLENBQUM7O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mcm9tIHRoZSBicm93c2VyLCBlLmcuIFwiZGUtREVcIlxuICAgKi9cbiAgcHVibGljIGdldEJyb3dzZXJDdWx0dXJlTGFuZygpOiBzdHJpbmcge1xuICAgIGlmICh0eXBlb2Ygd2luZG93ID09PSAndW5kZWZpbmVkJyB8fCB0eXBlb2Ygd2luZG93Lm5hdmlnYXRvciA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgfVxuXG4gICAgbGV0IGJyb3dzZXJDdWx0dXJlTGFuZzogYW55ID0gd2luZG93Lm5hdmlnYXRvci5sYW5ndWFnZXMgPyB3aW5kb3cubmF2aWdhdG9yLmxhbmd1YWdlc1swXSA6IG51bGw7XG4gICAgYnJvd3NlckN1bHR1cmVMYW5nID0gYnJvd3NlckN1bHR1cmVMYW5nIHx8IHdpbmRvdy5uYXZpZ2F0b3IubGFuZ3VhZ2UgfHwgd2luZG93Lm5hdmlnYXRvci5icm93c2VyTGFuZ3VhZ2UgfHwgd2luZG93Lm5hdmlnYXRvci51c2VyTGFuZ3VhZ2U7XG5cbiAgICByZXR1cm4gYnJvd3NlckN1bHR1cmVMYW5nO1xuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.store.js b/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.store.js new file mode 100644 index 000000000..8d298a47d --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/esm2015/lib/translate.store.js @@ -0,0 +1,90 @@ +/** + * @fileoverview added by tsickle + * Generated from: lib/translate.store.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +import { EventEmitter } from "@angular/core"; +export class TranslateStore { + constructor() { + /** + * The lang currently used + */ + this.currentLang = this.defaultLang; + /** + * a list of translations per lang + */ + this.translations = {}; + /** + * an array of langs + */ + this.langs = []; + /** + * An EventEmitter to listen to translation change events + * onTranslationChange.subscribe((params: TranslationChangeEvent) => { + * // do something + * }); + */ + this.onTranslationChange = new EventEmitter(); + /** + * An EventEmitter to listen to lang change events + * onLangChange.subscribe((params: LangChangeEvent) => { + * // do something + * }); + */ + this.onLangChange = new EventEmitter(); + /** + * An EventEmitter to listen to default lang change events + * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => { + * // do something + * }); + */ + this.onDefaultLangChange = new EventEmitter(); + } +} +if (false) { + /** + * The default lang to fallback when translations are missing on the current lang + * @type {?} + */ + TranslateStore.prototype.defaultLang; + /** + * The lang currently used + * @type {?} + */ + TranslateStore.prototype.currentLang; + /** + * a list of translations per lang + * @type {?} + */ + TranslateStore.prototype.translations; + /** + * an array of langs + * @type {?} + */ + TranslateStore.prototype.langs; + /** + * An EventEmitter to listen to translation change events + * onTranslationChange.subscribe((params: TranslationChangeEvent) => { + * // do something + * }); + * @type {?} + */ + TranslateStore.prototype.onTranslationChange; + /** + * An EventEmitter to listen to lang change events + * onLangChange.subscribe((params: LangChangeEvent) => { + * // do something + * }); + * @type {?} + */ + TranslateStore.prototype.onLangChange; + /** + * An EventEmitter to listen to default lang change events + * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => { + * // do something + * }); + * @type {?} + */ + TranslateStore.prototype.onDefaultLangChange; +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRlLnN0b3JlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXRyYW5zbGF0ZS9jb3JlL3NyYy9saWIvdHJhbnNsYXRlLnN0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFDLFlBQVksRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUczQyxNQUFNLE9BQU8sY0FBYztJQUEzQjs7OztRQVNTLGdCQUFXLEdBQVcsSUFBSSxDQ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V2ZW50c1xuICAgKiBvbkRlZmF1bHRMYW5nQ2hhbmdlLnN1YnNjcmliZSgocGFyYW1zOiBEZWZhdWx0TGFuZ0NoYW5nZUV2ZW50KSA9PiB7XG4gICAgICogICAgIC8vIGRvIHNvbWV0aGluZ1xuICAgICAqIH0pO1xuICAgKi9cbiAgcHVibGljIG9uRGVmYXVsdExhbmdDaGFuZ2U6IEV2ZW50RW1pdHRlcjxEZWZhdWx0TGFuZ0NoYW5nZUV2ZW50PiA9IG5ldyBFdmVudEVtaXR0ZXI8RGVmYXVsdExhbmdDaGFuZ2VFdmVudD4oKTtcbn1cbiJdfQ== \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/core/esm2015/lib/util.js b/frontend/node_modules/@ngx-translate/core/esm2015/lib/util.js new file mode 100644 index 000000000..f45a4e981 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/esm2015/lib/util.js @@ -0,0 +1,115 @@ +/** + * @fileoverview added by tsickle + * Generated from: lib/util.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +/* tslint:disable */ +/** + * Determines if two objects or two values are equivalent. + * + * Two objects or values are considered equivalent if at least one of the following is true: + * + * * Both objects or values pass `===` comparison. + * * Both objects or values are of the same type and all of their properties are equal by + * comparing them with `equals`. + * + * @param {?} o1 Object or value to compare. + * @param {?} o2 Object or value to compare. + * @return {?} true if arguments are equal. + */ +export function equals(o1, o2) { + if (o1 === o2) + return true; + if (o1 === null || o2 === null) + return false; + if (o1 !== o1 && o2 !== o2) + return true; // NaN === NaN + // NaN === NaN + /** @type {?} */ + let t1 = typeof o1; + /** @type {?} */ + let t2 = typeof o2; + /** @type {?} */ + let length; + /** @type {?} */ + let key; + /** @type {?} */ + let keySet; + if (t1 == t2 && t1 == 'object') { + if (Array.isArray(o1)) { + if (!Array.isArray(o2)) + return false; + if ((length = o1.length) == o2.length) { + for (key = 0; key < length; key++) { + if (!equals(o1[key], o2[key])) + return false; + } + return true; + } + } + else { + if (Array.isArray(o2)) { + return false; + } + keySet = Object.create(null); + for (key in o1) { + if (!equals(o1[key], o2[key])) { + return false; + } + keySet[key] = true; + } + for (key in o2) { + if (!(key in keySet) && typeof o2[key] !== 'undefined') { + return false; + } + } + return true; + } + } + return false; +} +/* tslint:enable */ +/** + * @param {?} value + * @return {?} + */ +export function isDefined(value) { + return typeof value !== 'undefined' && value !== null; +} +/** + * @param {?} item + * @return {?} + */ +export function isObject(item) { + return (item && typeof item === 'object' && !Array.isArray(item)); +} +/** + * @param {?} target + * @param {?} source + * @return {?} + */ +export function mergeDeep(target, source) { + /** @type {?} */ + let output = Object.assign({}, target); + if (isObject(target) && isObject(source)) { + Object.keys(source).forEach((/** + * @param {?} key + * @return {?} + */ + (key) => { + if (isObject(source[key])) { + if (!(key in target)) { + Object.assign(output, { [key]: source[key] }); + } + else { + output[key] = mergeDeep(target[key], source[key]); + } + } + else { + Object.assign(output, { [key]: source[key] }); + } + })); + } + return output; +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC10cmFuc2xhdGUvY29yZS9zcmMvbGliL3V0aWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQWNBLE1BQU0sVUFBVSxNQUFNLENBQUMsRUFBTyxFQUFFLEVBQU87SUFDckMsSUFBSSxFQUFFLEtBQUssRUFBRTtRQUFFLE9BQU8sSUFBSSxDQUFDO0lBQzNCLElBQUksRUFBRSxLQUFLLElBQUksSUFBSSxFQUFFLEtBQUssSUFBSTtRQUFFLE9BQU8sS0FBSyxDQUFDO0lBQzdDLElBQUksRUFBRSxLQUFLLEVBQUUsSUFBSSxFQUFFLEtBQUssRUFBRTtRQUFFLE9BQU8sSUFBSSxDQ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yhzb3VyY2UpLmZvckVhY2goKGtleTogYW55KSA9PiB7XG4gICAgICBpZiAoaXNPYmplY3Qoc291cmNlW2tleV0pKSB7XG4gICAgICAgIGlmICghKGtleSBpbiB0YXJnZXQpKSB7XG4gICAgICAgICAgT2JqZWN0LmFzc2lnbihvdXRwdXQsIHtba2V5XTogc291cmNlW2tleV19KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBvdXRwdXRba2V5XSA9IG1lcmdlRGVlcCh0YXJnZXRba2V5XSwgc291cmNlW2tleV0pO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBPYmplY3QuYXNzaWduKG91dHB1dCwge1trZXldOiBzb3VyY2Vba2V5XX0pO1xuICAgICAgfVxuICAgIH0pO1xuICB9XG4gIHJldHVybiBvdXRwdXQ7XG59XG4iXX0= \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/core/esm2015/ngx-translate-core.js b/frontend/node_modules/@ngx-translate/core/esm2015/ngx-translate-core.js new file mode 100644 index 000000000..8cd20ec78 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/esm2015/ngx-translate-core.js @@ -0,0 +1,10 @@ +/** + * @fileoverview added by tsickle + * Generated from: ngx-translate-core.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +/** + * Generated bundle index. Do not edit. + */ +export { TranslateModule, TranslateLoader, TranslateFakeLoader, USE_STORE, USE_DEFAULT_LANG, DEFAULT_LANGUAGE, USE_EXTEND, TranslateService, MissingTranslationHandler, FakeMissingTranslationHandler, TranslateParser, TranslateDefaultParser, TranslateCompiler, TranslateFakeCompiler, TranslateDirective, TranslatePipe, TranslateStore } from './public_api'; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXRyYW5zbGF0ZS1jb3JlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXRyYW5zbGF0ZS9jb3JlL3NyYy9uZ3gtdHJhbnNsYXRlLWNvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFJQSxtVkFBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljX2FwaSc7XG4iXX0= \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/core/esm2015/public_api.js b/frontend/node_modules/@ngx-translate/core/esm2015/public_api.js new file mode 100644 index 000000000..b1ca4684e --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/esm2015/public_api.js @@ -0,0 +1,102 @@ +/** + * @fileoverview added by tsickle + * Generated from: public_api.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +import { NgModule } from "@angular/core"; +import { TranslateLoader, TranslateFakeLoader } from "./lib/translate.loader"; +import { MissingTranslationHandler, FakeMissingTranslationHandler } from "./lib/missing-translation-handler"; +import { TranslateParser, TranslateDefaultParser } from "./lib/translate.parser"; +import { TranslateCompiler, TranslateFakeCompiler } from "./lib/translate.compiler"; +import { TranslateDirective } from "./lib/translate.directive"; +import { TranslatePipe } from "./lib/translate.pipe"; +import { TranslateStore } from "./lib/translate.store"; +import { USE_DEFAULT_LANG, DEFAULT_LANGUAGE, USE_STORE, TranslateService, USE_EXTEND } from "./lib/translate.service"; +export { TranslateLoader, TranslateFakeLoader } from "./lib/translate.loader"; +export { USE_STORE, USE_DEFAULT_LANG, DEFAULT_LANGUAGE, USE_EXTEND, TranslateService } from "./lib/translate.service"; +export { MissingTranslationHandler, FakeMissingTranslationHandler } from "./lib/missing-translation-handler"; +export { TranslateParser, TranslateDefaultParser } from "./lib/translate.parser"; +export { TranslateCompiler, TranslateFakeCompiler } from "./lib/translate.compiler"; +export { TranslateDirective } from "./lib/translate.directive"; +export { TranslatePipe } from "./lib/translate.pipe"; +export { TranslateStore } from "./lib/translate.store"; +/** + * @record + */ +export function TranslateModuleConfig() { } +if (false) { + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.loader; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.compiler; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.parser; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.missingTranslationHandler; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.isolate; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.extend; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.useDefaultLang; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.defaultLanguage; +} +export class TranslateModule { + /** + * Use this method in your root module to provide the TranslateService + * @param {?=} config + * @return {?} + */ + static forRoot(config = {}) { + return { + ngModule: TranslateModule, + providers: [ + config.loader || { provide: TranslateLoader, useClass: TranslateFakeLoader }, + config.compiler || { provide: TranslateCompiler, useClass: TranslateFakeCompiler }, + config.parser || { provide: TranslateParser, useClass: TranslateDefaultParser }, + config.missingTranslationHandler || { provide: MissingTranslationHandler, useClass: FakeMissingTranslationHandler }, + TranslateStore, + { provide: USE_STORE, useValue: config.isolate }, + { provide: USE_DEFAULT_LANG, useValue: config.useDefaultLang }, + { provide: USE_EXTEND, useValue: config.extend }, + { provide: DEFAULT_LANGUAGE, useValue: config.defaultLanguage }, + TranslateService + ] + }; + } + /** + * Use this method in your other (non root) modules to import the directive/pipe + * @param {?=} config + * @return {?} + */ + static forChild(config = {}) { + return { + ngModule: TranslateModule, + providers: [ + config.loader || { provide: TranslateLoader, useClass: TranslateFakeLoader }, + config.compiler || { provide: TranslateCompiler, useClass: TranslateFakeCompiler }, + config.parser || { provide: TranslateParser, useClass: TranslateDefaultParser }, + config.missingTranslationHandler || { provide: MissingTranslationHandler, useClass: FakeMissingTranslationHandler }, + { provide: USE_STORE, useValue: config.isolate }, + { provide: USE_DEFAULT_LANG, useValue: config.useDefaultLang }, + { provide: USE_EXTEND, useValue: config.extend }, + { provide: DEFAULT_LANGUAGE, useValue: config.defaultLanguage }, + TranslateService + ] + }; + } +} +TranslateModule.decorators = [ + { type: NgModule, args: [{ + declarations: [ + TranslatePipe, + TranslateDirective + ], + exports: [ + TranslatePipe, + TranslateDirective + ] + },] } +]; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL25neC10cmFuc2xhdGUvY29yZS9zcmMvcHVibGljX2FwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFBQyxRQUFRLEVBQWdDLE1BQU0sZUFBZSxDQUFDO0FBQ3RFLE9BQU8sRUFBQyxlQUFlLEVBQUUsbUJBQW1CLEVBQUMsTUFBTSx3QkFBd0IsQ0FBQztBQUM1RSxPQUFPLEVBQUMseUJBQXlCLEVBQUUsNkJBQTZCLEVBQUMsTUFBTSxtQ0FBbUMsQ0FBQztBQUMzRyxPQUFPLEVBQUMsZUFBZSxFQUFFLHNCQUFzQixFQUFDLE1BQU0sd0JBQXdCLENBQUM7QUFDL0UsT0FBTyxFQUFDLGlCQUFpQixFQUFFLHFCQUFxQixFQUFDLE1BQU0sMEJBQTBCLENBQUM7QUFDbEYsT0FBTyxFQUFDLGtCQUFrQixFQUFDLE1BQU0sMkJBQTJCLENBQUM7QUFDN0QsT0FBTyxFQUFDLGFBQWEsRUFBQyxNQUFNLHNCQUFzQixDQUFDO0FBQ25ELE9BQU8sRUFBQyxjQUFjLEVBQUMsTUFBTSx1QkFBdUIsQ0FBQztBQUNyRCxPQUFPLEVBQUMsZ0JBQWdCLEVBQUUsZ0JBQWdCLEVBQUUsU0FBUyxFQUFFLGdCQUFnQ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of file diff --git a/frontend/node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.js b/frontend/node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.js new file mode 100644 index 000000000..b5e8e503e --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.js @@ -0,0 +1,1723 @@ +import { Injectable, EventEmitter, InjectionToken, Inject, Directive, ElementRef, ChangeDetectorRef, Input, Pipe, NgModule } from '@angular/core'; +import { of, isObservable, forkJoin, concat, defer } from 'rxjs'; +import { take, shareReplay, map, concatMap, switchMap } from 'rxjs/operators'; + +/** + * @fileoverview added by tsickle + * Generated from: lib/translate.loader.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +/** + * @abstract + */ +class TranslateLoader { +} +if (false) { + /** + * @abstract + * @param {?} lang + * @return {?} + */ + TranslateLoader.prototype.getTranslation = function (lang) { }; +} +/** + * This loader is just a placeholder that does nothing, in case you don't need a loader at all + */ +class TranslateFakeLoader extends TranslateLoader { + /** + * @param {?} lang + * @return {?} + */ + getTranslation(lang) { + return of({}); + } +} +TranslateFakeLoader.decorators = [ + { type: Injectable } +]; + +/** + * @fileoverview added by tsickle + * Generated from: lib/missing-translation-handler.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +/** + * @record + */ +function MissingTranslationHandlerParams() { } +if (false) { + /** + * the key that's missing in translation files + * @type {?} + */ + MissingTranslationHandlerParams.prototype.key; + /** + * an instance of the service that was unable to translate the key. + * @type {?} + */ + MissingTranslationHandlerParams.prototype.translateService; + /** + * interpolation params that were passed along for translating the given key. + * @type {?|undefined} + */ + MissingTranslationHandlerParams.prototype.interpolateParams; +} +/** + * @abstract + */ +class MissingTranslationHandler { +} +if (false) { + /** + * A function that handles missing translations. + * + * @abstract + * @param {?} params context for resolving a missing translation + * @return {?} a value or an observable + * If it returns a value, then this value is used. + * If it return an observable, the value returned by this observable will be used (except if the method was "instant"). + * If it doesn't return then the key will be used as a value + */ + MissingTranslationHandler.prototype.handle = function (params) { }; +} +/** + * This handler is just a placeholder that does nothing, in case you don't need a missing translation handler at all + */ +class FakeMissingTranslationHandler { + /** + * @param {?} params + * @return {?} + */ + handle(params) { + return params.key; + } +} +FakeMissingTranslationHandler.decorators = [ + { type: Injectable } +]; + +/** + * @fileoverview added by tsickle + * Generated from: lib/util.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +/* tslint:disable */ +/** + * Determines if two objects or two values are equivalent. + * + * Two objects or values are considered equivalent if at least one of the following is true: + * + * * Both objects or values pass `===` comparison. + * * Both objects or values are of the same type and all of their properties are equal by + * comparing them with `equals`. + * + * @param {?} o1 Object or value to compare. + * @param {?} o2 Object or value to compare. + * @return {?} true if arguments are equal. + */ +function equals(o1, o2) { + if (o1 === o2) + return true; + if (o1 === null || o2 === null) + return false; + if (o1 !== o1 && o2 !== o2) + return true; // NaN === NaN + // NaN === NaN + /** @type {?} */ + let t1 = typeof o1; + /** @type {?} */ + let t2 = typeof o2; + /** @type {?} */ + let length; + /** @type {?} */ + let key; + /** @type {?} */ + let keySet; + if (t1 == t2 && t1 == 'object') { + if (Array.isArray(o1)) { + if (!Array.isArray(o2)) + return false; + if ((length = o1.length) == o2.length) { + for (key = 0; key < length; key++) { + if (!equals(o1[key], o2[key])) + return false; + } + return true; + } + } + else { + if (Array.isArray(o2)) { + return false; + } + keySet = Object.create(null); + for (key in o1) { + if (!equals(o1[key], o2[key])) { + return false; + } + keySet[key] = true; + } + for (key in o2) { + if (!(key in keySet) && typeof o2[key] !== 'undefined') { + return false; + } + } + return true; + } + } + return false; +} +/* tslint:enable */ +/** + * @param {?} value + * @return {?} + */ +function isDefined(value) { + return typeof value !== 'undefined' && value !== null; +} +/** + * @param {?} item + * @return {?} + */ +function isObject(item) { + return (item && typeof item === 'object' && !Array.isArray(item)); +} +/** + * @param {?} target + * @param {?} source + * @return {?} + */ +function mergeDeep(target, source) { + /** @type {?} */ + let output = Object.assign({}, target); + if (isObject(target) && isObject(source)) { + Object.keys(source).forEach((/** + * @param {?} key + * @return {?} + */ + (key) => { + if (isObject(source[key])) { + if (!(key in target)) { + Object.assign(output, { [key]: source[key] }); + } + else { + output[key] = mergeDeep(target[key], source[key]); + } + } + else { + Object.assign(output, { [key]: source[key] }); + } + })); + } + return output; +} + +/** + * @fileoverview added by tsickle + * Generated from: lib/translate.parser.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +/** + * @abstract + */ +class TranslateParser { +} +if (false) { + /** + * Interpolates a string to replace parameters + * "This is a {{ key }}" ==> "This is a value", with params = { key: "value" } + * @abstract + * @param {?} expr + * @param {?=} params + * @return {?} + */ + TranslateParser.prototype.interpolate = function (expr, params) { }; + /** + * Gets a value from an object by composed key + * parser.getValue({ key1: { keyA: 'valueI' }}, 'key1.keyA') ==> 'valueI' + * @abstract + * @param {?} target + * @param {?} key + * @return {?} + */ + TranslateParser.prototype.getValue = function (target, key) { }; +} +class TranslateDefaultParser extends TranslateParser { + constructor() { + super(...arguments); + this.templateMatcher = /{{\s?([^{}\s]*)\s?}}/g; + } + /** + * @param {?} expr + * @param {?=} params + * @return {?} + */ + interpolate(expr, params) { + /** @type {?} */ + let result; + if (typeof expr === 'string') { + result = this.interpolateString(expr, params); + } + else if (typeof expr === 'function') { + result = this.interpolateFunction(expr, params); + } + else { + // this should not happen, but an unrelated TranslateService test depends on it + result = (/** @type {?} */ (expr)); + } + return result; + } + /** + * @param {?} target + * @param {?} key + * @return {?} + */ + getValue(target, key) { + /** @type {?} */ + let keys = typeof key === 'string' ? key.split('.') : [key]; + key = ''; + do { + key += keys.shift(); + if (isDefined(target) && isDefined(target[key]) && (typeof target[key] === 'object' || !keys.length)) { + target = target[key]; + key = ''; + } + else if (!keys.length) { + target = undefined; + } + else { + key += '.'; + } + } while (keys.length); + return target; + } + /** + * @private + * @param {?} fn + * @param {?=} params + * @return {?} + */ + interpolateFunction(fn, params) { + return fn(params); + } + /** + * @private + * @param {?} expr + * @param {?=} params + * @return {?} + */ + interpolateString(expr, params) { + if (!params) { + return expr; + } + return expr.replace(this.templateMatcher, (/** + * @param {?} substring + * @param {?} b + * @return {?} + */ + (substring, b) => { + /** @type {?} */ + let r = this.getValue(params, b); + return isDefined(r) ? r : substring; + })); + } +} +TranslateDefaultParser.decorators = [ + { type: Injectable } +]; +if (false) { + /** @type {?} */ + TranslateDefaultParser.prototype.templateMatcher; +} + +/** + * @fileoverview added by tsickle + * Generated from: lib/translate.compiler.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +/** + * @abstract + */ +class TranslateCompiler { +} +if (false) { + /** + * @abstract + * @param {?} value + * @param {?} lang + * @return {?} + */ + TranslateCompiler.prototype.compile = function (value, lang) { }; + /** + * @abstract + * @param {?} translations + * @param {?} lang + * @return {?} + */ + TranslateCompiler.prototype.compileTranslations = function (translations, lang) { }; +} +/** + * This compiler is just a placeholder that does nothing, in case you don't need a compiler at all + */ +class TranslateFakeCompiler extends TranslateCompiler { + /** + * @param {?} value + * @param {?} lang + * @return {?} + */ + compile(value, lang) { + return value; + } + /** + * @param {?} translations + * @param {?} lang + * @return {?} + */ + compileTranslations(translations, lang) { + return translations; + } +} +TranslateFakeCompiler.decorators = [ + { type: Injectable } +]; + +/** + * @fileoverview added by tsickle + * Generated from: lib/translate.store.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +class TranslateStore { + constructor() { + /** + * The lang currently used + */ + this.currentLang = this.defaultLang; + /** + * a list of translations per lang + */ + this.translations = {}; + /** + * an array of langs + */ + this.langs = []; + /** + * An EventEmitter to listen to translation change events + * onTranslationChange.subscribe((params: TranslationChangeEvent) => { + * // do something + * }); + */ + this.onTranslationChange = new EventEmitter(); + /** + * An EventEmitter to listen to lang change events + * onLangChange.subscribe((params: LangChangeEvent) => { + * // do something + * }); + */ + this.onLangChange = new EventEmitter(); + /** + * An EventEmitter to listen to default lang change events + * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => { + * // do something + * }); + */ + this.onDefaultLangChange = new EventEmitter(); + } +} +if (false) { + /** + * The default lang to fallback when translations are missing on the current lang + * @type {?} + */ + TranslateStore.prototype.defaultLang; + /** + * The lang currently used + * @type {?} + */ + TranslateStore.prototype.currentLang; + /** + * a list of translations per lang + * @type {?} + */ + TranslateStore.prototype.translations; + /** + * an array of langs + * @type {?} + */ + TranslateStore.prototype.langs; + /** + * An EventEmitter to listen to translation change events + * onTranslationChange.subscribe((params: TranslationChangeEvent) => { + * // do something + * }); + * @type {?} + */ + TranslateStore.prototype.onTranslationChange; + /** + * An EventEmitter to listen to lang change events + * onLangChange.subscribe((params: LangChangeEvent) => { + * // do something + * }); + * @type {?} + */ + TranslateStore.prototype.onLangChange; + /** + * An EventEmitter to listen to default lang change events + * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => { + * // do something + * }); + * @type {?} + */ + TranslateStore.prototype.onDefaultLangChange; +} + +/** + * @fileoverview added by tsickle + * Generated from: lib/translate.service.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +/** @type {?} */ +const USE_STORE = new InjectionToken('USE_STORE'); +/** @type {?} */ +const USE_DEFAULT_LANG = new InjectionToken('USE_DEFAULT_LANG'); +/** @type {?} */ +const DEFAULT_LANGUAGE = new InjectionToken('DEFAULT_LANGUAGE'); +/** @type {?} */ +const USE_EXTEND = new InjectionToken('USE_EXTEND'); +/** + * @record + */ +function TranslationChangeEvent() { } +if (false) { + /** @type {?} */ + TranslationChangeEvent.prototype.translations; + /** @type {?} */ + TranslationChangeEvent.prototype.lang; +} +/** + * @record + */ +function LangChangeEvent() { } +if (false) { + /** @type {?} */ + LangChangeEvent.prototype.lang; + /** @type {?} */ + LangChangeEvent.prototype.translations; +} +/** + * @record + */ +function DefaultLangChangeEvent() { } +if (false) { + /** @type {?} */ + DefaultLangChangeEvent.prototype.lang; + /** @type {?} */ + DefaultLangChangeEvent.prototype.translations; +} +class TranslateService { + /** + * + * @param {?} store an instance of the store (that is supposed to be unique) + * @param {?} currentLoader An instance of the loader currently used + * @param {?} compiler An instance of the compiler currently used + * @param {?} parser An instance of the parser currently used + * @param {?} missingTranslationHandler A handler for missing translations. + * @param {?=} useDefaultLang whether we should use default language translation when current language translation is missing. + * @param {?=} isolate whether this service should use the store or not + * @param {?=} extend To make a child module extend (and use) translations from parent modules. + * @param {?=} defaultLanguage Set the default language using configuration + */ + constructor(store, currentLoader, compiler, parser, missingTranslationHandler, useDefaultLang = true, isolate = false, extend = false, defaultLanguage) { + this.store = store; + this.currentLoader = currentLoader; + this.compiler = compiler; + this.parser = parser; + this.missingTranslationHandler = missingTranslationHandler; + this.useDefaultLang = useDefaultLang; + this.isolate = isolate; + this.extend = extend; + this.pending = false; + this._onTranslationChange = new EventEmitter(); + this._onLangChange = new EventEmitter(); + this._onDefaultLangChange = new EventEmitter(); + this._langs = []; + this._translations = {}; + this._translationRequests = {}; + /** set the default language from configuration */ + if (defaultLanguage) { + this.setDefaultLang(defaultLanguage); + } + } + /** + * An EventEmitter to listen to translation change events + * onTranslationChange.subscribe((params: TranslationChangeEvent) => { + * // do something + * }); + * @return {?} + */ + get onTranslationChange() { + return this.isolate ? this._onTranslationChange : this.store.onTranslationChange; + } + /** + * An EventEmitter to listen to lang change events + * onLangChange.subscribe((params: LangChangeEvent) => { + * // do something + * }); + * @return {?} + */ + get onLangChange() { + return this.isolate ? this._onLangChange : this.store.onLangChange; + } + /** + * An EventEmitter to listen to default lang change events + * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => { + * // do something + * }); + * @return {?} + */ + get onDefaultLangChange() { + return this.isolate ? this._onDefaultLangChange : this.store.onDefaultLangChange; + } + /** + * The default lang to fallback when translations are missing on the current lang + * @return {?} + */ + get defaultLang() { + return this.isolate ? this._defaultLang : this.store.defaultLang; + } + /** + * @param {?} defaultLang + * @return {?} + */ + set defaultLang(defaultLang) { + if (this.isolate) { + this._defaultLang = defaultLang; + } + else { + this.store.defaultLang = defaultLang; + } + } + /** + * The lang currently used + * @return {?} + */ + get currentLang() { + return this.isolate ? this._currentLang : this.store.currentLang; + } + /** + * @param {?} currentLang + * @return {?} + */ + set currentLang(currentLang) { + if (this.isolate) { + this._currentLang = currentLang; + } + else { + this.store.currentLang = currentLang; + } + } + /** + * an array of langs + * @return {?} + */ + get langs() { + return this.isolate ? this._langs : this.store.langs; + } + /** + * @param {?} langs + * @return {?} + */ + set langs(langs) { + if (this.isolate) { + this._langs = langs; + } + else { + this.store.langs = langs; + } + } + /** + * a list of translations per lang + * @return {?} + */ + get translations() { + return this.isolate ? this._translations : this.store.translations; + } + /** + * @param {?} translations + * @return {?} + */ + set translations(translations) { + if (this.isolate) { + this._translations = translations; + } + else { + this.store.translations = translations; + } + } + /** + * Sets the default language to use as a fallback + * @param {?} lang + * @return {?} + */ + setDefaultLang(lang) { + if (lang === this.defaultLang) { + return; + } + /** @type {?} */ + let pending = this.retrieveTranslations(lang); + if (typeof pending !== "undefined") { + // on init set the defaultLang immediately + if (this.defaultLang == null) { + this.defaultLang = lang; + } + pending.pipe(take(1)) + .subscribe((/** + * @param {?} res + * @return {?} + */ + (res) => { + this.changeDefaultLang(lang); + })); + } + else { // we already have this language + this.changeDefaultLang(lang); + } + } + /** + * Gets the default language used + * @return {?} + */ + getDefaultLang() { + return this.defaultLang; + } + /** + * Changes the lang currently used + * @param {?} lang + * @return {?} + */ + use(lang) { + // don't change the language if the language given is already selected + if (lang === this.currentLang) { + return of(this.translations[lang]); + } + /** @type {?} */ + let pending = this.retrieveTranslations(lang); + if (typeof pending !== "undefined") { + // on init set the currentLang immediately + if (!this.currentLang) { + this.currentLang = lang; + } + pending.pipe(take(1)) + .subscribe((/** + * @param {?} res + * @return {?} + */ + (res) => { + this.changeLang(lang); + })); + return pending; + } + else { // we have this language, return an Observable + this.changeLang(lang); + return of(this.translations[lang]); + } + } + /** + * Retrieves the given translations + * @private + * @param {?} lang + * @return {?} + */ + retrieveTranslations(lang) { + /** @type {?} */ + let pending; + // if this language is unavailable or extend is true, ask for it + if (typeof this.translations[lang] === "undefined" || this.extend) { + this._translationRequests[lang] = this._translationRequests[lang] || this.getTranslation(lang); + pending = this._translationRequests[lang]; + } + return pending; + } + /** + * Gets an object of translations for a given language with the current loader + * and passes it through the compiler + * @param {?} lang + * @return {?} + */ + getTranslation(lang) { + this.pending = true; + /** @type {?} */ + const loadingTranslations = this.currentLoader.getTranslation(lang).pipe(shareReplay(1), take(1)); + this.loadingTranslations = loadingTranslations.pipe(map((/** + * @param {?} res + * @return {?} + */ + (res) => this.compiler.compileTranslations(res, lang))), shareReplay(1), take(1)); + this.loadingTranslations + .subscribe({ + next: (/** + * @param {?} res + * @return {?} + */ + (res) => { + this.translations[lang] = this.extend && this.translations[lang] ? Object.assign(Object.assign({}, res), this.translations[lang]) : res; + this.updateLangs(); + this.pending = false; + }), + error: (/** + * @param {?} err + * @return {?} + */ + (err) => { + this.pending = false; + }) + }); + return loadingTranslations; + } + /** + * Manually sets an object of translations for a given language + * after passing it through the compiler + * @param {?} lang + * @param {?} translations + * @param {?=} shouldMerge + * @return {?} + */ + setTranslation(lang, translations, shouldMerge = false) { + translations = this.compiler.compileTranslations(translations, lang); + if ((shouldMerge || this.extend) && this.translations[lang]) { + this.translations[lang] = mergeDeep(this.translations[lang], translations); + } + else { + this.translations[lang] = translations; + } + this.updateLangs(); + this.onTranslationChange.emit({ lang: lang, translations: this.translations[lang] }); + } + /** + * Returns an array of currently available langs + * @return {?} + */ + getLangs() { + return this.langs; + } + /** + * Add available langs + * @param {?} langs + * @return {?} + */ + addLangs(langs) { + langs.forEach((/** + * @param {?} lang + * @return {?} + */ + (lang) => { + if (this.langs.indexOf(lang) === -1) { + this.langs.push(lang); + } + })); + } + /** + * Update the list of available langs + * @private + * @return {?} + */ + updateLangs() { + this.addLangs(Object.keys(this.translations)); + } + /** + * Returns the parsed result of the translations + * @param {?} translations + * @param {?} key + * @param {?=} interpolateParams + * @return {?} + */ + getParsedResult(translations, key, interpolateParams) { + /** @type {?} */ + let res; + if (key instanceof Array) { + /** @type {?} */ + let result = {}; + /** @type {?} */ + let observables = false; + for (let k of key) { + result[k] = this.getParsedResult(translations, k, interpolateParams); + if (isObservable(result[k])) { + observables = true; + } + } + if (observables) { + /** @type {?} */ + const sources = key.map((/** + * @param {?} k + * @return {?} + */ + k => isObservable(result[k]) ? result[k] : of((/** @type {?} */ (result[k]))))); + return forkJoin(sources).pipe(map((/** + * @param {?} arr + * @return {?} + */ + (arr) => { + /** @type {?} */ + let obj = {}; + arr.forEach((/** + * @param {?} value + * @param {?} index + * @return {?} + */ + (value, index) => { + obj[key[index]] = value; + })); + return obj; + }))); + } + return result; + } + if (translations) { + res = this.parser.interpolate(this.parser.getValue(translations, key), interpolateParams); + } + if (typeof res === "undefined" && this.defaultLang != null && this.defaultLang !== this.currentLang && this.useDefaultLang) { + res = this.parser.interpolate(this.parser.getValue(this.translations[this.defaultLang], key), interpolateParams); + } + if (typeof res === "undefined") { + /** @type {?} */ + let params = { key, translateService: this }; + if (typeof interpolateParams !== 'undefined') { + params.interpolateParams = interpolateParams; + } + res = this.missingTranslationHandler.handle(params); + } + return typeof res !== "undefined" ? res : key; + } + /** + * Gets the translated value of a key (or an array of keys) + * @param {?} key + * @param {?=} interpolateParams + * @return {?} the translated key, or an object of translated keys + */ + get(key, interpolateParams) { + if (!isDefined(key) || !key.length) { + throw new Error(`Parameter "key" required`); + } + // check if we are loading a new translation to use + if (this.pending) { + return this.loadingTranslations.pipe(concatMap((/** + * @param {?} res + * @return {?} + */ + (res) => { + res = this.getParsedResult(res, key, interpolateParams); + return isObservable(res) ? res : of(res); + }))); + } + else { + /** @type {?} */ + let res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams); + return isObservable(res) ? res : of(res); + } + } + /** + * Returns a stream of translated values of a key (or an array of keys) which updates + * whenever the translation changes. + * @param {?} key + * @param {?=} interpolateParams + * @return {?} A stream of the translated key, or an object of translated keys + */ + getStreamOnTranslationChange(key, interpolateParams) { + if (!isDefined(key) || !key.length) { + throw new Error(`Parameter "key" required`); + } + return concat(defer((/** + * @return {?} + */ + () => this.get(key, interpolateParams))), this.onTranslationChange.pipe(switchMap((/** + * @param {?} event + * @return {?} + */ + (event) => { + /** @type {?} */ + const res = this.getParsedResult(event.translations, key, interpolateParams); + if (typeof res.subscribe === 'function') { + return res; + } + else { + return of(res); + } + })))); + } + /** + * Returns a stream of translated values of a key (or an array of keys) which updates + * whenever the language changes. + * @param {?} key + * @param {?=} interpolateParams + * @return {?} A stream of the translated key, or an object of translated keys + */ + stream(key, interpolateParams) { + if (!isDefined(key) || !key.length) { + throw new Error(`Parameter "key" required`); + } + return concat(defer((/** + * @return {?} + */ + () => this.get(key, interpolateParams))), this.onLangChange.pipe(switchMap((/** + * @param {?} event + * @return {?} + */ + (event) => { + /** @type {?} */ + const res = this.getParsedResult(event.translations, key, interpolateParams); + return isObservable(res) ? res : of(res); + })))); + } + /** + * Returns a translation instantly from the internal state of loaded translation. + * All rules regarding the current language, the preferred language of even fallback languages will be used except any promise handling. + * @param {?} key + * @param {?=} interpolateParams + * @return {?} + */ + instant(key, interpolateParams) { + if (!isDefined(key) || !key.length) { + throw new Error(`Parameter "key" required`); + } + /** @type {?} */ + let res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams); + if (isObservable(res)) { + if (key instanceof Array) { + /** @type {?} */ + let obj = {}; + key.forEach((/** + * @param {?} value + * @param {?} index + * @return {?} + */ + (value, index) => { + obj[key[index]] = key[index]; + })); + return obj; + } + return key; + } + else { + return res; + } + } + /** + * Sets the translated value of a key, after compiling it + * @param {?} key + * @param {?} value + * @param {?=} lang + * @return {?} + */ + set(key, value, lang = this.currentLang) { + this.translations[lang][key] = this.compiler.compile(value, lang); + this.updateLangs(); + this.onTranslationChange.emit({ lang: lang, translations: this.translations[lang] }); + } + /** + * Changes the current lang + * @private + * @param {?} lang + * @return {?} + */ + changeLang(lang) { + this.currentLang = lang; + this.onLangChange.emit({ lang: lang, translations: this.translations[lang] }); + // if there is no default lang, use the one that we just set + if (this.defaultLang == null) { + this.changeDefaultLang(lang); + } + } + /** + * Changes the default lang + * @private + * @param {?} lang + * @return {?} + */ + changeDefaultLang(lang) { + this.defaultLang = lang; + this.onDefaultLangChange.emit({ lang: lang, translations: this.translations[lang] }); + } + /** + * Allows to reload the lang file from the file + * @param {?} lang + * @return {?} + */ + reloadLang(lang) { + this.resetLang(lang); + return this.getTranslation(lang); + } + /** + * Deletes inner translation + * @param {?} lang + * @return {?} + */ + resetLang(lang) { + this._translationRequests[lang] = undefined; + this.translations[lang] = undefined; + } + /** + * Returns the language code name from the browser, e.g. "de" + * @return {?} + */ + getBrowserLang() { + if (typeof window === 'undefined' || typeof window.navigator === 'undefined') { + return undefined; + } + /** @type {?} */ + let browserLang = window.navigator.languages ? window.navigator.languages[0] : null; + browserLang = browserLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage; + if (typeof browserLang === 'undefined') { + return undefined; + } + if (browserLang.indexOf('-') !== -1) { + browserLang = browserLang.split('-')[0]; + } + if (browserLang.indexOf('_') !== -1) { + browserLang = browserLang.split('_')[0]; + } + return browserLang; + } + /** + * Returns the culture language code name from the browser, e.g. "de-DE" + * @return {?} + */ + getBrowserCultureLang() { + if (typeof window === 'undefined' || typeof window.navigator === 'undefined') { + return undefined; + } + /** @type {?} */ + let browserCultureLang = window.navigator.languages ? window.navigator.languages[0] : null; + browserCultureLang = browserCultureLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage; + return browserCultureLang; + } +} +TranslateService.decorators = [ + { type: Injectable } +]; +/** @nocollapse */ +TranslateService.ctorParameters = () => [ + { type: TranslateStore }, + { type: TranslateLoader }, + { type: TranslateCompiler }, + { type: TranslateParser }, + { type: MissingTranslationHandler }, + { type: Boolean, decorators: [{ type: Inject, args: [USE_DEFAULT_LANG,] }] }, + { type: Boolean, decorators: [{ type: Inject, args: [USE_STORE,] }] }, + { type: Boolean, decorators: [{ type: Inject, args: [USE_EXTEND,] }] }, + { type: String, decorators: [{ type: Inject, args: [DEFAULT_LANGUAGE,] }] } +]; +if (false) { + /** + * @type {?} + * @private + */ + TranslateService.prototype.loadingTranslations; + /** + * @type {?} + * @private + */ + TranslateService.prototype.pending; + /** + * @type {?} + * @private + */ + TranslateService.prototype._onTranslationChange; + /** + * @type {?} + * @private + */ + TranslateService.prototype._onLangChange; + /** + * @type {?} + * @private + */ + TranslateService.prototype._onDefaultLangChange; + /** + * @type {?} + * @private + */ + TranslateService.prototype._defaultLang; + /** + * @type {?} + * @private + */ + TranslateService.prototype._currentLang; + /** + * @type {?} + * @private + */ + TranslateService.prototype._langs; + /** + * @type {?} + * @private + */ + TranslateService.prototype._translations; + /** + * @type {?} + * @private + */ + TranslateService.prototype._translationRequests; + /** @type {?} */ + TranslateService.prototype.store; + /** @type {?} */ + TranslateService.prototype.currentLoader; + /** @type {?} */ + TranslateService.prototype.compiler; + /** @type {?} */ + TranslateService.prototype.parser; + /** @type {?} */ + TranslateService.prototype.missingTranslationHandler; + /** + * @type {?} + * @private + */ + TranslateService.prototype.useDefaultLang; + /** + * @type {?} + * @private + */ + TranslateService.prototype.isolate; + /** + * @type {?} + * @private + */ + TranslateService.prototype.extend; +} + +/** + * @fileoverview added by tsickle + * Generated from: lib/translate.directive.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +class TranslateDirective { + /** + * @param {?} translateService + * @param {?} element + * @param {?} _ref + */ + constructor(translateService, element, _ref) { + this.translateService = translateService; + this.element = element; + this._ref = _ref; + // subscribe to onTranslationChange event, in case the translations of the current lang change + if (!this.onTranslationChangeSub) { + this.onTranslationChangeSub = this.translateService.onTranslationChange.subscribe((/** + * @param {?} event + * @return {?} + */ + (event) => { + if (event.lang === this.translateService.currentLang) { + this.checkNodes(true, event.translations); + } + })); + } + // subscribe to onLangChange event, in case the language changes + if (!this.onLangChangeSub) { + this.onLangChangeSub = this.translateService.onLangChange.subscribe((/** + * @param {?} event + * @return {?} + */ + (event) => { + this.checkNodes(true, event.translations); + })); + } + // subscribe to onDefaultLangChange event, in case the default language changes + if (!this.onDefaultLangChangeSub) { + this.onDefaultLangChangeSub = this.translateService.onDefaultLangChange.subscribe((/** + * @param {?} event + * @return {?} + */ + (event) => { + this.checkNodes(true); + })); + } + } + /** + * @param {?} key + * @return {?} + */ + set translate(key) { + if (key) { + this.key = key; + this.checkNodes(); + } + } + /** + * @param {?} params + * @return {?} + */ + set translateParams(params) { + if (!equals(this.currentParams, params)) { + this.currentParams = params; + this.checkNodes(true); + } + } + /** + * @return {?} + */ + ngAfterViewChecked() { + this.checkNodes(); + } + /** + * @param {?=} forceUpdate + * @param {?=} translations + * @return {?} + */ + checkNodes(forceUpdate = false, translations) { + /** @type {?} */ + let nodes = this.element.nativeElement.childNodes; + // if the element is empty + if (!nodes.length) { + // we add the key as content + this.setContent(this.element.nativeElement, this.key); + nodes = this.element.nativeElement.childNodes; + } + for (let i = 0; i < nodes.length; ++i) { + /** @type {?} */ + let node = nodes[i]; + if (node.nodeType === 3) { // node type 3 is a text node + // node type 3 is a text node + /** @type {?} */ + let key; + if (forceUpdate) { + node.lastKey = null; + } + if (isDefined(node.lookupKey)) { + key = node.lookupKey; + } + else if (this.key) { + key = this.key; + } + else { + /** @type {?} */ + let content = this.getContent(node); + /** @type {?} */ + let trimmedContent = content.trim(); + if (trimmedContent.length) { + node.lookupKey = trimmedContent; + // we want to use the content as a key, not the translation value + if (content !== node.currentValue) { + key = trimmedContent; + // the content was changed from the user, we'll use it as a reference if needed + node.originalContent = content || node.originalContent; + } + else if (node.originalContent) { // the content seems ok, but the lang has changed + // the current content is the translation, not the key, use the last real content as key + key = node.originalContent.trim(); + } + else if (content !== node.currentValue) { + // we want to use the content as a key, not the translation value + key = trimmedContent; + // the content was changed from the user, we'll use it as a reference if needed + node.originalContent = content || node.originalContent; + } + } + } + this.updateValue(key, node, translations); + } + } + } + /** + * @param {?} key + * @param {?} node + * @param {?} translations + * @return {?} + */ + updateValue(key, node, translations) { + if (key) { + if (node.lastKey === key && this.lastParams === this.currentParams) { + return; + } + this.lastParams = this.currentParams; + /** @type {?} */ + let onTranslation = (/** + * @param {?} res + * @return {?} + */ + (res) => { + if (res !== key) { + node.lastKey = key; + } + if (!node.originalContent) { + node.originalContent = this.getContent(node); + } + node.currentValue = isDefined(res) ? res : (node.originalContent || key); + // we replace in the original content to preserve spaces that we might have trimmed + this.setContent(node, this.key ? node.currentValue : node.originalContent.replace(key, node.currentValue)); + this._ref.markForCheck(); + }); + if (isDefined(translations)) { + /** @type {?} */ + let res = this.translateService.getParsedResult(translations, key, this.currentParams); + if (isObservable(res)) { + res.subscribe(onTranslation); + } + else { + onTranslation(res); + } + } + else { + this.translateService.get(key, this.currentParams).subscribe(onTranslation); + } + } + } + /** + * @param {?} node + * @return {?} + */ + getContent(node) { + return isDefined(node.textContent) ? node.textContent : node.data; + } + /** + * @param {?} node + * @param {?} content + * @return {?} + */ + setContent(node, content) { + if (isDefined(node.textContent)) { + node.textContent = content; + } + else { + node.data = content; + } + } + /** + * @return {?} + */ + ngOnDestroy() { + if (this.onLangChangeSub) { + this.onLangChangeSub.unsubscribe(); + } + if (this.onDefaultLangChangeSub) { + this.onDefaultLangChangeSub.unsubscribe(); + } + if (this.onTranslationChangeSub) { + this.onTranslationChangeSub.unsubscribe(); + } + } +} +TranslateDirective.decorators = [ + { type: Directive, args: [{ + selector: '[translate],[ngx-translate]' + },] } +]; +/** @nocollapse */ +TranslateDirective.ctorParameters = () => [ + { type: TranslateService }, + { type: ElementRef }, + { type: ChangeDetectorRef } +]; +TranslateDirective.propDecorators = { + translate: [{ type: Input }], + translateParams: [{ type: Input }] +}; +if (false) { + /** @type {?} */ + TranslateDirective.prototype.key; + /** @type {?} */ + TranslateDirective.prototype.lastParams; + /** @type {?} */ + TranslateDirective.prototype.currentParams; + /** @type {?} */ + TranslateDirective.prototype.onLangChangeSub; + /** @type {?} */ + TranslateDirective.prototype.onDefaultLangChangeSub; + /** @type {?} */ + TranslateDirective.prototype.onTranslationChangeSub; + /** + * @type {?} + * @private + */ + TranslateDirective.prototype.translateService; + /** + * @type {?} + * @private + */ + TranslateDirective.prototype.element; + /** + * @type {?} + * @private + */ + TranslateDirective.prototype._ref; +} + +/** + * @fileoverview added by tsickle + * Generated from: lib/translate.pipe.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +class TranslatePipe { + /** + * @param {?} translate + * @param {?} _ref + */ + constructor(translate, _ref) { + this.translate = translate; + this._ref = _ref; + this.value = ''; + } + /** + * @param {?} key + * @param {?=} interpolateParams + * @param {?=} translations + * @return {?} + */ + updateValue(key, interpolateParams, translations) { + /** @type {?} */ + let onTranslation = (/** + * @param {?} res + * @return {?} + */ + (res) => { + this.value = res !== undefined ? res : key; + this.lastKey = key; + this._ref.markForCheck(); + }); + if (translations) { + /** @type {?} */ + let res = this.translate.getParsedResult(translations, key, interpolateParams); + if (isObservable(res.subscribe)) { + res.subscribe(onTranslation); + } + else { + onTranslation(res); + } + } + this.translate.get(key, interpolateParams).subscribe(onTranslation); + } + /** + * @param {?} query + * @param {...?} args + * @return {?} + */ + transform(query, ...args) { + if (!query || !query.length) { + return query; + } + // if we ask another time for the same key, return the last value + if (equals(query, this.lastKey) && equals(args, this.lastParams)) { + return this.value; + } + /** @type {?} */ + let interpolateParams; + if (isDefined(args[0]) && args.length) { + if (typeof args[0] === 'string' && args[0].length) { + // we accept objects written in the template such as {n:1}, {'n':1}, {n:'v'} + // which is why we might need to change it to real JSON objects such as {"n":1} or {"n":"v"} + /** @type {?} */ + let validArgs = args[0] + .replace(/(\')?([a-zA-Z0-9_]+)(\')?(\s)?:/g, '"$2":') + .replace(/:(\s)?(\')(.*?)(\')/g, ':"$3"'); + try { + interpolateParams = JSON.parse(validArgs); + } + catch (e) { + throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${args[0]}`); + } + } + else if (typeof args[0] === 'object' && !Array.isArray(args[0])) { + interpolateParams = args[0]; + } + } + // store the query, in case it changes + this.lastKey = query; + // store the params, in case they change + this.lastParams = args; + // set the value + this.updateValue(query, interpolateParams); + // if there is a subscription to onLangChange, clean it + this._dispose(); + // subscribe to onTranslationChange event, in case the translations change + if (!this.onTranslationChange) { + this.onTranslationChange = this.translate.onTranslationChange.subscribe((/** + * @param {?} event + * @return {?} + */ + (event) => { + if (this.lastKey && event.lang === this.translate.currentLang) { + this.lastKey = null; + this.updateValue(query, interpolateParams, event.translations); + } + })); + } + // subscribe to onLangChange event, in case the language changes + if (!this.onLangChange) { + this.onLangChange = this.translate.onLangChange.subscribe((/** + * @param {?} event + * @return {?} + */ + (event) => { + if (this.lastKey) { + this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated + this.updateValue(query, interpolateParams, event.translations); + } + })); + } + // subscribe to onDefaultLangChange event, in case the default language changes + if (!this.onDefaultLangChange) { + this.onDefaultLangChange = this.translate.onDefaultLangChange.subscribe((/** + * @return {?} + */ + () => { + if (this.lastKey) { + this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated + this.updateValue(query, interpolateParams); + } + })); + } + return this.value; + } + /** + * Clean any existing subscription to change events + * @private + * @return {?} + */ + _dispose() { + if (typeof this.onTranslationChange !== 'undefined') { + this.onTranslationChange.unsubscribe(); + this.onTranslationChange = undefined; + } + if (typeof this.onLangChange !== 'undefined') { + this.onLangChange.unsubscribe(); + this.onLangChange = undefined; + } + if (typeof this.onDefaultLangChange !== 'undefined') { + this.onDefaultLangChange.unsubscribe(); + this.onDefaultLangChange = undefined; + } + } + /** + * @return {?} + */ + ngOnDestroy() { + this._dispose(); + } +} +TranslatePipe.decorators = [ + { type: Injectable }, + { type: Pipe, args: [{ + name: 'translate', + pure: false // required to update the value when the promise is resolved + },] } +]; +/** @nocollapse */ +TranslatePipe.ctorParameters = () => [ + { type: TranslateService }, + { type: ChangeDetectorRef } +]; +if (false) { + /** @type {?} */ + TranslatePipe.prototype.value; + /** @type {?} */ + TranslatePipe.prototype.lastKey; + /** @type {?} */ + TranslatePipe.prototype.lastParams; + /** @type {?} */ + TranslatePipe.prototype.onTranslationChange; + /** @type {?} */ + TranslatePipe.prototype.onLangChange; + /** @type {?} */ + TranslatePipe.prototype.onDefaultLangChange; + /** + * @type {?} + * @private + */ + TranslatePipe.prototype.translate; + /** + * @type {?} + * @private + */ + TranslatePipe.prototype._ref; +} + +/** + * @fileoverview added by tsickle + * Generated from: public_api.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ +/** + * @record + */ +function TranslateModuleConfig() { } +if (false) { + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.loader; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.compiler; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.parser; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.missingTranslationHandler; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.isolate; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.extend; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.useDefaultLang; + /** @type {?|undefined} */ + TranslateModuleConfig.prototype.defaultLanguage; +} +class TranslateModule { + /** + * Use this method in your root module to provide the TranslateService + * @param {?=} config + * @return {?} + */ + static forRoot(config = {}) { + return { + ngModule: TranslateModule, + providers: [ + config.loader || { provide: TranslateLoader, useClass: TranslateFakeLoader }, + config.compiler || { provide: TranslateCompiler, useClass: TranslateFakeCompiler }, + config.parser || { provide: TranslateParser, useClass: TranslateDefaultParser }, + config.missingTranslationHandler || { provide: MissingTranslationHandler, useClass: FakeMissingTranslationHandler }, + TranslateStore, + { provide: USE_STORE, useValue: config.isolate }, + { provide: USE_DEFAULT_LANG, useValue: config.useDefaultLang }, + { provide: USE_EXTEND, useValue: config.extend }, + { provide: DEFAULT_LANGUAGE, useValue: config.defaultLanguage }, + TranslateService + ] + }; + } + /** + * Use this method in your other (non root) modules to import the directive/pipe + * @param {?=} config + * @return {?} + */ + static forChild(config = {}) { + return { + ngModule: TranslateModule, + providers: [ + config.loader || { provide: TranslateLoader, useClass: TranslateFakeLoader }, + config.compiler || { provide: TranslateCompiler, useClass: TranslateFakeCompiler }, + config.parser || { provide: TranslateParser, useClass: TranslateDefaultParser }, + config.missingTranslationHandler || { provide: MissingTranslationHandler, useClass: FakeMissingTranslationHandler }, + { provide: USE_STORE, useValue: config.isolate }, + { provide: USE_DEFAULT_LANG, useValue: config.useDefaultLang }, + { provide: USE_EXTEND, useValue: config.extend }, + { provide: DEFAULT_LANGUAGE, useValue: config.defaultLanguage }, + TranslateService + ] + }; + } +} +TranslateModule.decorators = [ + { type: NgModule, args: [{ + declarations: [ + TranslatePipe, + TranslateDirective + ], + exports: [ + TranslatePipe, + TranslateDirective + ] + },] } +]; + +/** + * @fileoverview added by tsickle + * Generated from: ngx-translate-core.ts + * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc + */ + +export { DEFAULT_LANGUAGE, FakeMissingTranslationHandler, MissingTranslationHandler, TranslateCompiler, TranslateDefaultParser, TranslateDirective, TranslateFakeCompiler, TranslateFakeLoader, TranslateLoader, TranslateModule, TranslateParser, TranslatePipe, TranslateService, TranslateStore, USE_DEFAULT_LANG, USE_EXTEND, USE_STORE }; +//# sourceMappingURL=ngx-translate-core.js.map diff --git a/frontend/node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.js.map b/frontend/node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.js.map new file mode 100644 index 000000000..a27914c07 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ngx-translate-core.js","sources":["../../../../projects/ngx-translate/core/src/lib/translate.loader.ts","../../../../projects/ngx-translate/core/src/lib/missing-translation-handler.ts","../../../../projects/ngx-translate/core/src/lib/util.ts","../../../../projects/ngx-translate/core/src/lib/translate.parser.ts","../../../../projects/ngx-translate/core/src/lib/translate.compiler.ts","../../../../projects/ngx-translate/core/src/lib/translate.store.ts","../../../../projects/ngx-translate/core/src/lib/translate.service.ts","../../../../projects/ngx-translate/core/src/lib/translate.directive.ts","../../../../projects/ngx-translate/core/src/lib/translate.pipe.ts","../../../../projects/ngx-translate/core/src/public_api.ts"],"sourcesContent":["import {Injectable} from \"@angular/core\";\nimport {Observable, of} from \"rxjs\";\n\nexport abstract class TranslateLoader {\n abstract getTranslation(lang: string): Observable<any>;\n}\n\n/**\n * This loader is just a placeholder that does nothing, in case you don't need a loader at all\n */\n@Injectable()\nexport class TranslateFakeLoader extends TranslateLoader {\n getTranslation(lang: string): Observable<any> {\n return of({});\n }\n}\n","import {Injectable} from \"@angular/core\";\nimport {TranslateService} from \"./translate.service\";\n\nexport interface MissingTranslationHandlerParams {\n /**\n * the key that's missing in translation files\n */\n key: string;\n\n /**\n * an instance of the service that was unable to translate the key.\n */\n translateService: TranslateService;\n\n /**\n * interpolation params that were passed along for translating the given key.\n */\n interpolateParams?: Object;\n}\n\nexport abstract class MissingTranslationHandler {\n /**\n * A function that handles missing translations.\n *\n * @param params context for resolving a missing translation\n * @returns a value or an observable\n * If it returns a value, then this value is used.\n * If it return an observable, the value returned by this observable will be used (except if the method was \"instant\").\n * If it doesn't return then the key will be used as a value\n */\n abstract handle(params: MissingTranslationHandlerParams): any;\n}\n\n/**\n * This handler is just a placeholder that does nothing, in case you don't need a missing translation handler at all\n */\n@Injectable()\nexport class FakeMissingTranslationHandler implements MissingTranslationHandler {\n handle(params: MissingTranslationHandlerParams): string {\n return params.key;\n }\n}\n","/* tslint:disable */\n/**\n * Determines if two objects or two values are equivalent.\n *\n * Two objects or values are considered equivalent if at least one of the following is true:\n *\n * * Both objects or values pass `===` comparison.\n * * Both objects or values are of the same type and all of their properties are equal by\n * comparing them with `equals`.\n *\n * @param o1 Object or value to compare.\n * @param o2 Object or value to compare.\n * @returns true if arguments are equal.\n */\nexport function equals(o1: any, o2: any): boolean {\n if (o1 === o2) return true;\n if (o1 === null || o2 === null) return false;\n if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\n let t1 = typeof o1, t2 = typeof o2, length: number, key: any, keySet: any;\n if (t1 == t2 && t1 == 'object') {\n if (Array.isArray(o1)) {\n if (!Array.isArray(o2)) return false;\n if ((length = o1.length) == o2.length) {\n for (key = 0; key < length; key++) {\n if (!equals(o1[key], o2[key])) return false;\n }\n return true;\n }\n } else {\n if (Array.isArray(o2)) {\n return false;\n }\n keySet = Object.create(null);\n for (key in o1) {\n if (!equals(o1[key], o2[key])) {\n return false;\n }\n keySet[key] = true;\n }\n for (key in o2) {\n if (!(key in keySet) && typeof o2[key] !== 'undefined') {\n return false;\n }\n }\n return true;\n }\n }\n return false;\n}\n/* tslint:enable */\n\nexport function isDefined(value: any): boolean {\n return typeof value !== 'undefined' && value !== null;\n}\n\nexport function isObject(item: any): boolean {\n return (item && typeof item === 'object' && !Array.isArray(item));\n}\n\nexport function mergeDeep(target: any, source: any): any {\n let output = Object.assign({}, target);\n if (isObject(target) && isObject(source)) {\n Object.keys(source).forEach((key: any) => {\n if (isObject(source[key])) {\n if (!(key in target)) {\n Object.assign(output, {[key]: source[key]});\n } else {\n output[key] = mergeDeep(target[key], source[key]);\n }\n } else {\n Object.assign(output, {[key]: source[key]});\n }\n });\n }\n return output;\n}\n","import {Injectable} from \"@angular/core\";\nimport {isDefined} from \"./util\";\n\nexport abstract class TranslateParser {\n /**\n * Interpolates a string to replace parameters\n * \"This is a {{ key }}\" ==> \"This is a value\", with params = { key: \"value\" }\n * @param expr\n * @param params\n */\n abstract interpolate(expr: string | Function, params?: any): string;\n\n /**\n * Gets a value from an object by composed key\n * parser.getValue({ key1: { keyA: 'valueI' }}, 'key1.keyA') ==> 'valueI'\n * @param target\n * @param key\n */\n abstract getValue(target: any, key: string): any\n}\n\n@Injectable()\nexport class TranslateDefaultParser extends TranslateParser {\n templateMatcher: RegExp = /{{\\s?([^{}\\s]*)\\s?}}/g;\n\n public interpolate(expr: string | Function, params?: any): string {\n let result: string;\n\n if (typeof expr === 'string') {\n result = this.interpolateString(expr, params);\n } else if (typeof expr === 'function') {\n result = this.interpolateFunction(expr, params);\n } else {\n // this should not happen, but an unrelated TranslateService test depends on it\n result = expr as string;\n }\n\n return result;\n }\n\n getValue(target: any, key: string): any {\n let keys = typeof key === 'string' ? key.split('.') : [key];\n key = '';\n do {\n key += keys.shift();\n if (isDefined(target) && isDefined(target[key]) && (typeof target[key] === 'object' || !keys.length)) {\n target = target[key];\n key = '';\n } else if (!keys.length) {\n target = undefined;\n } else {\n key += '.';\n }\n } while (keys.length);\n\n return target;\n }\n\n private interpolateFunction(fn: Function, params?: any) {\n return fn(params);\n }\n\n private interpolateString(expr: string, params?: any) {\n if (!params) {\n return expr;\n }\n\n return expr.replace(this.templateMatcher, (substring: string, b: string) => {\n let r = this.getValue(params, b);\n return isDefined(r) ? r : substring;\n });\n }\n}\n","import {Injectable} from \"@angular/core\";\n\nexport abstract class TranslateCompiler {\n abstract compile(value: string, lang: string): string | Function;\n\n abstract compileTranslations(translations: any, lang: string): any;\n}\n\n/**\n * This compiler is just a placeholder that does nothing, in case you don't need a compiler at all\n */\n@Injectable()\nexport class TranslateFakeCompiler extends TranslateCompiler {\n compile(value: string, lang: string): string | Function {\n return value;\n }\n\n compileTranslations(translations: any, lang: string): any {\n return translations;\n }\n}\n","import {EventEmitter} from \"@angular/core\";\nimport {DefaultLangChangeEvent, LangChangeEvent, TranslationChangeEvent} from \"./translate.service\";\n\nexport class TranslateStore {\n /**\n * The default lang to fallback when translations are missing on the current lang\n */\n public defaultLang: string;\n\n /**\n * The lang currently used\n */\n public currentLang: string = this.defaultLang;\n\n /**\n * a list of translations per lang\n */\n public translations: any = {};\n\n /**\n * an array of langs\n */\n public langs: Array<string> = [];\n\n /**\n * An EventEmitter to listen to translation change events\n * onTranslationChange.subscribe((params: TranslationChangeEvent) => {\n * // do something\n * });\n */\n public onTranslationChange: EventEmitter<TranslationChangeEvent> = new EventEmitter<TranslationChangeEvent>();\n\n /**\n * An EventEmitter to listen to lang change events\n * onLangChange.subscribe((params: LangChangeEvent) => {\n * // do something\n * });\n */\n public onLangChange: EventEmitter<LangChangeEvent> = new EventEmitter<LangChangeEvent>();\n\n /**\n * An EventEmitter to listen to default lang change events\n * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => {\n * // do something\n * });\n */\n public onDefaultLangChange: EventEmitter<DefaultLangChangeEvent> = new EventEmitter<DefaultLangChangeEvent>();\n}\n","import {EventEmitter, Inject, Injectable, InjectionToken} from \"@angular/core\";\nimport {concat, forkJoin, isObservable, Observable, of, defer} from \"rxjs\";\nimport {concatMap, map, shareReplay, switchMap, take} from \"rxjs/operators\";\nimport {MissingTranslationHandler, MissingTranslationHandlerParams} from \"./missing-translation-handler\";\nimport {TranslateCompiler} from \"./translate.compiler\";\nimport {TranslateLoader} from \"./translate.loader\";\nimport {TranslateParser} from \"./translate.parser\";\n\nimport {TranslateStore} from \"./translate.store\";\nimport {isDefined, mergeDeep} from \"./util\";\n\nexport const USE_STORE = new InjectionToken<string>('USE_STORE');\nexport const USE_DEFAULT_LANG = new InjectionToken<string>('USE_DEFAULT_LANG');\nexport const DEFAULT_LANGUAGE = new InjectionToken<string>('DEFAULT_LANGUAGE');\nexport const USE_EXTEND = new InjectionToken<string>('USE_EXTEND');\n\nexport interface TranslationChangeEvent {\n translations: any;\n lang: string;\n}\n\nexport interface LangChangeEvent {\n lang: string;\n translations: any;\n}\n\nexport interface DefaultLangChangeEvent {\n lang: string;\n translations: any;\n}\n\ndeclare interface Window {\n navigator: any;\n}\n\ndeclare const window: Window;\n\n@Injectable()\nexport class TranslateService {\n private loadingTranslations: Observable<any>;\n private pending: boolean = false;\n private _onTranslationChange: EventEmitter<TranslationChangeEvent> = new EventEmitter<TranslationChangeEvent>();\n private _onLangChange: EventEmitter<LangChangeEvent> = new EventEmitter<LangChangeEvent>();\n private _onDefaultLangChange: EventEmitter<DefaultLangChangeEvent> = new EventEmitter<DefaultLangChangeEvent>();\n private _defaultLang: string;\n private _currentLang: string;\n private _langs: Array<string> = [];\n private _translations: any = {};\n private _translationRequests: any = {};\n\n /**\n * An EventEmitter to listen to translation change events\n * onTranslationChange.subscribe((params: TranslationChangeEvent) => {\n * // do something\n * });\n */\n get onTranslationChange(): EventEmitter<TranslationChangeEvent> {\n return this.isolate ? this._onTranslationChange : this.store.onTranslationChange;\n }\n\n /**\n * An EventEmitter to listen to lang change events\n * onLangChange.subscribe((params: LangChangeEvent) => {\n * // do something\n * });\n */\n get onLangChange(): EventEmitter<LangChangeEvent> {\n return this.isolate ? this._onLangChange : this.store.onLangChange;\n }\n\n /**\n * An EventEmitter to listen to default lang change events\n * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => {\n * // do something\n * });\n */\n get onDefaultLangChange() {\n return this.isolate ? this._onDefaultLangChange : this.store.onDefaultLangChange;\n }\n\n /**\n * The default lang to fallback when translations are missing on the current lang\n */\n get defaultLang(): string {\n return this.isolate ? this._defaultLang : this.store.defaultLang;\n }\n\n set defaultLang(defaultLang: string) {\n if (this.isolate) {\n this._defaultLang = defaultLang;\n } else {\n this.store.defaultLang = defaultLang;\n }\n }\n\n /**\n * The lang currently used\n */\n get currentLang(): string {\n return this.isolate ? this._currentLang : this.store.currentLang;\n }\n\n set currentLang(currentLang: string) {\n if (this.isolate) {\n this._currentLang = currentLang;\n } else {\n this.store.currentLang = currentLang;\n }\n }\n\n /**\n * an array of langs\n */\n get langs(): string[] {\n return this.isolate ? this._langs : this.store.langs;\n }\n\n set langs(langs: string[]) {\n if (this.isolate) {\n this._langs = langs;\n } else {\n this.store.langs = langs;\n }\n }\n\n /**\n * a list of translations per lang\n */\n get translations(): any {\n return this.isolate ? this._translations : this.store.translations;\n }\n\n set translations(translations: any) {\n if (this.isolate) {\n this._translations = translations;\n } else {\n this.store.translations = translations;\n }\n }\n\n /**\n *\n * @param store an instance of the store (that is supposed to be unique)\n * @param currentLoader An instance of the loader currently used\n * @param compiler An instance of the compiler currently used\n * @param parser An instance of the parser currently used\n * @param missingTranslationHandler A handler for missing translations.\n * @param useDefaultLang whether we should use default language translation when current language translation is missing.\n * @param isolate whether this service should use the store or not\n * @param extend To make a child module extend (and use) translations from parent modules.\n * @param defaultLanguage Set the default language using configuration\n */\n constructor(public store: TranslateStore,\n public currentLoader: TranslateLoader,\n public compiler: TranslateCompiler,\n public parser: TranslateParser,\n public missingTranslationHandler: MissingTranslationHandler,\n @Inject(USE_DEFAULT_LANG) private useDefaultLang: boolean = true,\n @Inject(USE_STORE) private isolate: boolean = false,\n @Inject(USE_EXTEND) private extend: boolean = false,\n @Inject(DEFAULT_LANGUAGE) defaultLanguage: string) {\n /** set the default language from configuration */\n if (defaultLanguage) {\n this.setDefaultLang(defaultLanguage);\n }\n }\n\n /**\n * Sets the default language to use as a fallback\n */\n public setDefaultLang(lang: string): void {\n if (lang === this.defaultLang) {\n return;\n }\n\n let pending: Observable<any> = this.retrieveTranslations(lang);\n\n if (typeof pending !== \"undefined\") {\n // on init set the defaultLang immediately\n if (this.defaultLang == null) {\n this.defaultLang = lang;\n }\n\n pending.pipe(take(1))\n .subscribe((res: any) => {\n this.changeDefaultLang(lang);\n });\n } else { // we already have this language\n this.changeDefaultLang(lang);\n }\n }\n\n /**\n * Gets the default language used\n */\n public getDefaultLang(): string {\n return this.defaultLang;\n }\n\n /**\n * Changes the lang currently used\n */\n public use(lang: string): Observable<any> {\n // don't change the language if the language given is already selected\n if (lang === this.currentLang) {\n return of(this.translations[lang]);\n }\n\n let pending: Observable<any> = this.retrieveTranslations(lang);\n\n if (typeof pending !== \"undefined\") {\n // on init set the currentLang immediately\n if (!this.currentLang) {\n this.currentLang = lang;\n }\n\n pending.pipe(take(1))\n .subscribe((res: any) => {\n this.changeLang(lang);\n });\n\n return pending;\n } else { // we have this language, return an Observable\n this.changeLang(lang);\n\n return of(this.translations[lang]);\n }\n }\n\n /**\n * Retrieves the given translations\n */\n private retrieveTranslations(lang: string): Observable<any> {\n let pending: Observable<any>;\n\n // if this language is unavailable or extend is true, ask for it\n if (typeof this.translations[lang] === \"undefined\" || this.extend) {\n this._translationRequests[lang] = this._translationRequests[lang] || this.getTranslation(lang);\n pending = this._translationRequests[lang];\n }\n\n return pending;\n }\n\n /**\n * Gets an object of translations for a given language with the current loader\n * and passes it through the compiler\n */\n public getTranslation(lang: string): Observable<any> {\n this.pending = true;\n const loadingTranslations = this.currentLoader.getTranslation(lang).pipe(\n shareReplay(1),\n take(1),\n );\n\n this.loadingTranslations = loadingTranslations.pipe(\n map((res: Object) => this.compiler.compileTranslations(res, lang)),\n shareReplay(1),\n take(1),\n );\n\n this.loadingTranslations\n .subscribe({\n next: (res: Object) => {\n this.translations[lang] = this.extend && this.translations[lang] ? { ...res, ...this.translations[lang] } : res;\n this.updateLangs();\n this.pending = false;\n },\n error: (err: any) => {\n this.pending = false;\n }\n });\n\n return loadingTranslations;\n }\n\n /**\n * Manually sets an object of translations for a given language\n * after passing it through the compiler\n */\n public setTranslation(lang: string, translations: Object, shouldMerge: boolean = false): void {\n translations = this.compiler.compileTranslations(translations, lang);\n if ((shouldMerge || this.extend) && this.translations[lang]) {\n this.translations[lang] = mergeDeep(this.translations[lang], translations);\n } else {\n this.translations[lang] = translations;\n }\n this.updateLangs();\n this.onTranslationChange.emit({lang: lang, translations: this.translations[lang]});\n }\n\n /**\n * Returns an array of currently available langs\n */\n public getLangs(): Array<string> {\n return this.langs;\n }\n\n /**\n * Add available langs\n */\n public addLangs(langs: Array<string>): void {\n langs.forEach((lang: string) => {\n if (this.langs.indexOf(lang) === -1) {\n this.langs.push(lang);\n }\n });\n }\n\n /**\n * Update the list of available langs\n */\n private updateLangs(): void {\n this.addLangs(Object.keys(this.translations));\n }\n\n /**\n * Returns the parsed result of the translations\n */\n public getParsedResult(translations: any, key: any, interpolateParams?: Object): any {\n let res: string | Observable<string>;\n\n if (key instanceof Array) {\n let result: any = {},\n observables: boolean = false;\n for (let k of key) {\n result[k] = this.getParsedResult(translations, k, interpolateParams);\n if (isObservable(result[k])) {\n observables = true;\n }\n }\n if (observables) {\n const sources = key.map(k => isObservable(result[k]) ? result[k] : of(result[k] as string));\n return forkJoin(sources).pipe(\n map((arr: Array<string>) => {\n let obj: any = {};\n arr.forEach((value: string, index: number) => {\n obj[key[index]] = value;\n });\n return obj;\n })\n );\n }\n return result;\n }\n\n if (translations) {\n res = this.parser.interpolate(this.parser.getValue(translations, key), interpolateParams);\n }\n\n if (typeof res === \"undefined\" && this.defaultLang != null && this.defaultLang !== this.currentLang && this.useDefaultLang) {\n res = this.parser.interpolate(this.parser.getValue(this.translations[this.defaultLang], key), interpolateParams);\n }\n\n if (typeof res === \"undefined\") {\n let params: MissingTranslationHandlerParams = {key, translateService: this};\n if (typeof interpolateParams !== 'undefined') {\n params.interpolateParams = interpolateParams;\n }\n res = this.missingTranslationHandler.handle(params);\n }\n\n return typeof res !== \"undefined\" ? res : key;\n }\n\n /**\n * Gets the translated value of a key (or an array of keys)\n * @returns the translated key, or an object of translated keys\n */\n public get(key: string | Array<string>, interpolateParams?: Object): Observable<string | any> {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n // check if we are loading a new translation to use\n if (this.pending) {\n return this.loadingTranslations.pipe(\n concatMap((res: any) => {\n res = this.getParsedResult(res, key, interpolateParams);\n return isObservable(res) ? res : of(res);\n }),\n );\n } else {\n let res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams);\n return isObservable(res) ? res : of(res);\n }\n }\n\n /**\n * Returns a stream of translated values of a key (or an array of keys) which updates\n * whenever the translation changes.\n * @returns A stream of the translated key, or an object of translated keys\n */\n public getStreamOnTranslationChange(key: string | Array<string>, interpolateParams?: Object): Observable<string | any> {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n\n return concat(\n defer(() => this.get(key, interpolateParams)),\n this.onTranslationChange.pipe(\n switchMap((event: TranslationChangeEvent) => {\n const res = this.getParsedResult(event.translations, key, interpolateParams);\n if (typeof res.subscribe === 'function') {\n return res;\n } else {\n return of(res);\n }\n })\n )\n );\n }\n\n /**\n * Returns a stream of translated values of a key (or an array of keys) which updates\n * whenever the language changes.\n * @returns A stream of the translated key, or an object of translated keys\n */\n public stream(key: string | Array<string>, interpolateParams?: Object): Observable<string | any> {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n\n return concat(\n defer(() => this.get(key, interpolateParams)),\n this.onLangChange.pipe(\n switchMap((event: LangChangeEvent) => {\n const res = this.getParsedResult(event.translations, key, interpolateParams);\n return isObservable(res) ? res : of(res);\n })\n ));\n }\n\n /**\n * Returns a translation instantly from the internal state of loaded translation.\n * All rules regarding the current language, the preferred language of even fallback languages will be used except any promise handling.\n */\n public instant(key: string | Array<string>, interpolateParams?: Object): string | any {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n\n let res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams);\n if (isObservable(res)) {\n if (key instanceof Array) {\n let obj: any = {};\n key.forEach((value: string, index: number) => {\n obj[key[index]] = key[index];\n });\n return obj;\n }\n return key;\n } else {\n return res;\n }\n }\n\n /**\n * Sets the translated value of a key, after compiling it\n */\n public set(key: string, value: string, lang: string = this.currentLang): void {\n this.translations[lang][key] = this.compiler.compile(value, lang);\n this.updateLangs();\n this.onTranslationChange.emit({lang: lang, translations: this.translations[lang]});\n }\n\n /**\n * Changes the current lang\n */\n private changeLang(lang: string): void {\n this.currentLang = lang;\n this.onLangChange.emit({lang: lang, translations: this.translations[lang]});\n\n // if there is no default lang, use the one that we just set\n if (this.defaultLang == null) {\n this.changeDefaultLang(lang);\n }\n }\n\n /**\n * Changes the default lang\n */\n private changeDefaultLang(lang: string): void {\n this.defaultLang = lang;\n this.onDefaultLangChange.emit({lang: lang, translations: this.translations[lang]});\n }\n\n /**\n * Allows to reload the lang file from the file\n */\n public reloadLang(lang: string): Observable<any> {\n this.resetLang(lang);\n return this.getTranslation(lang);\n }\n\n /**\n * Deletes inner translation\n */\n public resetLang(lang: string): void {\n this._translationRequests[lang] = undefined;\n this.translations[lang] = undefined;\n }\n\n /**\n * Returns the language code name from the browser, e.g. \"de\"\n */\n public getBrowserLang(): string {\n if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {\n return undefined;\n }\n\n let browserLang: any = window.navigator.languages ? window.navigator.languages[0] : null;\n browserLang = browserLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage;\n\n if (typeof browserLang === 'undefined') {\n return undefined\n }\n\n if (browserLang.indexOf('-') !== -1) {\n browserLang = browserLang.split('-')[0];\n }\n\n if (browserLang.indexOf('_') !== -1) {\n browserLang = browserLang.split('_')[0];\n }\n\n return browserLang;\n }\n\n /**\n * Returns the culture language code name from the browser, e.g. \"de-DE\"\n */\n public getBrowserCultureLang(): string {\n if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {\n return undefined;\n }\n\n let browserCultureLang: any = window.navigator.languages ? window.navigator.languages[0] : null;\n browserCultureLang = browserCultureLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage;\n\n return browserCultureLang;\n }\n}\n","import {AfterViewChecked, ChangeDetectorRef, Directive, ElementRef, Input, OnDestroy} from '@angular/core';\nimport {Subscription, isObservable} from 'rxjs';\nimport {DefaultLangChangeEvent, LangChangeEvent, TranslateService, TranslationChangeEvent} from './translate.service';\nimport {equals, isDefined} from './util';\n\n@Directive({\n selector: '[translate],[ngx-translate]'\n})\nexport class TranslateDirective implements AfterViewChecked, OnDestroy {\n key: string;\n lastParams: any;\n currentParams: any;\n onLangChangeSub: Subscription;\n onDefaultLangChangeSub: Subscription;\n onTranslationChangeSub: Subscription;\n\n @Input() set translate(key: string) {\n if (key) {\n this.key = key;\n this.checkNodes();\n }\n }\n\n @Input() set translateParams(params: any) {\n if (!equals(this.currentParams, params)) {\n this.currentParams = params;\n this.checkNodes(true);\n }\n }\n\n constructor(private translateService: TranslateService, private element: ElementRef, private _ref: ChangeDetectorRef) {\n // subscribe to onTranslationChange event, in case the translations of the current lang change\n if (!this.onTranslationChangeSub) {\n this.onTranslationChangeSub = this.translateService.onTranslationChange.subscribe((event: TranslationChangeEvent) => {\n if (event.lang === this.translateService.currentLang) {\n this.checkNodes(true, event.translations);\n }\n });\n }\n\n // subscribe to onLangChange event, in case the language changes\n if (!this.onLangChangeSub) {\n this.onLangChangeSub = this.translateService.onLangChange.subscribe((event: LangChangeEvent) => {\n this.checkNodes(true, event.translations);\n });\n }\n\n // subscribe to onDefaultLangChange event, in case the default language changes\n if (!this.onDefaultLangChangeSub) {\n this.onDefaultLangChangeSub = this.translateService.onDefaultLangChange.subscribe((event: DefaultLangChangeEvent) => {\n this.checkNodes(true);\n });\n }\n }\n\n ngAfterViewChecked() {\n this.checkNodes();\n }\n\n checkNodes(forceUpdate = false, translations?: any) {\n let nodes: NodeList = this.element.nativeElement.childNodes;\n // if the element is empty\n if (!nodes.length) {\n // we add the key as content\n this.setContent(this.element.nativeElement, this.key);\n nodes = this.element.nativeElement.childNodes;\n }\n for (let i = 0; i < nodes.length; ++i) {\n let node: any = nodes[i];\n if (node.nodeType === 3) { // node type 3 is a text node\n let key: string;\n if (forceUpdate) {\n node.lastKey = null;\n }\n if(isDefined(node.lookupKey)) {\n key = node.lookupKey;\n } else if (this.key) {\n key = this.key;\n } else {\n let content = this.getContent(node);\n let trimmedContent = content.trim();\n if (trimmedContent.length) {\n node.lookupKey = trimmedContent;\n // we want to use the content as a key, not the translation value\n if (content !== node.currentValue) {\n key = trimmedContent;\n // the content was changed from the user, we'll use it as a reference if needed\n node.originalContent = content || node.originalContent;\n } else if (node.originalContent) { // the content seems ok, but the lang has changed\n // the current content is the translation, not the key, use the last real content as key\n key = node.originalContent.trim();\n } else if (content !== node.currentValue) {\n // we want to use the content as a key, not the translation value\n key = trimmedContent;\n // the content was changed from the user, we'll use it as a reference if needed\n node.originalContent = content || node.originalContent;\n }\n }\n }\n this.updateValue(key, node, translations);\n }\n }\n }\n\n updateValue(key: string, node: any, translations: any) {\n if (key) {\n if (node.lastKey === key && this.lastParams === this.currentParams) {\n return;\n }\n\n this.lastParams = this.currentParams;\n\n let onTranslation = (res: string) => {\n if (res !== key) {\n node.lastKey = key;\n }\n if (!node.originalContent) {\n node.originalContent = this.getContent(node);\n }\n node.currentValue = isDefined(res) ? res : (node.originalContent || key);\n // we replace in the original content to preserve spaces that we might have trimmed\n this.setContent(node, this.key ? node.currentValue : node.originalContent.replace(key, node.currentValue));\n this._ref.markForCheck();\n };\n\n if (isDefined(translations)) {\n let res = this.translateService.getParsedResult(translations, key, this.currentParams);\n if (isObservable(res)) {\n res.subscribe(onTranslation);\n } else {\n onTranslation(res);\n }\n } else {\n this.translateService.get(key, this.currentParams).subscribe(onTranslation);\n }\n }\n }\n\n getContent(node: any): string {\n return isDefined(node.textContent) ? node.textContent : node.data;\n }\n\n setContent(node: any, content: string): void {\n if (isDefined(node.textContent)) {\n node.textContent = content;\n } else {\n node.data = content;\n }\n }\n\n ngOnDestroy() {\n if (this.onLangChangeSub) {\n this.onLangChangeSub.unsubscribe();\n }\n\n if (this.onDefaultLangChangeSub) {\n this.onDefaultLangChangeSub.unsubscribe();\n }\n\n if (this.onTranslationChangeSub) {\n this.onTranslationChangeSub.unsubscribe();\n }\n }\n}\n","import {ChangeDetectorRef, EventEmitter, Injectable, OnDestroy, Pipe, PipeTransform} from '@angular/core';\nimport {isObservable} from 'rxjs';\nimport {DefaultLangChangeEvent, LangChangeEvent, TranslateService, TranslationChangeEvent} from './translate.service';\nimport {equals, isDefined} from './util';\nimport { Subscription } from 'rxjs';\n\n@Injectable()\n@Pipe({\n name: 'translate',\n pure: false // required to update the value when the promise is resolved\n})\nexport class TranslatePipe implements PipeTransform, OnDestroy {\n value: string = '';\n lastKey: string;\n lastParams: any[];\n onTranslationChange: Subscription;\n onLangChange: Subscription;\n onDefaultLangChange: Subscription;\n\n constructor(private translate: TranslateService, private _ref: ChangeDetectorRef) {\n }\n\n updateValue(key: string, interpolateParams?: Object, translations?: any): void {\n let onTranslation = (res: string) => {\n this.value = res !== undefined ? res : key;\n this.lastKey = key;\n this._ref.markForCheck();\n };\n if (translations) {\n let res = this.translate.getParsedResult(translations, key, interpolateParams);\n if (isObservable(res.subscribe)) {\n res.subscribe(onTranslation);\n } else {\n onTranslation(res);\n }\n }\n this.translate.get(key, interpolateParams).subscribe(onTranslation);\n }\n\n transform(query: string, ...args: any[]): any {\n if (!query || !query.length) {\n return query;\n }\n\n // if we ask another time for the same key, return the last value\n if (equals(query, this.lastKey) && equals(args, this.lastParams)) {\n return this.value;\n }\n\n let interpolateParams: Object;\n if (isDefined(args[0]) && args.length) {\n if (typeof args[0] === 'string' && args[0].length) {\n // we accept objects written in the template such as {n:1}, {'n':1}, {n:'v'}\n // which is why we might need to change it to real JSON objects such as {\"n\":1} or {\"n\":\"v\"}\n let validArgs: string = args[0]\n .replace(/(\\')?([a-zA-Z0-9_]+)(\\')?(\\s)?:/g, '\"$2\":')\n .replace(/:(\\s)?(\\')(.*?)(\\')/g, ':\"$3\"');\n try {\n interpolateParams = JSON.parse(validArgs);\n } catch (e) {\n throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${args[0]}`);\n }\n } else if (typeof args[0] === 'object' && !Array.isArray(args[0])) {\n interpolateParams = args[0];\n }\n }\n\n // store the query, in case it changes\n this.lastKey = query;\n\n // store the params, in case they change\n this.lastParams = args;\n\n // set the value\n this.updateValue(query, interpolateParams);\n\n // if there is a subscription to onLangChange, clean it\n this._dispose();\n\n // subscribe to onTranslationChange event, in case the translations change\n if (!this.onTranslationChange) {\n this.onTranslationChange = this.translate.onTranslationChange.subscribe((event: TranslationChangeEvent) => {\n if (this.lastKey && event.lang === this.translate.currentLang) {\n this.lastKey = null;\n this.updateValue(query, interpolateParams, event.translations);\n }\n });\n }\n\n // subscribe to onLangChange event, in case the language changes\n if (!this.onLangChange) {\n this.onLangChange = this.translate.onLangChange.subscribe((event: LangChangeEvent) => {\n if (this.lastKey) {\n this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated\n this.updateValue(query, interpolateParams, event.translations);\n }\n });\n }\n\n // subscribe to onDefaultLangChange event, in case the default language changes\n if (!this.onDefaultLangChange) {\n this.onDefaultLangChange = this.translate.onDefaultLangChange.subscribe(() => {\n if (this.lastKey) {\n this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated\n this.updateValue(query, interpolateParams);\n }\n });\n }\n\n return this.value;\n }\n\n /**\n * Clean any existing subscription to change events\n */\n private _dispose(): void {\n if (typeof this.onTranslationChange !== 'undefined') {\n this.onTranslationChange.unsubscribe();\n this.onTranslationChange = undefined;\n }\n if (typeof this.onLangChange !== 'undefined') {\n this.onLangChange.unsubscribe();\n this.onLangChange = undefined;\n }\n if (typeof this.onDefaultLangChange !== 'undefined') {\n this.onDefaultLangChange.unsubscribe();\n this.onDefaultLangChange = undefined;\n }\n }\n\n ngOnDestroy(): void {\n this._dispose();\n }\n}\n","import {NgModule, ModuleWithProviders, Provider} from \"@angular/core\";\nimport {TranslateLoader, TranslateFakeLoader} from \"./lib/translate.loader\";\nimport {MissingTranslationHandler, FakeMissingTranslationHandler} from \"./lib/missing-translation-handler\";\nimport {TranslateParser, TranslateDefaultParser} from \"./lib/translate.parser\";\nimport {TranslateCompiler, TranslateFakeCompiler} from \"./lib/translate.compiler\";\nimport {TranslateDirective} from \"./lib/translate.directive\";\nimport {TranslatePipe} from \"./lib/translate.pipe\";\nimport {TranslateStore} from \"./lib/translate.store\";\nimport {USE_DEFAULT_LANG, DEFAULT_LANGUAGE, USE_STORE, TranslateService, USE_EXTEND} from \"./lib/translate.service\";\n\nexport * from \"./lib/translate.loader\";\nexport * from \"./lib/translate.service\";\nexport * from \"./lib/missing-translation-handler\";\nexport * from \"./lib/translate.parser\";\nexport * from \"./lib/translate.compiler\";\nexport * from \"./lib/translate.directive\";\nexport * from \"./lib/translate.pipe\";\nexport * from \"./lib/translate.store\";\n\nexport interface TranslateModuleConfig {\n loader?: Provider;\n compiler?: Provider;\n parser?: Provider;\n missingTranslationHandler?: Provider;\n // isolate the service instance, only works for lazy loaded modules or components with the \"providers\" property\n isolate?: boolean;\n // extends translations for a given language instead of ignoring them if present\n extend?: boolean;\n useDefaultLang?: boolean;\n defaultLanguage?: string;\n}\n\n@NgModule({\n declarations: [\n TranslatePipe,\n TranslateDirective\n ],\n exports: [\n TranslatePipe,\n TranslateDirective\n ]\n})\nexport class TranslateModule {\n /**\n * Use this method in your root module to provide the TranslateService\n */\n static forRoot(config: TranslateModuleConfig = {}): ModuleWithProviders<TranslateModule> {\n return {\n ngModule: TranslateModule,\n providers: [\n config.loader || {provide: TranslateLoader, useClass: TranslateFakeLoader},\n config.compiler || {provide: TranslateCompiler, useClass: TranslateFakeCompiler},\n config.parser || {provide: TranslateParser, useClass: TranslateDefaultParser},\n config.missingTranslationHandler || {provide: MissingTranslationHandler, useClass: FakeMissingTranslationHandler},\n TranslateStore,\n {provide: USE_STORE, useValue: config.isolate},\n {provide: USE_DEFAULT_LANG, useValue: config.useDefaultLang},\n {provide: USE_EXTEND, useValue: config.extend},\n {provide: DEFAULT_LANGUAGE, useValue: config.defaultLanguage},\n TranslateService\n ]\n };\n }\n\n /**\n * Use this method in your other (non root) modules to import the directive/pipe\n */\n static forChild(config: TranslateModuleConfig = {}): ModuleWithProviders<TranslateModule> {\n return {\n ngModule: TranslateModule,\n providers: [\n config.loader || {provide: TranslateLoader, useClass: TranslateFakeLoader},\n config.compiler || {provide: TranslateCompiler, useClass: TranslateFakeCompiler},\n config.parser || {provide: TranslateParser, useClass: TranslateDefaultParser},\n config.missingTranslationHandler || {provide: MissingTranslationHandler, useClass: FakeMissingTranslationHandler},\n {provide: USE_STORE, useValue: config.isolate},\n {provide: USE_DEFAULT_LANG, useValue: config.useDefaultLang},\n {provide: USE_EXTEND, useValue: config.extend},\n {provide: DEFAULT_LANGUAGE, useValue: config.defaultLanguage},\n TranslateService\n ]\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;MAGsB,eAAe;CAEpC;;;;;;;IADC,+DAAuD;;;;;MAO5C,mBAAoB,SAAQ,eAAe;;;;;IACtD,cAAc,CAAC,IAAY;QACzB,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;KACf;;;YAJF,UAAU;;;;;;;;;;;8CCQV;;;;;;IAXC,8CAAY;;;;;IAKZ,2DAAmC;;;;;IAKnC,4DAA2B;;;;;MAGP,yBAAyB;CAW9C;;;;;;;;;;;;IADC,mEAA8D;;;;;MAOnD,6BAA6B;;;;;IACxC,MAAM,CAAC,MAAuC;QAC5C,OAAO,MAAM,CAAC,GAAG,CAAC;KACnB;;;YAJF,UAAU;;;;;;;;;;;;;;;;;;;;;;SCtBK,MAAM,CAAC,EAAO,EAAE,EAAO;IACrC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAC3B,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC7C,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;;;QACpC,EAAE,GAAG,OAAO,EAAE;;QAAE,EAAE,GAAG,OAAO,EAAE;;QAAE,MAAc;;QAAE,GAAQ;;QAAE,MAAW;IACzE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,QAAQ,EAAE;QAC9B,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;YACrB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;gBAAE,OAAO,KAAK,CAAC;YACrC,IAAI,CAAC,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gBAC9C,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,eAAe,EAAC;gBAC7D,gBAAgB;aACjB;SACF,CAAC;KACH;;;;;;IAKD,OAAO,QAAQ,CAAC,SAAgC,EAAE;QAChD,OAAO;YACL,QAAQ,EAAE,eAAe;YACzB,SAAS,EAAE;gBACT,MAAM,CAAC,MAAM,IAAI,EAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,mBAAmB,EAAC;gBAC1E,MAAM,CAAC,QAAQ,IAAI,EAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,qBAAqB,EAAC;gBAChF,MAAM,CAAC,MAAM,IAAI,EAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,sBAAsB,EAAC;gBAC7E,MAAM,CAAC,yBAAyB,IAAI,EAAC,OAAO,EAAE,yBAAyB,EAAE,QAAQ,EAAE,6BAA6B,EAAC;gBACjH,EAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAC;gBAC9C,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,cAAc,EAAC;gBAC5D,EAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAC;gBAC9C,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,eAAe,EAAC;gBAC7D,gBAAgB;aACjB;SACF,CAAC;KACH;;;YAlDF,QAAQ,SAAC;gBACR,YAAY,EAAE;oBACZ,aAAa;oBACb,kBAAkB;iBACnB;gBACD,OAAO,EAAE;oBACP,aAAa;oBACb,kBAAkB;iBACnB;aACF;;;;;;;;;;;"} \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/core/lib/missing-translation-handler.d.ts b/frontend/node_modules/@ngx-translate/core/lib/missing-translation-handler.d.ts new file mode 100644 index 000000000..25a1c5634 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/lib/missing-translation-handler.d.ts @@ -0,0 +1,33 @@ +import { TranslateService } from "./translate.service"; +export interface MissingTranslationHandlerParams { + /** + * the key that's missing in translation files + */ + key: string; + /** + * an instance of the service that was unable to translate the key. + */ + translateService: TranslateService; + /** + * interpolation params that were passed along for translating the given key. + */ + interpolateParams?: Object; +} +export declare abstract class MissingTranslationHandler { + /** + * A function that handles missing translations. + * + * @param params context for resolving a missing translation + * @returns a value or an observable + * If it returns a value, then this value is used. + * If it return an observable, the value returned by this observable will be used (except if the method was "instant"). + * If it doesn't return then the key will be used as a value + */ + abstract handle(params: MissingTranslationHandlerParams): any; +} +/** + * This handler is just a placeholder that does nothing, in case you don't need a missing translation handler at all + */ +export declare class FakeMissingTranslationHandler implements MissingTranslationHandler { + handle(params: MissingTranslationHandlerParams): string; +} diff --git a/frontend/node_modules/@ngx-translate/core/lib/translate.compiler.d.ts b/frontend/node_modules/@ngx-translate/core/lib/translate.compiler.d.ts new file mode 100644 index 000000000..9b633a160 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/lib/translate.compiler.d.ts @@ -0,0 +1,11 @@ +export declare abstract class TranslateCompiler { + abstract compile(value: string, lang: string): string | Function; + abstract compileTranslations(translations: any, lang: string): any; +} +/** + * This compiler is just a placeholder that does nothing, in case you don't need a compiler at all + */ +export declare class TranslateFakeCompiler extends TranslateCompiler { + compile(value: string, lang: string): string | Function; + compileTranslations(translations: any, lang: string): any; +} diff --git a/frontend/node_modules/@ngx-translate/core/lib/translate.directive.d.ts b/frontend/node_modules/@ngx-translate/core/lib/translate.directive.d.ts new file mode 100644 index 000000000..e3f5af0e8 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/lib/translate.directive.d.ts @@ -0,0 +1,23 @@ +import { AfterViewChecked, ChangeDetectorRef, ElementRef, OnDestroy } from '@angular/core'; +import { Subscription } from 'rxjs'; +import { TranslateService } from './translate.service'; +export declare class TranslateDirective implements AfterViewChecked, OnDestroy { + private translateService; + private element; + private _ref; + key: string; + lastParams: any; + currentParams: any; + onLangChangeSub: Subscription; + onDefaultLangChangeSub: Subscription; + onTranslationChangeSub: Subscription; + set translate(key: string); + set translateParams(params: any); + constructor(translateService: TranslateService, element: ElementRef, _ref: ChangeDetectorRef); + ngAfterViewChecked(): void; + checkNodes(forceUpdate?: boolean, translations?: any): void; + updateValue(key: string, node: any, translations: any): void; + getContent(node: any): string; + setContent(node: any, content: string): void; + ngOnDestroy(): void; +} diff --git a/frontend/node_modules/@ngx-translate/core/lib/translate.loader.d.ts b/frontend/node_modules/@ngx-translate/core/lib/translate.loader.d.ts new file mode 100644 index 000000000..0fc5c9407 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/lib/translate.loader.d.ts @@ -0,0 +1,10 @@ +import { Observable } from "rxjs"; +export declare abstract class TranslateLoader { + abstract getTranslation(lang: string): Observable<any>; +} +/** + * This loader is just a placeholder that does nothing, in case you don't need a loader at all + */ +export declare class TranslateFakeLoader extends TranslateLoader { + getTranslation(lang: string): Observable<any>; +} diff --git a/frontend/node_modules/@ngx-translate/core/lib/translate.parser.d.ts b/frontend/node_modules/@ngx-translate/core/lib/translate.parser.d.ts new file mode 100644 index 000000000..4ffd60935 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/lib/translate.parser.d.ts @@ -0,0 +1,23 @@ +export declare abstract class TranslateParser { + /** + * Interpolates a string to replace parameters + * "This is a {{ key }}" ==> "This is a value", with params = { key: "value" } + * @param expr + * @param params + */ + abstract interpolate(expr: string | Function, params?: any): string; + /** + * Gets a value from an object by composed key + * parser.getValue({ key1: { keyA: 'valueI' }}, 'key1.keyA') ==> 'valueI' + * @param target + * @param key + */ + abstract getValue(target: any, key: string): any; +} +export declare class TranslateDefaultParser extends TranslateParser { + templateMatcher: RegExp; + interpolate(expr: string | Function, params?: any): string; + getValue(target: any, key: string): any; + private interpolateFunction; + private interpolateString; +} diff --git a/frontend/node_modules/@ngx-translate/core/lib/translate.pipe.d.ts b/frontend/node_modules/@ngx-translate/core/lib/translate.pipe.d.ts new file mode 100644 index 000000000..97f4433b0 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/lib/translate.pipe.d.ts @@ -0,0 +1,21 @@ +import { ChangeDetectorRef, OnDestroy, PipeTransform } from '@angular/core'; +import { TranslateService } from './translate.service'; +import { Subscription } from 'rxjs'; +export declare class TranslatePipe implements PipeTransform, OnDestroy { + private translate; + private _ref; + value: string; + lastKey: string; + lastParams: any[]; + onTranslationChange: Subscription; + onLangChange: Subscription; + onDefaultLangChange: Subscription; + constructor(translate: TranslateService, _ref: ChangeDetectorRef); + updateValue(key: string, interpolateParams?: Object, translations?: any): void; + transform(query: string, ...args: any[]): any; + /** + * Clean any existing subscription to change events + */ + private _dispose; + ngOnDestroy(): void; +} diff --git a/frontend/node_modules/@ngx-translate/core/lib/translate.service.d.ts b/frontend/node_modules/@ngx-translate/core/lib/translate.service.d.ts new file mode 100644 index 000000000..9d52d0fde --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/lib/translate.service.d.ts @@ -0,0 +1,189 @@ +import { EventEmitter, InjectionToken } from "@angular/core"; +import { Observable } from "rxjs"; +import { MissingTranslationHandler } from "./missing-translation-handler"; +import { TranslateCompiler } from "./translate.compiler"; +import { TranslateLoader } from "./translate.loader"; +import { TranslateParser } from "./translate.parser"; +import { TranslateStore } from "./translate.store"; +export declare const USE_STORE: InjectionToken<string>; +export declare const USE_DEFAULT_LANG: InjectionToken<string>; +export declare const DEFAULT_LANGUAGE: InjectionToken<string>; +export declare const USE_EXTEND: InjectionToken<string>; +export interface TranslationChangeEvent { + translations: any; + lang: string; +} +export interface LangChangeEvent { + lang: string; + translations: any; +} +export interface DefaultLangChangeEvent { + lang: string; + translations: any; +} +export declare class TranslateService { + store: TranslateStore; + currentLoader: TranslateLoader; + compiler: TranslateCompiler; + parser: TranslateParser; + missingTranslationHandler: MissingTranslationHandler; + private useDefaultLang; + private isolate; + private extend; + private loadingTranslations; + private pending; + private _onTranslationChange; + private _onLangChange; + private _onDefaultLangChange; + private _defaultLang; + private _currentLang; + private _langs; + private _translations; + private _translationRequests; + /** + * An EventEmitter to listen to translation change events + * onTranslationChange.subscribe((params: TranslationChangeEvent) => { + * // do something + * }); + */ + get onTranslationChange(): EventEmitter<TranslationChangeEvent>; + /** + * An EventEmitter to listen to lang change events + * onLangChange.subscribe((params: LangChangeEvent) => { + * // do something + * }); + */ + get onLangChange(): EventEmitter<LangChangeEvent>; + /** + * An EventEmitter to listen to default lang change events + * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => { + * // do something + * }); + */ + get onDefaultLangChange(): EventEmitter<DefaultLangChangeEvent>; + /** + * The default lang to fallback when translations are missing on the current lang + */ + get defaultLang(): string; + set defaultLang(defaultLang: string); + /** + * The lang currently used + */ + get currentLang(): string; + set currentLang(currentLang: string); + /** + * an array of langs + */ + get langs(): string[]; + set langs(langs: string[]); + /** + * a list of translations per lang + */ + get translations(): any; + set translations(translations: any); + /** + * + * @param store an instance of the store (that is supposed to be unique) + * @param currentLoader An instance of the loader currently used + * @param compiler An instance of the compiler currently used + * @param parser An instance of the parser currently used + * @param missingTranslationHandler A handler for missing translations. + * @param useDefaultLang whether we should use default language translation when current language translation is missing. + * @param isolate whether this service should use the store or not + * @param extend To make a child module extend (and use) translations from parent modules. + * @param defaultLanguage Set the default language using configuration + */ + constructor(store: TranslateStore, currentLoader: TranslateLoader, compiler: TranslateCompiler, parser: TranslateParser, missingTranslationHandler: MissingTranslationHandler, useDefaultLang: boolean, isolate: boolean, extend: boolean, defaultLanguage: string); + /** + * Sets the default language to use as a fallback + */ + setDefaultLang(lang: string): void; + /** + * Gets the default language used + */ + getDefaultLang(): string; + /** + * Changes the lang currently used + */ + use(lang: string): Observable<any>; + /** + * Retrieves the given translations + */ + private retrieveTranslations; + /** + * Gets an object of translations for a given language with the current loader + * and passes it through the compiler + */ + getTranslation(lang: string): Observable<any>; + /** + * Manually sets an object of translations for a given language + * after passing it through the compiler + */ + setTranslation(lang: string, translations: Object, shouldMerge?: boolean): void; + /** + * Returns an array of currently available langs + */ + getLangs(): Array<string>; + /** + * Add available langs + */ + addLangs(langs: Array<string>): void; + /** + * Update the list of available langs + */ + private updateLangs; + /** + * Returns the parsed result of the translations + */ + getParsedResult(translations: any, key: any, interpolateParams?: Object): any; + /** + * Gets the translated value of a key (or an array of keys) + * @returns the translated key, or an object of translated keys + */ + get(key: string | Array<string>, interpolateParams?: Object): Observable<string | any>; + /** + * Returns a stream of translated values of a key (or an array of keys) which updates + * whenever the translation changes. + * @returns A stream of the translated key, or an object of translated keys + */ + getStreamOnTranslationChange(key: string | Array<string>, interpolateParams?: Object): Observable<string | any>; + /** + * Returns a stream of translated values of a key (or an array of keys) which updates + * whenever the language changes. + * @returns A stream of the translated key, or an object of translated keys + */ + stream(key: string | Array<string>, interpolateParams?: Object): Observable<string | any>; + /** + * Returns a translation instantly from the internal state of loaded translation. + * All rules regarding the current language, the preferred language of even fallback languages will be used except any promise handling. + */ + instant(key: string | Array<string>, interpolateParams?: Object): string | any; + /** + * Sets the translated value of a key, after compiling it + */ + set(key: string, value: string, lang?: string): void; + /** + * Changes the current lang + */ + private changeLang; + /** + * Changes the default lang + */ + private changeDefaultLang; + /** + * Allows to reload the lang file from the file + */ + reloadLang(lang: string): Observable<any>; + /** + * Deletes inner translation + */ + resetLang(lang: string): void; + /** + * Returns the language code name from the browser, e.g. "de" + */ + getBrowserLang(): string; + /** + * Returns the culture language code name from the browser, e.g. "de-DE" + */ + getBrowserCultureLang(): string; +} diff --git a/frontend/node_modules/@ngx-translate/core/lib/translate.store.d.ts b/frontend/node_modules/@ngx-translate/core/lib/translate.store.d.ts new file mode 100644 index 000000000..7f4953692 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/lib/translate.store.d.ts @@ -0,0 +1,41 @@ +import { EventEmitter } from "@angular/core"; +import { DefaultLangChangeEvent, LangChangeEvent, TranslationChangeEvent } from "./translate.service"; +export declare class TranslateStore { + /** + * The default lang to fallback when translations are missing on the current lang + */ + defaultLang: string; + /** + * The lang currently used + */ + currentLang: string; + /** + * a list of translations per lang + */ + translations: any; + /** + * an array of langs + */ + langs: Array<string>; + /** + * An EventEmitter to listen to translation change events + * onTranslationChange.subscribe((params: TranslationChangeEvent) => { + * // do something + * }); + */ + onTranslationChange: EventEmitter<TranslationChangeEvent>; + /** + * An EventEmitter to listen to lang change events + * onLangChange.subscribe((params: LangChangeEvent) => { + * // do something + * }); + */ + onLangChange: EventEmitter<LangChangeEvent>; + /** + * An EventEmitter to listen to default lang change events + * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => { + * // do something + * }); + */ + onDefaultLangChange: EventEmitter<DefaultLangChangeEvent>; +} diff --git a/frontend/node_modules/@ngx-translate/core/lib/util.d.ts b/frontend/node_modules/@ngx-translate/core/lib/util.d.ts new file mode 100644 index 000000000..a3ae16be1 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/lib/util.d.ts @@ -0,0 +1,17 @@ +/** + * Determines if two objects or two values are equivalent. + * + * Two objects or values are considered equivalent if at least one of the following is true: + * + * * Both objects or values pass `===` comparison. + * * Both objects or values are of the same type and all of their properties are equal by + * comparing them with `equals`. + * + * @param o1 Object or value to compare. + * @param o2 Object or value to compare. + * @returns true if arguments are equal. + */ +export declare function equals(o1: any, o2: any): boolean; +export declare function isDefined(value: any): boolean; +export declare function isObject(item: any): boolean; +export declare function mergeDeep(target: any, source: any): any; diff --git a/frontend/node_modules/@ngx-translate/core/ngx-translate-core.d.ts b/frontend/node_modules/@ngx-translate/core/ngx-translate-core.d.ts new file mode 100644 index 000000000..7417cc87f --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/ngx-translate-core.d.ts @@ -0,0 +1,4 @@ +/** + * Generated bundle index. Do not edit. + */ +export * from './public_api'; diff --git a/frontend/node_modules/@ngx-translate/core/ngx-translate-core.metadata.json b/frontend/node_modules/@ngx-translate/core/ngx-translate-core.metadata.json new file mode 100644 index 000000000..133214046 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/ngx-translate-core.metadata.json @@ -0,0 +1 @@ +{"__symbolic":"module","version":4,"metadata":{"TranslateModuleConfig":{"__symbolic":"interface"},"TranslateModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":32,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"TranslatePipe"},{"__symbolic":"reference","name":"TranslateDirective"}],"exports":[{"__symbolic":"reference","name":"TranslatePipe"},{"__symbolic":"reference","name":"TranslateDirective"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":["config"],"defaults":[{}],"value":{"ngModule":{"__symbolic":"reference","name":"TranslateModule"},"providers":[{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"loader"},"right":{"provide":{"__symbolic":"reference","name":"TranslateLoader"},"useClass":{"__symbolic":"reference","name":"TranslateFakeLoader"}}},{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"compiler"},"right":{"provide":{"__symbolic":"reference","name":"TranslateCompiler"},"useClass":{"__symbolic":"reference","name":"TranslateFakeCompiler"}}},{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"parser"},"right":{"provide":{"__symbolic":"reference","name":"TranslateParser"},"useClass":{"__symbolic":"reference","name":"TranslateDefaultParser"}}},{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"missingTranslationHandler"},"right":{"provide":{"__symbolic":"reference","name":"MissingTranslationHandler"},"useClass":{"__symbolic":"reference","name":"FakeMissingTranslationHandler"}}},{"__symbolic":"reference","name":"TranslateStore"},{"provide":{"__symbolic":"reference","name":"USE_STORE"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"isolate"}},{"provide":{"__symbolic":"reference","name":"USE_DEFAULT_LANG"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"useDefaultLang"}},{"provide":{"__symbolic":"reference","name":"USE_EXTEND"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"extend"}},{"provide":{"__symbolic":"reference","name":"DEFAULT_LANGUAGE"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"defaultLanguage"}},{"__symbolic":"reference","name":"TranslateService"}]}},"forChild":{"__symbolic":"function","parameters":["config"],"defaults":[{}],"value":{"ngModule":{"__symbolic":"reference","name":"TranslateModule"},"providers":[{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"loader"},"right":{"provide":{"__symbolic":"reference","name":"TranslateLoader"},"useClass":{"__symbolic":"reference","name":"TranslateFakeLoader"}}},{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"compiler"},"right":{"provide":{"__symbolic":"reference","name":"TranslateCompiler"},"useClass":{"__symbolic":"reference","name":"TranslateFakeCompiler"}}},{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"parser"},"right":{"provide":{"__symbolic":"reference","name":"TranslateParser"},"useClass":{"__symbolic":"reference","name":"TranslateDefaultParser"}}},{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"missingTranslationHandler"},"right":{"provide":{"__symbolic":"reference","name":"MissingTranslationHandler"},"useClass":{"__symbolic":"reference","name":"FakeMissingTranslationHandler"}}},{"provide":{"__symbolic":"reference","name":"USE_STORE"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"isolate"}},{"provide":{"__symbolic":"reference","name":"USE_DEFAULT_LANG"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"useDefaultLang"}},{"provide":{"__symbolic":"reference","name":"USE_EXTEND"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"extend"}},{"provide":{"__symbolic":"reference","name":"DEFAULT_LANGUAGE"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"defaultLanguage"}},{"__symbolic":"reference","name":"TranslateService"}]}}}},"TranslateLoader":{"__symbolic":"class","members":{"getTranslation":[{"__symbolic":"method"}]}},"TranslateFakeLoader":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"TranslateLoader"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":10,"character":1}}],"members":{"getTranslation":[{"__symbolic":"method"}]}},"USE_STORE":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":11,"character":29},"arguments":["USE_STORE"]},"USE_DEFAULT_LANG":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":12,"character":36},"arguments":["USE_DEFAULT_LANG"]},"DEFAULT_LANGUAGE":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":13,"character":36},"arguments":["DEFAULT_LANGUAGE"]},"USE_EXTEND":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":14,"character":30},"arguments":["USE_EXTEND"]},"TranslationChangeEvent":{"__symbolic":"interface"},"LangChangeEvent":{"__symbolic":"interface"},"DefaultLangChangeEvent":{"__symbolic":"interface"},"TranslateService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":37,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,null,null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":157,"character":15},"arguments":[{"__symbolic":"reference","name":"USE_DEFAULT_LANG"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":158,"character":15},"arguments":[{"__symbolic":"reference","name":"USE_STORE"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":159,"character":15},"arguments":[{"__symbolic":"reference","name":"USE_EXTEND"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":160,"character":15},"arguments":[{"__symbolic":"reference","name":"DEFAULT_LANGUAGE"}]}]],"parameters":[{"__symbolic":"reference","name":"TranslateStore"},{"__symbolic":"reference","name":"TranslateLoader"},{"__symbolic":"reference","name":"TranslateCompiler"},{"__symbolic":"reference","name":"TranslateParser"},{"__symbolic":"reference","name":"MissingTranslationHandler"},{"__symbolic":"reference","name":"boolean"},{"__symbolic":"reference","name":"boolean"},{"__symbolic":"reference","name":"boolean"},{"__symbolic":"reference","name":"string"}]}],"setDefaultLang":[{"__symbolic":"method"}],"getDefaultLang":[{"__symbolic":"method"}],"use":[{"__symbolic":"method"}],"retrieveTranslations":[{"__symbolic":"method"}],"getTranslation":[{"__symbolic":"method"}],"setTranslation":[{"__symbolic":"method"}],"getLangs":[{"__symbolic":"method"}],"addLangs":[{"__symbolic":"method"}],"updateLangs":[{"__symbolic":"method"}],"getParsedResult":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"getStreamOnTranslationChange":[{"__symbolic":"method"}],"stream":[{"__symbolic":"method"}],"instant":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"changeLang":[{"__symbolic":"method"}],"changeDefaultLang":[{"__symbolic":"method"}],"reloadLang":[{"__symbolic":"method"}],"resetLang":[{"__symbolic":"method"}],"getBrowserLang":[{"__symbolic":"method"}],"getBrowserCultureLang":[{"__symbolic":"method"}]}},"MissingTranslationHandlerParams":{"__symbolic":"interface"},"MissingTranslationHandler":{"__symbolic":"class","members":{"handle":[{"__symbolic":"method"}]}},"FakeMissingTranslationHandler":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":36,"character":1}}],"members":{"handle":[{"__symbolic":"method"}]}},"TranslateParser":{"__symbolic":"class","members":{"interpolate":[{"__symbolic":"method"}],"getValue":[{"__symbolic":"method"}]}},"TranslateDefaultParser":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"TranslateParser"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":21,"character":1}}],"members":{"interpolate":[{"__symbolic":"method"}],"getValue":[{"__symbolic":"method"}],"interpolateFunction":[{"__symbolic":"method"}],"interpolateString":[{"__symbolic":"method"}]}},"TranslateCompiler":{"__symbolic":"class","members":{"compile":[{"__symbolic":"method"}],"compileTranslations":[{"__symbolic":"method"}]}},"TranslateFakeCompiler":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"TranslateCompiler"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":11,"character":1}}],"members":{"compile":[{"__symbolic":"method"}],"compileTranslations":[{"__symbolic":"method"}]}},"TranslateDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":5,"character":1},"arguments":[{"selector":"[translate],[ngx-translate]"}]}],"members":{"translate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":16,"character":3}}]}],"translateParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"TranslateService"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":30,"character":75},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":30,"character":101}]}],"ngAfterViewChecked":[{"__symbolic":"method"}],"checkNodes":[{"__symbolic":"method"}],"updateValue":[{"__symbolic":"method"}],"getContent":[{"__symbolic":"method"}],"setContent":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}},"TranslatePipe":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":6,"character":1}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Pipe","line":7,"character":1},"arguments":[{"name":"translate","pure":false}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"TranslateService"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":19,"character":65}]}],"updateValue":[{"__symbolic":"method"}],"transform":[{"__symbolic":"method"}],"_dispose":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}},"TranslateStore":{"__symbolic":"class","members":{}}},"origins":{"TranslateModuleConfig":"./public_api","TranslateModule":"./public_api","TranslateLoader":"./lib/translate.loader","TranslateFakeLoader":"./lib/translate.loader","USE_STORE":"./lib/translate.service","USE_DEFAULT_LANG":"./lib/translate.service","DEFAULT_LANGUAGE":"./lib/translate.service","USE_EXTEND":"./lib/translate.service","TranslationChangeEvent":"./lib/translate.service","LangChangeEvent":"./lib/translate.service","DefaultLangChangeEvent":"./lib/translate.service","TranslateService":"./lib/translate.service","MissingTranslationHandlerParams":"./lib/missing-translation-handler","MissingTranslationHandler":"./lib/missing-translation-handler","FakeMissingTranslationHandler":"./lib/missing-translation-handler","TranslateParser":"./lib/translate.parser","TranslateDefaultParser":"./lib/translate.parser","TranslateCompiler":"./lib/translate.compiler","TranslateFakeCompiler":"./lib/translate.compiler","TranslateDirective":"./lib/translate.directive","TranslatePipe":"./lib/translate.pipe","TranslateStore":"./lib/translate.store"},"importAs":"@ngx-translate/core"} \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/core/package.json b/frontend/node_modules/@ngx-translate/core/package.json new file mode 100644 index 000000000..3b63c2d70 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/package.json @@ -0,0 +1,69 @@ +{ + "_from": "@ngx-translate/core", + "_id": "@ngx-translate/core@13.0.0", + "_inBundle": false, + "_integrity": "sha512-+tzEp8wlqEnw0Gc7jtVRAJ6RteUjXw6JJR4O65KlnxOmJrCGPI0xjV/lKRnQeU0w4i96PQs/jtpL921Wrb7PWg==", + "_location": "/@ngx-translate/core", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "@ngx-translate/core", + "name": "@ngx-translate/core", + "escapedName": "@ngx-translate%2fcore", + "scope": "@ngx-translate", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/@ngx-translate/core/-/core-13.0.0.tgz", + "_shasum": "60547cb8a0845a2a0abfde6b0bf5ec6516a63fd6", + "_spec": "@ngx-translate/core", + "_where": "/home/reddevil/Documents/abaplans/boards/frontend", + "author": { + "name": "Olivier Combe" + }, + "bugs": { + "url": "https://github.com/ngx-translate/core/issues" + }, + "bundleDependencies": false, + "dependencies": { + "tslib": "^2.0.0" + }, + "deprecated": false, + "description": "The internationalization (i18n) library for Angular", + "es2015": "fesm2015/ngx-translate-core.js", + "esm2015": "esm2015/ngx-translate-core.js", + "fesm2015": "fesm2015/ngx-translate-core.js", + "homepage": "https://github.com/ngx-translate/core", + "keywords": [ + "angular", + "angular 2", + "i18n", + "translate", + "ngx-translate" + ], + "license": "MIT", + "main": "bundles/ngx-translate-core.umd.js", + "metadata": "ngx-translate-core.metadata.json", + "module": "fesm2015/ngx-translate-core.js", + "name": "@ngx-translate/core", + "peerDependencies": { + "@angular/core": ">=10.0.0", + "rxjs": ">=6.5.3" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ngx-translate/core.git" + }, + "scripts": { + "semantic-release": "semantic-release pre && npm publish && semantic-release post" + }, + "sideEffects": false, + "typings": "ngx-translate-core.d.ts", + "version": "13.0.0" +} diff --git a/frontend/node_modules/@ngx-translate/core/public_api.d.ts b/frontend/node_modules/@ngx-translate/core/public_api.d.ts new file mode 100644 index 000000000..a4e2128c1 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/core/public_api.d.ts @@ -0,0 +1,29 @@ +import { ModuleWithProviders, Provider } from "@angular/core"; +export * from "./lib/translate.loader"; +export * from "./lib/translate.service"; +export * from "./lib/missing-translation-handler"; +export * from "./lib/translate.parser"; +export * from "./lib/translate.compiler"; +export * from "./lib/translate.directive"; +export * from "./lib/translate.pipe"; +export * from "./lib/translate.store"; +export interface TranslateModuleConfig { + loader?: Provider; + compiler?: Provider; + parser?: Provider; + missingTranslationHandler?: Provider; + isolate?: boolean; + extend?: boolean; + useDefaultLang?: boolean; + defaultLanguage?: string; +} +export declare class TranslateModule { + /** + * Use this method in your root module to provide the TranslateService + */ + static forRoot(config?: TranslateModuleConfig): ModuleWithProviders<TranslateModule>; + /** + * Use this method in your other (non root) modules to import the directive/pipe + */ + static forChild(config?: TranslateModuleConfig): ModuleWithProviders<TranslateModule>; +} diff --git a/frontend/node_modules/@ngx-translate/http-loader/README.md b/frontend/node_modules/@ngx-translate/http-loader/README.md new file mode 100644 index 000000000..1c8f1962c --- /dev/null +++ b/frontend/node_modules/@ngx-translate/http-loader/README.md @@ -0,0 +1,125 @@ +# @ngx-translate/http-loader [](https://travis-ci.org/ngx-translate/http-loader) [](https://badge.fury.io/js/%40ngx-translate%2Fhttp-loader) + +A loader for [ngx-translate](https://github.com/ngx-translate/core) that loads translations using http. + +Simple example using ngx-translate: https://stackblitz.com/github/ngx-translate/example + +Get the complete changelog here: https://github.com/ngx-translate/http-loader/releases + +* [Installation](#installation) +* [Usage](#usage) + +## Installation + +We assume that you already installed [ngx-translate](https://github.com/ngx-translate/core). + +Now you need to install the npm module for `TranslateHttpLoader`: + +```sh +npm install @ngx-translate/http-loader --save +``` + +Choose the version corresponding to your Angular version: + + Angular | @ngx-translate/core | @ngx-translate/http-loader + ----------- | ------------------- | -------------------------- + 10 | 13.x+ | 6.x+ + 9 | 12.x+ | 5.x+ + 8 | 12.x+ | 4.x+ + 7 | 11.x+ | 4.x+ + 6 | 10.x | 3.x + 5 | 8.x to 9.x | 1.x to 2.x + 4.3 | 7.x or less | 1.x to 2.x + 2 to 4.2.x | 7.x or less | 0.x + +## Usage +#### 1. Setup the `TranslateModule` to use the `TranslateHttpLoader`: + +The `TranslateHttpLoader` uses HttpClient to load translations, which means that you have to import the HttpClientModule from `@angular/common/http` before the `TranslateModule`: + +```ts +import {NgModule} from '@angular/core'; +import {BrowserModule} from '@angular/platform-browser'; +import {HttpClientModule, HttpClient} from '@angular/common/http'; +import {TranslateModule, TranslateLoader} from '@ngx-translate/core'; +import {TranslateHttpLoader} from '@ngx-translate/http-loader'; +import {AppComponent} from "./app"; + +// AoT requires an exported function for factories +export function HttpLoaderFactory(http: HttpClient) { + return new TranslateHttpLoader(http); +} + +@NgModule({ + imports: [ + BrowserModule, + HttpClientModule, + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useFactory: HttpLoaderFactory, + deps: [HttpClient] + } + }) + ], + bootstrap: [AppComponent] +}) +export class AppModule { } +``` + +The `TranslateHttpLoader` also has two optional parameters: +- prefix: string = "/assets/i18n/" +- suffix: string = ".json" + +By using those default parameters, it will load your translations files for the lang "en" from: `/assets/i18n/en.json`. + +You can change those in the `HttpLoaderFactory` method that we just defined. For example if you want to load the "en" translations from `/public/lang-files/en-lang.json` you would use: + +```ts +export function HttpLoaderFactory(http: HttpClient) { + return new TranslateHttpLoader(http, "/public/lang-files/", "-lang.json"); +} +``` + +For now this loader only support the json format. + +## Angular CLI/Webpack TranslateLoader Example +If you are using Angular CLI (uses webpack under the hood) you can write your own `TranslateLoader` that always loads the latest translation file available during your application build. + +```typescript +// webpack-translate-loader.ts +import { TranslateLoader } from '@ngx-translate/core'; +import { Observable } from 'rxjs/Observable'; + +export class WebpackTranslateLoader implements TranslateLoader { + getTranslation(lang: string): Observable<any> { + return Observable.fromPromise(System.import(`../assets/i18n/${lang}.json`)); + } +} +``` + +Cause `System` will not be available you need to add it to your custom `typings.d.ts`: +```typescript +declare var System: System; +interface System { + import(request: string): Promise<any>; +} +``` + +Now you can use the `WebpackTranslateLoader` with your `app.module`: +```typescript +@NgModule({ + bootstrap: [AppComponent], + imports: [ + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: WebpackTranslateLoader + } + }) + ] +}) +export class AppModule { } +``` + +The disadvantage of this solution is that you have to rebuild the application everytime your translate files has changes. diff --git a/frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.js b/frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.js new file mode 100644 index 000000000..881611f1c --- /dev/null +++ b/frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.js @@ -0,0 +1,33 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define('@ngx-translate/http-loader', ['exports'], factory) : + (global = global || self, factory((global['ngx-translate'] = global['ngx-translate'] || {}, global['ngx-translate']['http-loader'] = {}))); +}(this, (function (exports) { 'use strict'; + + var TranslateHttpLoader = /** @class */ (function () { + function TranslateHttpLoader(http, prefix, suffix) { + if (prefix === void 0) { prefix = "/assets/i18n/"; } + if (suffix === void 0) { suffix = ".json"; } + this.http = http; + this.prefix = prefix; + this.suffix = suffix; + } + /** + * Gets the translations from the server + */ + TranslateHttpLoader.prototype.getTranslation = function (lang) { + return this.http.get("" + this.prefix + lang + this.suffix); + }; + return TranslateHttpLoader; + }()); + + /** + * Generated bundle index. Do not edit. + */ + + exports.TranslateHttpLoader = TranslateHttpLoader; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=ngx-translate-http-loader.umd.js.map diff --git a/frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.js.map b/frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.js.map new file mode 100644 index 000000000..07807884f --- /dev/null +++ b/frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ngx-translate-http-loader.umd.js","sources":["../../../../projects/ngx-translate/http-loader/src/lib/http-loader.ts","../../../../projects/ngx-translate/http-loader/src/ngx-translate-http-loader.ts"],"sourcesContent":["import {HttpClient} from \"@angular/common/http\";\nimport {TranslateLoader} from \"@ngx-translate/core\";\nimport {Observable} from 'rxjs';\n\nexport class TranslateHttpLoader implements TranslateLoader {\n constructor(private http: HttpClient, public prefix: string = \"/assets/i18n/\", public suffix: string = \".json\") {}\n\n /**\n * Gets the translations from the server\n */\n public getTranslation(lang: string): Observable<Object> {\n return this.http.get(`${this.prefix}${lang}${this.suffix}`);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;QAKE,6BAAoB,IAAgB,EAAS,MAAgC,EAAS,MAAwB;YAAjE,uBAAA,EAAA,wBAAgC;YAAS,uBAAA,EAAA,gBAAwB;YAA1F,SAAI,GAAJ,IAAI,CAAY;YAAS,WAAM,GAAN,MAAM,CAA0B;YAAS,WAAM,GAAN,MAAM,CAAkB;SAAI;;;;QAK3G,4CAAc,GAAd,UAAe,IAAY;YAChC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAG,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC,MAAQ,CAAC,CAAC;SAC7D;kCACF;KAAA;;ICbD;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.min.js b/frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.min.js new file mode 100644 index 000000000..fe84fb48c --- /dev/null +++ b/frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.min.js @@ -0,0 +1,2 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define("@ngx-translate/http-loader",["exports"],e):e(((t=t||self)["ngx-translate"]=t["ngx-translate"]||{},t["ngx-translate"]["http-loader"]={}))}(this,(function(t){"use strict";var e=function(){function t(t,e,n){void 0===e&&(e="/assets/i18n/"),void 0===n&&(n=".json"),this.http=t,this.prefix=e,this.suffix=n}return t.prototype.getTranslation=function(t){return this.http.get(""+this.prefix+t+this.suffix)},t}();t.TranslateHttpLoader=e,Object.defineProperty(t,"__esModule",{value:!0})})); +//# sourceMappingURL=ngx-translate-http-loader.umd.min.js.map \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.min.js.map b/frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.min.js.map new file mode 100644 index 000000000..fd0e0cb65 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/http-loader/bundles/ngx-translate-http-loader.umd.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../projects/ngx-translate/http-loader/src/lib/http-loader.ts"],"names":["TranslateHttpLoader","http","prefix","suffix","this","prototype","getTranslation","lang","get"],"mappings":"uTAKE,SAAAA,EAAoBC,EAAyBC,EAAyCC,QAAzC,IAAAD,IAAAA,EAAA,sBAAyC,IAAAC,IAAAA,EAAA,SAAlEC,KAAAH,KAAAA,EAAyBG,KAAAF,OAAAA,EAAyCE,KAAAD,OAAAA,SAK/EH,EAAAK,UAAAC,eAAA,SAAeC,GACpB,OAAOH,KAAKH,KAAKO,IAAI,GAAGJ,KAAKF,OAASK,EAAOH,KAAKD","sourcesContent":["import {HttpClient} from \"@angular/common/http\";\nimport {TranslateLoader} from \"@ngx-translate/core\";\nimport {Observable} from 'rxjs';\n\nexport class TranslateHttpLoader implements TranslateLoader {\n constructor(private http: HttpClient, public prefix: string = \"/assets/i18n/\", public suffix: string = \".json\") {}\n\n /**\n * Gets the translations from the server\n */\n public getTranslation(lang: string): Observable<Object> {\n return this.http.get(`${this.prefix}${lang}${this.suffix}`);\n }\n}\n"]} \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/http-loader/esm2015/lib/http-loader.js b/frontend/node_modules/@ngx-translate/http-loader/esm2015/lib/http-loader.js new file mode 100644 index 000000000..a8abf44bd --- /dev/null +++ b/frontend/node_modules/@ngx-translate/http-loader/esm2015/lib/http-loader.js @@ -0,0 +1,14 @@ +export class TranslateHttpLoader { + constructor(http, prefix = "/assets/i18n/", suffix = ".json") { + this.http = http; + this.prefix = prefix; + this.suffix = suffix; + } + /** + * Gets the translations from the server + */ + getTranslation(lang) { + return this.http.get(`${this.prefix}${lang}${this.suffix}`); + } +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHR0cC1sb2FkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtdHJhbnNsYXRlL2h0dHAtbG9hZGVyL3NyYy9saWIvaHR0cC1sb2FkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSUEsTUFBTSxPQUFPLG1CQUFtQjtJQUM5QixZQUFvQixJQUFnQixFQUFTLFNBQWlCLGVBQWUsRUFBUyxTQUFpQixPQUFPO1FBQTFGLFNBQUksR0FBSixJQUFJLENBQVk7UUFBUyxXQUFNLEdBQU4sTUFBTSxDQUEwQjtRQUFTLFdBQU0sR0FBTixNQUFNLENBQWtCO0lBQUcsQ0FBQztJQUVsSDs7T0FFRztJQUNJLGNBQWMsQ0FBQyxJQUFZO1FBQ2hDLE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsR0FBRyxJQUFJLENBQUMsTUFBTSxHQUFHLElBQUksR0FBRyxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUMsQ0FBQztJQUM5RCxDQUFDO0NBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge0h0dHBDbGllbnR9IGZyb20gXCJAYW5ndWxhci9jb21tb24vaHR0cFwiO1xuaW1wb3J0IHtUcmFuc2xhdGVMb2FkZXJ9IGZyb20gXCJAbmd4LXRyYW5zbGF0ZS9jb3JlXCI7XG5pbXBvcnQge09ic2VydmFibGV9IGZyb20gJ3J4anMnO1xuXG5leHBvcnQgY2xhc3MgVHJhbnNsYXRlSHR0cExvYWRlciBpbXBsZW1lbnRzIFRyYW5zbGF0ZUxvYWRlciB7XG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgaHR0cDogSHR0cENsaWVudCwgcHVibGljIHByZWZpeDogc3RyaW5nID0gXCIvYXNzZXRzL2kxOG4vXCIsIHB1YmxpYyBzdWZmaXg6IHN0cmluZyA9IFwiLmpzb25cIikge31cblxuICAvKipcbiAgICogR2V0cyB0aGUgdHJhbnNsYXRpb25zIGZyb20gdGhlIHNlcnZlclxuICAgKi9cbiAgcHVibGljIGdldFRyYW5zbGF0aW9uKGxhbmc6IHN0cmluZyk6IE9ic2VydmFibGU8T2JqZWN0PiB7XG4gICAgcmV0dXJuIHRoaXMuaHR0cC5nZXQoYCR7dGhpcy5wcmVmaXh9JHtsYW5nfSR7dGhpcy5zdWZmaXh9YCk7XG4gIH1cbn1cbiJdfQ== \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/http-loader/esm2015/ngx-translate-http-loader.js b/frontend/node_modules/@ngx-translate/http-loader/esm2015/ngx-translate-http-loader.js new file mode 100644 index 000000000..5078fb6a4 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/http-loader/esm2015/ngx-translate-http-loader.js @@ -0,0 +1,5 @@ +/** + * Generated bundle index. Do not edit. + */ +export * from './public_api'; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXRyYW5zbGF0ZS1odHRwLWxvYWRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL25neC10cmFuc2xhdGUvaHR0cC1sb2FkZXIvc3JjL25neC10cmFuc2xhdGUtaHR0cC1sb2FkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWNfYXBpJztcbiJdfQ== \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/http-loader/esm2015/public_api.js b/frontend/node_modules/@ngx-translate/http-loader/esm2015/public_api.js new file mode 100644 index 000000000..e7cfbccc9 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/http-loader/esm2015/public_api.js @@ -0,0 +1,2 @@ +export * from "./lib/http-loader"; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL25neC10cmFuc2xhdGUvaHR0cC1sb2FkZXIvc3JjL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxtQkFBbUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gXCIuL2xpYi9odHRwLWxvYWRlclwiO1xuIl19 \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/http-loader/fesm2015/ngx-translate-http-loader.js b/frontend/node_modules/@ngx-translate/http-loader/fesm2015/ngx-translate-http-loader.js new file mode 100644 index 000000000..6cc143540 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/http-loader/fesm2015/ngx-translate-http-loader.js @@ -0,0 +1,20 @@ +class TranslateHttpLoader { + constructor(http, prefix = "/assets/i18n/", suffix = ".json") { + this.http = http; + this.prefix = prefix; + this.suffix = suffix; + } + /** + * Gets the translations from the server + */ + getTranslation(lang) { + return this.http.get(`${this.prefix}${lang}${this.suffix}`); + } +} + +/** + * Generated bundle index. Do not edit. + */ + +export { TranslateHttpLoader }; +//# sourceMappingURL=ngx-translate-http-loader.js.map diff --git a/frontend/node_modules/@ngx-translate/http-loader/fesm2015/ngx-translate-http-loader.js.map b/frontend/node_modules/@ngx-translate/http-loader/fesm2015/ngx-translate-http-loader.js.map new file mode 100644 index 000000000..e2c0d41cf --- /dev/null +++ b/frontend/node_modules/@ngx-translate/http-loader/fesm2015/ngx-translate-http-loader.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ngx-translate-http-loader.js","sources":["../../../../projects/ngx-translate/http-loader/src/lib/http-loader.ts","../../../../projects/ngx-translate/http-loader/src/ngx-translate-http-loader.ts"],"sourcesContent":["import {HttpClient} from \"@angular/common/http\";\nimport {TranslateLoader} from \"@ngx-translate/core\";\nimport {Observable} from 'rxjs';\n\nexport class TranslateHttpLoader implements TranslateLoader {\n constructor(private http: HttpClient, public prefix: string = \"/assets/i18n/\", public suffix: string = \".json\") {}\n\n /**\n * Gets the translations from the server\n */\n public getTranslation(lang: string): Observable<Object> {\n return this.http.get(`${this.prefix}${lang}${this.suffix}`);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":"MAIa,mBAAmB;IAC9B,YAAoB,IAAgB,EAAS,SAAiB,eAAe,EAAS,SAAiB,OAAO;QAA1F,SAAI,GAAJ,IAAI,CAAY;QAAS,WAAM,GAAN,MAAM,CAA0B;QAAS,WAAM,GAAN,MAAM,CAAkB;KAAI;;;;IAK3G,cAAc,CAAC,IAAY;QAChC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;KAC7D;;;ACZH;;;;;;"} \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/http-loader/lib/http-loader.d.ts b/frontend/node_modules/@ngx-translate/http-loader/lib/http-loader.d.ts new file mode 100644 index 000000000..d3830150b --- /dev/null +++ b/frontend/node_modules/@ngx-translate/http-loader/lib/http-loader.d.ts @@ -0,0 +1,13 @@ +import { HttpClient } from "@angular/common/http"; +import { TranslateLoader } from "@ngx-translate/core"; +import { Observable } from 'rxjs'; +export declare class TranslateHttpLoader implements TranslateLoader { + private http; + prefix: string; + suffix: string; + constructor(http: HttpClient, prefix?: string, suffix?: string); + /** + * Gets the translations from the server + */ + getTranslation(lang: string): Observable<Object>; +} diff --git a/frontend/node_modules/@ngx-translate/http-loader/ngx-translate-http-loader.d.ts b/frontend/node_modules/@ngx-translate/http-loader/ngx-translate-http-loader.d.ts new file mode 100644 index 000000000..7417cc87f --- /dev/null +++ b/frontend/node_modules/@ngx-translate/http-loader/ngx-translate-http-loader.d.ts @@ -0,0 +1,4 @@ +/** + * Generated bundle index. Do not edit. + */ +export * from './public_api'; diff --git a/frontend/node_modules/@ngx-translate/http-loader/ngx-translate-http-loader.metadata.json b/frontend/node_modules/@ngx-translate/http-loader/ngx-translate-http-loader.metadata.json new file mode 100644 index 000000000..dd18c4184 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/http-loader/ngx-translate-http-loader.metadata.json @@ -0,0 +1 @@ +{"__symbolic":"module","version":4,"metadata":{"TranslateHttpLoader":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":5,"character":28},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"}]}],"getTranslation":[{"__symbolic":"method"}]}}},"origins":{"TranslateHttpLoader":"./lib/http-loader"},"importAs":"@ngx-translate/http-loader"} \ No newline at end of file diff --git a/frontend/node_modules/@ngx-translate/http-loader/package.json b/frontend/node_modules/@ngx-translate/http-loader/package.json new file mode 100644 index 000000000..299f43ec5 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/http-loader/package.json @@ -0,0 +1,70 @@ +{ + "_from": "@ngx-translate/http-loader", + "_id": "@ngx-translate/http-loader@6.0.0", + "_inBundle": false, + "_integrity": "sha512-LCekn6qCbeXWlhESCxU1rAbZz33WzDG0lI7Ig0pYC1o5YxJWrkU9y3Y4tNi+jakQ7R6YhTR2D3ox6APxDtA0wA==", + "_location": "/@ngx-translate/http-loader", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "@ngx-translate/http-loader", + "name": "@ngx-translate/http-loader", + "escapedName": "@ngx-translate%2fhttp-loader", + "scope": "@ngx-translate", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/@ngx-translate/http-loader/-/http-loader-6.0.0.tgz", + "_shasum": "041393ab5753f50ecf64262d624703046b8c7570", + "_spec": "@ngx-translate/http-loader", + "_where": "/home/reddevil/Documents/abaplans/boards/frontend", + "author": { + "name": "Olivier Combe" + }, + "bugs": { + "url": "https://github.com/ngx-translate/http-loader/issues" + }, + "bundleDependencies": false, + "dependencies": { + "tslib": "^2.0.0" + }, + "deprecated": false, + "description": "A loader for ngx-translate that loads translations using http", + "es2015": "fesm2015/ngx-translate-http-loader.js", + "esm2015": "esm2015/ngx-translate-http-loader.js", + "fesm2015": "fesm2015/ngx-translate-http-loader.js", + "homepage": "https://github.com/ngx-translate/http-loader", + "keywords": [ + "angular", + "angular 2", + "i18n", + "translate", + "ngx-translate" + ], + "license": "MIT", + "main": "bundles/ngx-translate-http-loader.umd.js", + "metadata": "ngx-translate-http-loader.metadata.json", + "module": "fesm2015/ngx-translate-http-loader.js", + "name": "@ngx-translate/http-loader", + "peerDependencies": { + "@ngx-translate/core": ">=13.0.0", + "@angular/common": ">=10.0.0", + "rxjs": ">=6.5.3" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ngx-translate/http-loader.git" + }, + "scripts": { + "semantic-release": "semantic-release pre && npm publish && semantic-release post" + }, + "sideEffects": false, + "typings": "ngx-translate-http-loader.d.ts", + "version": "6.0.0" +} diff --git a/frontend/node_modules/@ngx-translate/http-loader/public_api.d.ts b/frontend/node_modules/@ngx-translate/http-loader/public_api.d.ts new file mode 100644 index 000000000..f236ac369 --- /dev/null +++ b/frontend/node_modules/@ngx-translate/http-loader/public_api.d.ts @@ -0,0 +1 @@ +export * from "./lib/http-loader"; diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 2974ff073..7ac0824b2 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1557,6 +1557,22 @@ "webpack-sources": "1.4.3" } }, + "@ngx-translate/core": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/@ngx-translate/core/-/core-13.0.0.tgz", + "integrity": "sha512-+tzEp8wlqEnw0Gc7jtVRAJ6RteUjXw6JJR4O65KlnxOmJrCGPI0xjV/lKRnQeU0w4i96PQs/jtpL921Wrb7PWg==", + "requires": { + "tslib": "^2.0.0" + } + }, + "@ngx-translate/http-loader": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@ngx-translate/http-loader/-/http-loader-6.0.0.tgz", + "integrity": "sha512-LCekn6qCbeXWlhESCxU1rAbZz33WzDG0lI7Ig0pYC1o5YxJWrkU9y3Y4tNi+jakQ7R6YhTR2D3ox6APxDtA0wA==", + "requires": { + "tslib": "^2.0.0" + } + }, "@nodelib/fs.scandir": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", diff --git a/frontend/package.json b/frontend/package.json index 2260814c7..4b5aa3a24 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -21,6 +21,8 @@ "@angular/platform-browser-dynamic": "~10.0.0", "@angular/router": "~10.0.0", "@fortawesome/free-solid-svg-icons": "^5.14.0", + "@ngx-translate/core": "^13.0.0", + "@ngx-translate/http-loader": "^6.0.0", "boostrap": "^2.0.0", "bootstrap": "^4.5.0", "konva": "^6.0.0", diff --git a/frontend/src/app/app-routing.module.ts b/frontend/src/app/app-routing.module.ts index d21c13cdb..bb92ffb94 100644 --- a/frontend/src/app/app-routing.module.ts +++ b/frontend/src/app/app-routing.module.ts @@ -1,9 +1,10 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { WhiteboardPageComponent } from './whiteboard-page/whiteboard-page.component'; +import { TouchpadComponent } from './touchpad/touchpad.component'; const routes: Routes = [ - { path: '', component: WhiteboardPageComponent }, - { path: '**', component: WhiteboardPageComponent } + { path: '', pathMatch: 'full', component: WhiteboardPageComponent }, + { path: 'touchpad/:id', component: TouchpadComponent } ]; @NgModule({ imports: [RouterModule.forRoot(routes)], diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index bccb06bec..d0fc73d9c 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -16,9 +16,14 @@ import { RecorderComponent } from './recorder/recorder.component'; import { HttpClient, HttpClientModule } from '@angular/common/http'; import { MainMenuComponent } from './whiteboard-page/main-menu/main-menu.component'; import { BoardsMenuComponent } from './whiteboard-page/boards-menu/boards-menu.component'; -//import { MainMenuComponent } from './whiteboard-page/main-menu/main-menu.component'; -//import { BoardsMenuComponent } from './whiteboard-page/boards-menu/boards-menu.component'; +import { TouchpadComponent } from './touchpad/touchpad.component'; +import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; +import { TranslateHttpLoader } from '@ngx-translate/http-loader'; +export function HttpLoaderFactory(http: HttpClient) { + return new TranslateHttpLoader(http, './assets/i18n/', '.json'); +} @NgModule({ declarations: [ @@ -29,6 +34,7 @@ import { BoardsMenuComponent } from './whiteboard-page/boards-menu/boards-menu.c RecorderComponent, MainMenuComponent, BoardsMenuComponent, + TouchpadComponent, ], imports: [ BrowserModule, @@ -39,11 +45,19 @@ import { BoardsMenuComponent } from './whiteboard-page/boards-menu/boards-menu.c ModalModule.forRoot(), HttpClientModule, BrowserAnimationsModule, - BsDropdownModule.forRoot() + BsDropdownModule.forRoot(), + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useFactory: HttpLoaderFactory, + deps: [HttpClient] + } + }), ], providers: [ ShapeService, - PrinterService + PrinterService, + TranslateService ], bootstrap: [AppComponent] }) diff --git a/frontend/src/app/geometry/geometry2d.spec.ts b/frontend/src/app/geometry/geometry2d.spec.ts new file mode 100644 index 000000000..366497b7f --- /dev/null +++ b/frontend/src/app/geometry/geometry2d.spec.ts @@ -0,0 +1,70 @@ +import * as geometry2d from './geometry2d'; + +describe('geometry2d', () => { + + it('#clone should create a clone of a Vector2d with the same coordinates', () => { + const vector: geometry2d.Vector2d = {x: 1, y: 1}; + expect(geometry2d.clone(vector)).toEqual(vector); + }); + + it('#norm should return 0 for a Vector2d with (0, 0) coordinates', () => { + expect(geometry2d.norm({x: 0, y: 0} as geometry2d.Vector2d)).toBe(0); + }); + + it('#norm should return the euclidean norm of a Vector2d', () => { + const vector: geometry2d.Vector2d = {x: 1, y: 1}; + const norm = Math.sqrt(vector.x * vector.x + vector.y * vector.y); + expect(geometry2d.norm(vector)).toBe(norm); + }); + + it('#normal should return the unit normal vector to a Vector2d', () => { + const vector: geometry2d.Vector2d = {x: 1, y: 1}; + const norm = Math.sqrt(vector.x * vector.x + vector.y * vector.y); + const unitNormal: geometry2d.Vector2d = {x: -vector.y / norm, y: vector.x / norm}; + expect(geometry2d.normal(vector)).toEqual(unitNormal); + }); + + it('#add should return the result of the addition of two Vector2d', () => { + const vector1: geometry2d.Vector2d = {x: 1, y: 2}; + const vector2: geometry2d.Vector2d = {x: 2, y: 2}; + const addition: geometry2d.Vector2d = {x: vector1.x + vector2.x, y: vector1.y + vector2.y}; + expect(geometry2d.add(vector1, vector2)).toEqual(addition); + }); + + it('#subtract should return the result of the subtraction of a Vector2d from another', () => { + const vector1: geometry2d.Vector2d = {x: 2, y: 2}; + const vector2: geometry2d.Vector2d = {x: 1, y: 1}; + const subtraction: geometry2d.Vector2d = {x: vector1.x - vector2.x, y: vector1.y - vector2.y}; + expect(geometry2d.subtract(vector1, vector2)).toEqual(subtraction); + }); + + it('#crossProduct should return the result the cross product between two Vector2d', () => { + const vector1: geometry2d.Vector2d = {x: 2, y: 3}; + const vector2: geometry2d.Vector2d = {x: 3, y: 4}; + const result = vector1.x * vector2.y - vector1.y * vector2.x; + expect(geometry2d.crossProduct(vector1, vector2)).toEqual(result); + }); + + it('#scalarMultiplication shoudl return the result of the component-wise multiplication of a Vector2d by a scalar', () => { + const vector: geometry2d.Vector2d = {x: 1, y: 1}; + const scalar = 3; + const result: geometry2d.Vector2d = {x: vector.x * scalar, y: vector.y * scalar}; + expect(geometry2d.scalarMultiplication(vector, scalar)).toEqual(result); + }); + + it('#scalarDivision should return the result of the component-wise division of a Vector2d by a scalar', () => { + const vector: geometry2d.Vector2d = {x: 4, y: 4}; + const scalar = 2; + const result: geometry2d.Vector2d = {x: vector.x / scalar, y: vector.y / scalar}; + expect(geometry2d.scalarDivision(vector, scalar)).toEqual(result); + }); + + it('#vectorToArray should return an array containing the components of a Vector2d', () => { + const vector: geometry2d.Vector2d = {x: 1, y: 2}; + expect(geometry2d.vectorToArray(vector)).toEqual([1, 2]); + }); + + it('#arrayToVector should return a Vector2d with the first element of an input array as x and the second as y', () => { + expect(geometry2d.arrayToVector([1, 2])).toEqual({x: 1, y: 2} as geometry2d.Vector2d); + }); +}); diff --git a/frontend/src/app/geometry/geometry2d.ts b/frontend/src/app/geometry/geometry2d.ts new file mode 100644 index 000000000..0359b6e9c --- /dev/null +++ b/frontend/src/app/geometry/geometry2d.ts @@ -0,0 +1,256 @@ +/** + * 2D vector. + */ +export interface Vector2d { + x: number; + y: number; +} + +/** + * 2D plane. + */ +export interface Plane2d { + A: Vector2d; + B: Vector2d; + C: Vector2d; + D: Vector2d; +} + +/** + * Origin vector. + */ +export const originVector: Vector2d = { + x: 0, + y: 0 +}; + +/** + * Clone a vector. + * + * @param vector The vector to clone. + * + * @returns A new instance of Vector2d with the same coordinates. + */ +export function clone(vector: Vector2d): Vector2d { + return { + x: vector.x, + y: vector.y + }; +} + +/** + * Compute the euclidean norm of a 2D vector. + * + * @param vector The vector for which the euclidean norm must be computed. + * + * @returns The norm of the input vector. + */ +export function norm(vector: Vector2d): number { + return Math.sqrt(vector.x * vector.x + vector.y * vector.y); +} + +/** + * Get the normal vector of a 2D line (another 2D vector). + * + * @param vector The vector for which the normal must be computed. + * + * @returns A new 2D vector normal to the input. + */ +export function normal(vector: Vector2d): Vector2d { + const vectorNorm = norm(vector); + return { + x: -vector.y / vectorNorm, + y: vector.x / vectorNorm + }; +} + +/** + * Add two vectors. + * + * @param vector1 A Vector2d. + * @param vector2 Another Vector2d to add to the first. + * + * @returns A new Vector2d corresponding to the addition of the inputs. + */ +export function add(vector1: Vector2d, vector2: Vector2d): Vector2d { + return { + x: vector1.x + vector2.x, + y: vector1.y + vector2.y + }; +} + +/** + * Subtract two vectors. + * + * @param vector1 A Vector2d to subtract from. + * @param vector2 The Vector2d to subtract from the first. + * + * @returns A new Vector2d corresponding to the subtraction of the two inputs. + */ +export function subtract(vector1: Vector2d, vector2: Vector2d): Vector2d { + return { + x: vector1.x - vector2.x, + y: vector1.y - vector2.y + }; +} + +/** + * 2D cross product between vectors. + * + * @param vector1 The first vector in the product. + * @param vector2 The second vector in the product. + * + * @returns The result of the 2D cross product between the vectors. + */ +export function crossProduct(vector1: Vector2d, vector2: Vector2d): number { + return vector1.x * vector2.y - vector1.y * vector2.x; +} + +/** + * Multiply a vector by a scalar. + * + * @param vector The Vector2d which must be multiplied by a scalar. + * @param scalar The scalar to multiply the vector by. + * + * @returns A new Vector2d corresponding to the result of the multiplication. + */ +export function scalarMultiplication( + vector: Vector2d, + scalar: number +): Vector2d { + return { + x: vector.x * scalar, + y: vector.y * scalar + }; +} + +/** + * Divide a vector by a scalar. + * + * @param vector The Vector2d which must be divided by a scalar. + * @param scalar The scalar to divide the vector by. + * + * @returns A new Vector2d corresponding to the result of the division. + */ +export function scalarDivision( + vector: Vector2d, + scalar: number +): Vector2d { + return { + x: vector.x / scalar, + y: vector.y / scalar + }; +} + +/** + * Convert a Vector2d to an array of numbers. + * + * @param vector The Vector2d to convert to an array. + * + * @returns An array containing the x and y coordinates of the input vector. + */ +export function vectorToArray(vector: Vector2d): Array<number> { + return [vector.x, vector.y]; +} + +/** + * Convert a an array of 2 numbers to a Vector2d. + * + * @param vector The Vector2d to convert to an array. + * + * @returns An array containing the x and y coordinates of the input vector. + */ +export function arrayToVector(array: number[]): Vector2d { + return { + x: array[0], + y: array[1] + }; +} + +/** + * Transform coordinates from a device plane to a map plane. + * + * We use the barycentric coordinate system to apply linear transformation helping + * to find the final coordinates in an well scaled plan from a deformed plan + * + * Algo: + * - Divide the plan between two triangles + * - Find if a point is on the left or on the right of BC + * - Apply barycentric coordinate system to find alpha, beta and gamma + * parameters + * - Thanks to these parameters, transform the coordinates according + * to the well scaled vertices. + * + * + * A ------ C A --------- C + * / __/ | | ___/ | + * | __/ \ => | ___/ | + * / / x \ | / x | + * B -----_____ D B --------- D + * + * @param pressedPoint The point pressed on the device plane. + * @param devicePlane The device's plane. + * @param mapPlane The map plane to transform the coordinates to. + */ +export function transformCoordinates( + pressedPoint: Vector2d, + devicePlane: Plane2d, + mapPlane: Plane2d +): Vector2d { + if (devicePlane.A === undefined || devicePlane.B === undefined || + devicePlane.C === undefined || devicePlane.D === undefined) { + return {x: 0, y: 0} as Vector2d; + } + + const PA = subtract(devicePlane.A, pressedPoint); + const PB = subtract(devicePlane.B, pressedPoint); + const PC = subtract(devicePlane.C, pressedPoint); + const PD = subtract(devicePlane.D, pressedPoint); + + const BC = subtract(devicePlane.C, devicePlane.B); + const BP = subtract(pressedPoint, devicePlane.B); + + let PX; + let mapX; + + if (crossProduct(BP, BC) >= 0) { + /* + * A --------- C + * | P ___/ | + * | ___/ | + * | / | + * B --------- D + */ + PX = PA; + mapX = mapPlane.A; + } else { + /* + * A --------- C + * | ___/ | + * | ___/ | + * | / P | + * B --------- D + */ + PX = PD; + mapX = mapPlane.D; + } + + // Apply barycentric coordinates system to find the main parameters + const alpha = crossProduct(PB, PC); + const beta = crossProduct(PC, PX); + const gamma = crossProduct(PX, PB); + + // transformation. P_ is P' + const total = alpha + beta + gamma; + const P_ = add( + scalarMultiplication(mapX, alpha), + add( + scalarMultiplication(mapPlane.B, beta), + scalarMultiplication(mapPlane.C, gamma) + ) + ); + P_.x /= total; + P_.y /= total; + + return P_; +} diff --git a/frontend/src/app/recorder/recorder.component.ts b/frontend/src/app/recorder/recorder.component.ts index 60e21a7e9..bffa0e9f9 100644 --- a/frontend/src/app/recorder/recorder.component.ts +++ b/frontend/src/app/recorder/recorder.component.ts @@ -29,14 +29,30 @@ export class RecorderComponent { ngOnChanges(): void { this.loadAudioInPlayer() } + loadAudioInPlayer(){ if(this.selectedShape && this.shapeAudio[this.selectedShape.getAttr('id')]){ let audio = document.getElementById('audio') as HTMLMediaElement if(audio){ - console.log(audio) audio.src = this.shapeAudio[this.selectedShape.getAttr('id')] audio.load() } + } + } + public playAudioInPlayer(selShape : Konva.Node){ + ///this.loadAudioInPlayer() + console.log(selShape); + console.log(this.shapeAudio) + if(selShape && this.shapeAudio[selShape.getAttr('id')]){ + let audio = document.getElementById('audio') as HTMLMediaElement + if(audio){ + console.log('Play'); + audio.src = this.shapeAudio[selShape.getAttr('id')] + console.log(this.shapeAudio[selShape.getAttr('id')]) + audio.autoplay = true; + audio.load() + //audio.play(); + } } } diff --git a/frontend/src/app/touchpad/speech-processing/speech-processing.service.spec.ts b/frontend/src/app/touchpad/speech-processing/speech-processing.service.spec.ts new file mode 100644 index 000000000..1ed86c7cf --- /dev/null +++ b/frontend/src/app/touchpad/speech-processing/speech-processing.service.spec.ts @@ -0,0 +1,48 @@ +import { TestBed } from '@angular/core/testing'; + +import { SpeechProcessingService } from './speech-processing.service'; +import { TranslateModule } from '@ngx-translate/core'; +import { VoiceCommand } from './utils'; +import { WebSpeechProvider, SpeechProvider } from './speech-providers'; + +describe('SpeechProcessingService', () => { + let service: SpeechProcessingService; + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [ + TranslateModule.forRoot() + ] + }); + service = TestBed.get(SpeechProcessingService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); + + it('#speechRecognitionSupported should return a boolean indicating if speech recognition can be used in the selected browser', () => { + const speechRecognitionSupported = service.speechRecognitionSupported(); + expect(speechRecognitionSupported).toBe(true); + }); + + it('#addCommand should add a VoiceCommand to service\'s provider\'s commands', () => { + const command: VoiceCommand = { + commands: ['cmd'], + callback: () => {} + }; + service.addCommand(command); + const provider: {[key: string]: any} = service['speechProvider']; + expect(provider['voiceCommands'].length).toBe(1); + }); + + it('#removeAllCommands should remove all commands from the service\'s provider commands list', () => { + const command: VoiceCommand = { + commands: ['cmd'], + callback: () => {} + }; + service.addCommand(command); + service.removeAllCommands(); + const provider: {[key: string]: any} = service['speechProvider']; + expect(provider['voiceCommands'].length).toBe(0); + }); +}); diff --git a/frontend/src/app/touchpad/speech-processing/speech-processing.service.ts b/frontend/src/app/touchpad/speech-processing/speech-processing.service.ts new file mode 100644 index 000000000..8b69a52a5 --- /dev/null +++ b/frontend/src/app/touchpad/speech-processing/speech-processing.service.ts @@ -0,0 +1,60 @@ +import { Injectable } from '@angular/core'; + +import { SpeechProvider, WebSpeechProvider } from './speech-providers'; +import { TranslateService } from '@ngx-translate/core'; +import { translateLanguages, Language, VoiceCommand } from './utils'; + +@Injectable({ + providedIn: 'root' +}) +export class SpeechProcessingService { + + private speechProvider: SpeechProvider; + + constructor(translate: TranslateService) { + this.speechProvider = new WebSpeechProvider(translateLanguages[translate.currentLang]); + } + + /** + * Check whether speech recognition is supported by the browser being used by tha application. + * + * @returns A boolean indicating if speech recognition is supported. + */ + speechRecognitionSupported() { + return this.speechProvider.speechRecognitionSupported(); + } + + /** + * Set the speech service's language for speech synthesis and recognition. + * + * @param language The language to use for the service. + */ + setLanguage(language: Language) { + this.speechProvider.language = language; + } + + /** + * Use speech synthesis to say some text. + * + * @param text The text to say. + */ + say(text: string) { + this.speechProvider.say(text); + } + + /** + * Add a voice command to respond to to the service. + * + * @param voiceCommand The VoiceCommand to recognise and respond to. + */ + addCommand(voiceCommand: VoiceCommand) { + this.speechProvider.addCommand(voiceCommand); + } + + /** + * Remove all voice commands from the service. + */ + removeAllCommands() { + this.speechProvider.removeAllCommands(); + } +} diff --git a/frontend/src/app/touchpad/speech-processing/speech-providers.ts b/frontend/src/app/touchpad/speech-processing/speech-providers.ts new file mode 100644 index 000000000..b05c40bf6 --- /dev/null +++ b/frontend/src/app/touchpad/speech-processing/speech-providers.ts @@ -0,0 +1,145 @@ +import { Language, VoiceCommand, languageIds } from './utils'; + +/** + * The interface of speech providers in the application. + * SpeechProviders are objects that provide speech synthesis + * and recognition functionalities. + */ +export interface SpeechProvider { + language: Language; + speechRecognitionSupported(): boolean; + say(text: string): void; + addCommand(voiceCommand: VoiceCommand): void; + removeAllCommands(): void; +} + +interface AppWindow extends Window { + [key: string]: any; +} +const appWindow = window as AppWindow; + +// For future support in Firefox. +const SpeechRecognition = appWindow['SpeechRecognition'] || appWindow['webkitSpeechRecognition']; + +/** + * A SpeechProvider using the WebSpeech API to provide speech processing functionalities. + */ +export class WebSpeechProvider implements SpeechProvider { + + private _language: Language; + + private speechSynthesis = window.speechSynthesis; + private pitch = 1; + private rate = 1; + + private speechRecognition: SpeechRecognition; + private voiceCommands: VoiceCommand[] = []; + private currentCommand = ''; + + constructor(defaultLanguage: Language) { + } + + get language() { + return this._language; + } + + set language(language: Language) { + this._language = language; + if (this.speechRecognition) { + this.speechRecognition.lang = languageIds[language]; + } + } + + /** + * Use speech synthesis to say some input text. + * + * @param text The text to say. + */ + say(text: string) { + // Interrupt any current speech synthesis. + this.speechSynthesis.cancel(); + + const utterance = new SpeechSynthesisUtterance(text); + utterance.lang = languageIds[this.language]; + utterance.pitch = this.pitch; + utterance.rate = this.rate; + this.speechSynthesis.speak(utterance); + } + + /** + * Determine if speech recognition is supported in the browser being used. + * + * @returns A boolean value indicating if speech recognition is supported. + */ + speechRecognitionSupported() { + return !!this.speechRecognition; + } + + /** + * Add a voice command to recognise to the speech recognition. + * + * @param voiceCommand The voice command to recognise. + */ + addCommand(voiceCommand: VoiceCommand) { + this.voiceCommands.push(voiceCommand); + } + + /** + * Remove all voice commands from the speech provider. + */ + removeAllCommands() { + this.voiceCommands = []; + } + + /** + * Process a SpeechRecognitionEvent triggered by SpeechRecognition: + * check if the recognised text matches any of the SpeechProvider's commands + * and execute the associated callback if so. + * + * @param event A SpeechRecognitionEvent triggered by SpeechRecognition. + */ + private processCommand(event: SpeechRecognitionEvent) { + for (let i = event.resultIndex; i < event.results.length; i++) { + if (event.results[i].isFinal) { + this.currentCommand += event.results[i][0].transcript; + } + } + + this.currentCommand = this.currentCommand.toLowerCase().trim(); + console.log(this.currentCommand); + + let bestMatch = ''; + let callback: (param: string) => void = (param: string) => {}; + let bestMatchLength = 0; + this.voiceCommands.forEach( + (voiceCommand) => { + voiceCommand.commands.forEach( + (command) => { + if (this.currentCommand.indexOf(command) > -1) { + if (command.length > bestMatchLength) { + bestMatch = command; + bestMatchLength = command.length; + callback = voiceCommand.callback; + } + } + } + ); + } + ); + + if (bestMatch) { + // If the current command has no parameters, call it without any. + if (this.currentCommand[bestMatchLength] === undefined) { + callback(''); + + // If there are parameters, parse them and pass them to the callback. + // It is up to the callback to decide to use them or not. + } else if (this.currentCommand[bestMatchLength] === ' ') { + const param = this.currentCommand.substring(bestMatchLength + 1, this.currentCommand.length); + callback(param); + } + } + this.currentCommand = ''; + } + +} diff --git a/frontend/src/app/touchpad/speech-processing/utils.ts b/frontend/src/app/touchpad/speech-processing/utils.ts new file mode 100644 index 000000000..270de31c6 --- /dev/null +++ b/frontend/src/app/touchpad/speech-processing/utils.ts @@ -0,0 +1,60 @@ +/** + * The languages available in the application. + */ +export enum Language { + ENGLISH = 'english', + FRENCH = 'french', + GERMAN = 'german' +} + +/** + * The identifiers of the languages available in the application. + */ +export const languageIds: {[lang in Language]: string} = { + [Language.ENGLISH]: 'en-GB', + [Language.FRENCH]: 'fr-FR', + [Language.GERMAN]: 'de-DE' +}; + +/** + * The languages associated to the TranslateService language identifiers. + */ +export const translateLanguages: {[key: string]: Language} = { + en: Language.ENGLISH, + fr: Language.FRENCH, + de: Language.GERMAN +}; + +/** + * The TranslateService language identifiers associated to the application's languages. + */ +export const languagesTranslate: {[Language.ENGLISH]: string, [Language.FRENCH]: string, [Language.GERMAN]: string} = { + [Language.ENGLISH]: 'en', + [Language.FRENCH]: 'fr', + [Language.GERMAN]: 'de' +}; + +/** + * The languages recognised by speech recognition. + */ +export const recognisedLanguages: {[key: string]: Language } = { + english: Language.ENGLISH, + anglais: Language.ENGLISH, + francais: Language.FRENCH, + français: Language.FRENCH, + french: Language.FRENCH, + deutsch: Language.GERMAN, + german: Language.GERMAN, + allemand: Language.GERMAN +}; + +/** + * The interface for speech recognition voice commands: + * - 'commands' indicates the text of the different commands to be recognised in + * order to perform a specific action; + * - 'callback' is the function to execute when a command has been recognised. + */ +export interface VoiceCommand { + commands: string[]; + callback: (param?: string) => void; +} diff --git a/frontend/src/app/touchpad/touchpad.component.css b/frontend/src/app/touchpad/touchpad.component.css new file mode 100644 index 000000000..831c4d447 --- /dev/null +++ b/frontend/src/app/touchpad/touchpad.component.css @@ -0,0 +1,15 @@ +.available-space { + width: 100%; + height: 100%; + flex-grow: 1; + margin: 0 0 0 0; + background-color: white; +} + +#container{ + backgroundColor: #ffffff; +} + +#audio{ + display: none; +} diff --git a/frontend/src/app/touchpad/touchpad.component.html b/frontend/src/app/touchpad/touchpad.component.html new file mode 100644 index 000000000..6233a8343 --- /dev/null +++ b/frontend/src/app/touchpad/touchpad.component.html @@ -0,0 +1,7 @@ +<div #availableSpace class="available-space"> + <div #container id="container"></div> +</div> + +<audio id=audio controls="" *ngIf="this.shapeAudio"> + <source type="audio/wav"> +</audio> diff --git a/frontend/src/app/touchpad/touchpad.component.spec.ts b/frontend/src/app/touchpad/touchpad.component.spec.ts new file mode 100644 index 000000000..0a22e0d93 --- /dev/null +++ b/frontend/src/app/touchpad/touchpad.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TouchpadComponent } from './touchpad.component'; + +describe('TouchpadComponent', () => { + let component: TouchpadComponent; + let fixture: ComponentFixture<TouchpadComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TouchpadComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TouchpadComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/touchpad/touchpad.component.ts b/frontend/src/app/touchpad/touchpad.component.ts new file mode 100644 index 000000000..750603752 --- /dev/null +++ b/frontend/src/app/touchpad/touchpad.component.ts @@ -0,0 +1,299 @@ +import { Component, OnInit, ViewChild, AfterViewInit, OnDestroy, ElementRef, Renderer2 } from '@angular/core'; +import { Location } from '@angular/common'; +import { ActivatedRoute } from '@angular/router'; +import { TranslateService } from '@ngx-translate/core'; +import { SubscriptionLike } from 'rxjs'; +import Konva from 'konva'; + +import { SpeechProcessingService } from './speech-processing/speech-processing.service'; +import { BoardsDatabaseService } from '../whiteboard-page/boards-database/boards-database.service'; +import { translateLanguages, recognisedLanguages, Language, languagesTranslate } from './speech-processing/utils'; +import { originVector, Plane2d, Vector2d, transformCoordinates } from '../geometry/geometry2d'; +import { Audio } from '../whiteboard-page/boards-database/utils'; +import { RecorderComponent } from '../recorder/recorder.component'; + +@Component({ + selector: 'app-touchpad', + templateUrl: './touchpad.component.html', + styleUrls: ['./touchpad.component.css'] +}) +export class TouchpadComponent implements OnInit, AfterViewInit, OnDestroy { + + @ViewChild('container') private container: ElementRef; + @ViewChild('audioPlayer') private audioPlayer: RecorderComponent; + + width: number = window.innerWidth; + height: number = window.innerHeight; + selectedShape : Konva.Node = null; + shapeAudio : Map<string, string>; + boardId = ''; + /** + * The map component's plane. + */ + private boardPlane: Plane2d = { + A: originVector, + B: originVector, + C: originVector, + D: originVector + }; + /** + * The plane on the touchpad. + */ + private devicePlane: Plane2d = { + A: originVector, + B: originVector, + C: originVector, + D: originVector + }; + + private nClicks = 0; + private _mapCalibrated: boolean; + + private currentMarker: Konva.Node = null; + + private stage: Konva.Stage; + private layer: Konva.Layer; + + private locationSubscription: SubscriptionLike; + + constructor( + private route: ActivatedRoute, + private location: Location, + private translate: TranslateService, + private speechProcessingService: SpeechProcessingService, + private boardsDbService: BoardsDatabaseService, + private renderer: Renderer2 + ) { + // Set the language of the speech processing service to the lang of the translat service. + this.speechProcessingService.setLanguage(translateLanguages[this.translate.currentLang]); + + // + document.onclick = (event: MouseEvent) => { + // Go to fullscreen whenever the window is clicked. + const elem = document.getElementsByTagName('body')[0] as any; + const f = elem.requestFullscreen || + elem.msRequestFullscreen || + elem.mozRequestFullScreen || + elem.webkitRequestFullscreen; + f.call(elem); + + const click = { x: event.x || event.clientX, y: event.y || event.clientY } as Vector2d; + + if (!this.boardCalibrated) { + this.calibrateMap(click); + } else { + this.handleClick(click); + } + }; + + // Stop responding to clicks and voice commands when the user navigates + // back or to another page. + this.locationSubscription = this.location.subscribe( + () => { + document.onclick = () => {}; + // Interrupt the current utterance if there is one being spoken out. + this.speechProcessingService.say(''); + this.speechProcessingService.removeAllCommands(); + } + ); + } + + ngOnInit() { + this.shapeAudio = new Map<string, string>(); + this.load().then( () => { + + const cadre = new Konva.Rect({ + x :0, + y :0, + width : this.stage.width(), + height : this.stage.height(), + fill : 'rgba(255,255,255,0)', + fillPatternImage: null, + stroke: 'black', + strokeWidth: 4, + draggable: false + }) + this.layer.add(cadre); + cadre.moveToBottom(); + this.layer.batchDraw() + }).then() + + } + + async ngAfterViewInit() { + + } + + async load(){ + const id = this.route.snapshot.params['id']; + if (!id) { + return; + } + console.log(id) + + const boardId = +id; + const board = await this.boardsDbService.getBoard(boardId); + this.boardId = '' + board.uid; + await this.loadAudios() + this.stage = Konva.Node.create(board.graphics, 'container'); + this.layer = (this.stage.getLayers().toArray()[1] as Konva.Layer); + } + + private b64toBlob(dataURI) { + var byteString = atob(dataURI.split(',')[1]); + var ab = new ArrayBuffer(byteString.length); + var ia = new Uint8Array(ab); + + for (var i = 0; i < byteString.length; i++) { + ia[i] = byteString.charCodeAt(i); + } + return new Blob([ab], { type: 'audio/wav' }); + } + + private async loadAudios(){ + var audios : Audio[] = await this.boardsDbService.getAudios(this.boardId); + + for(let audio of audios){ + let blob = this.b64toBlob(audio.audioEncoded); + let blobUrl = URL.createObjectURL(blob); + this.shapeAudio[audio.idShape]= blobUrl; + } + } + + ngOnDestroy() { + this.locationSubscription.unsubscribe(); + } + + get boardCalibrated() { + return this.nClicks > 4; + } + + /** + * Calibrate the map in the aplpication to match the one on the physical touchpad. + * + * @param click A Vector2d representing a click on the map. + */ + private calibrateMap(click: Vector2d) { + switch (this.nClicks) { + case 0: + this.speechProcessingService.say('touchpad.voice-instructions.calibration.top-left'); + break; + + case 1: + + this.boardPlane.A = { x: 0, y: 0 } as Vector2d; + this.boardPlane.B = { x: this.stage.width(), y: 0 } as Vector2d; + this.boardPlane.C = { x: 0, y: this.stage.height() } as Vector2d; + this.boardPlane.D = { x: this.stage.width(), y: this.stage.height() } as Vector2d; + + + this.devicePlane.A = click; + + this.speechProcessingService.say('touchpad.voice-instructions.calibration.top-right'); + break; + + case 2: + this.devicePlane.B = click; + this.speechProcessingService.say('touchpad.voice-instructions.calibration.bottom-right'); + break; + + case 3: + this.devicePlane.D = click; + this.speechProcessingService.say('touchpad.voice-instructions.calibration.bottom-left'); + break; + + case 4: + this.devicePlane.C = click; + this.speechProcessingService.say('touchpad.voice-instructions.calibration.complete'); + break; + } + this.nClicks++; + } + + + /** + * Respond to a click on the application's map. + * + * @param click A Vector2d representing a click on the map. + */ + private async handleClick(click: Vector2d) { + + // Transform the user's click to a point on the map + const clickedPoint = transformCoordinates(click, this.devicePlane, this.boardPlane); + + // Inform the user if he clicked outside the map. + if (!this.isPointOnBoard(clickedPoint)) { + this.speechProcessingService.say('touchpad.voice-instructions.click-outside'); + return; + } + + if (this.currentMarker) { + this.currentMarker.destroy() + this.layer.batchDraw(); + } + + this.selectedShape = this.stage.getIntersection(clickedPoint); + this.drawMarkerOnBoard(clickedPoint); + console.log(this.selectedShape); + if(this.selectedShape && this.shapeAudio[this.selectedShape.getAttr('id')]){ + let audio = document.getElementById('audio') as HTMLMediaElement + if(audio){ + audio.autoplay = true; + audio.src = this.shapeAudio[this.selectedShape.getAttr('id')] + audio.load() + } + } + } + + /** + * Set the language for speech processing. + * + * @param language The name of the language to use for speech processing. + */ + private setLanguage(language: string) { + const lang = recognisedLanguages[language.toLowerCase()]; + + if (!lang) { + this.speechProcessingService.say('touchpad.voice-instructions.lang-error'); + return; + } + + this.translate.use(languagesTranslate[lang]); + this.speechProcessingService.setLanguage(lang); + this.speechProcessingService.say('touchpad.voice-instructions.lang-ok'); + } + + /** + * Check whether a point is on the map or not. + * + * @param point An Esri Point with WGS84 coordinates. + * + * @returns A boolean indicating if the point is on the map or not. + */ + private isPointOnBoard(point: Vector2d): boolean { + return (point.x > this.boardPlane.A.x && point.x < this.boardPlane.B.x && + point.y > this.boardPlane.A.y && point.y < this.boardPlane.C.y); + } + + /** + * Draw a marker on the touchpad's map at a given position. + * + * @param point An Esri point indicating where the marker must be drawn on the map. + */ + private drawMarkerOnBoard(point: Vector2d) { + // Draw a new marker on the map to indicate where the user clicked. + var marker = new Konva.Circle({ + x : point.x, + y : point.y, + radius : 8, + fill: 'rgba(226, 119, 40,1)', + stroke: 'rgb(255, 255, 255)', + strokeWidth : 2 + }); + + this.currentMarker = marker; + this.layer.add(marker); + this.layer.batchDraw() + } + +} diff --git a/frontend/src/app/whiteboard-page/whiteboard-page.component.ts b/frontend/src/app/whiteboard-page/whiteboard-page.component.ts index ee84cc6ff..678137cc0 100644 --- a/frontend/src/app/whiteboard-page/whiteboard-page.component.ts +++ b/frontend/src/app/whiteboard-page/whiteboard-page.component.ts @@ -23,7 +23,6 @@ export class WhiteboardPageComponent implements OnInit { @ViewChild('boardsMenu') private boardsMenuModal: BoardsMenuComponent; @ViewChild('availableSpace') private availableSpace: ElementRef<HTMLDivElement>; @ViewChild('container') private container: ElementRef<HTMLDivElement>; - @ViewChild('audioPlayer') audioPlayerRef: ElementRef<HTMLAudioElement>; width: number = window.innerWidth-330; height: number = window.innerHeight-104; @@ -98,7 +97,7 @@ export class WhiteboardPageComponent implements OnInit { this.currentShapeID = board.currentShapeID; await this.loadAudios(); this.stage = Konva.Node.create(this.openedBoard.graphics, 'container'); - this.layer = (this.stage.getLayers().toArray()[0] as Konva.Layer); + this.layer = (this.stage.getLayers().toArray()[1] as Konva.Layer); this.initTextures(); this.addLineListeners(); this.addPolygonListeners(); @@ -232,8 +231,8 @@ export class WhiteboardPageComponent implements OnInit { component.backgroundImg.moveToBottom(); component.layer.batchDraw(); }; - } + editBackground(){ this.isEditingBackground = !this.isEditingBackground; this.backgroundImg.listening(this.isEditingBackground); @@ -244,18 +243,16 @@ export class WhiteboardPageComponent implements OnInit { this.backgroundImg.moveToBottom(); } this.layer.batchDraw() - } + addShape(type: string) { this.clearSelection(); this.setSelection(type); if (type == 'ellipse') { this.addEllipse(); - } - else if (type == 'rectangle') { + } else if (type == 'rectangle') { this.addRectangle(); } - //this.clearSelection(); } addEllipse() { @@ -424,16 +421,14 @@ export class WhiteboardPageComponent implements OnInit { polygon.points(newPoints); component.layer.batchDraw(); - - }); - } + addTransformerListeners() { const component = this; const tr = new Konva.Transformer(); - // this.stage.on('mousemove', function(){ - // component.layer.batchDraw(); + // this.stage.on('mousemove', function(e){ + // document.elementFromPoint(e.evt.clientX, e.evt.clientY).click(); // }) this.stage.on('click', function(e) { if (!this.clickStartShape) { @@ -447,20 +442,14 @@ export class WhiteboardPageComponent implements OnInit { console.log(component.transformers) component.layer.batchDraw(); component.selectedShape = tr.nodes()[0]; - - - - // document.getElementById('audioPlayer').load(); - - } - else { + } else { tr.detach(); component.transformers.pop() component.layer.batchDraw(); component.selectedShape = null; } - }); + tr.on('transform', function () { var shape = tr.nodes()[0]; component.selectedShape = shape; @@ -470,10 +459,9 @@ export class WhiteboardPageComponent implements OnInit { // shape.height(shape.height()*shape.scaleY()); // shape.scaleX(1); // shape.scaleY(1); - }); - } + addDeleteListener() { const component = this; window.addEventListener('keydown', function(e) { @@ -493,7 +481,7 @@ export class WhiteboardPageComponent implements OnInit { /** * Action to perform when the save button is pressed in the edition bar: - * save the current board on the maps database server. + * save the current board on the boards database server. */ async saveBoard() { console.log("Coucou") @@ -554,10 +542,7 @@ export class WhiteboardPageComponent implements OnInit { } await this.boardsDbService.saveAudio(audio); } - - - - message = "ok"; + message = "Le projet a bien été sauvegardé"; alert(message); } catch (error) { message = "Une erreur s'est produite lors de la sauvegarde du plan"; @@ -568,7 +553,7 @@ export class WhiteboardPageComponent implements OnInit { // /** // * Action to perform when the print button is pressed in the edition bar: - // * print the current map. + // * print the current board. // */ async printBoard() { // If the map being edited hasn't been saved, show an error message and stop. @@ -591,6 +576,4 @@ export class WhiteboardPageComponent implements OnInit { this.layer.batchDraw(); }, 100); } - - } diff --git a/frontend/src/assets/i18n/de.json b/frontend/src/assets/i18n/de.json new file mode 100644 index 000000000..b78015179 --- /dev/null +++ b/frontend/src/assets/i18n/de.json @@ -0,0 +1,239 @@ +{ + "languages": { + "fr": "Français", + "en": "English", + "de": "Deutsch", + "it": "Italiano" + }, + + "editor-modals": { + "main-menu": { + "title": "Karteneditor", + "create-map": "Eine neue Karte erstellen", + "open-existing-map": "Eine bestehende Karte öffnen (bearbeiten)", + "back": "Zurück zur Webseite", + "info": "Der Karteneditor ist Teil des ABAplans-Projekt." + }, + + "maps-menu": { + "title": "Bestehende Karte", + "instructions": "Wählen Sie eine bearbeitende Karte aus, indem Sie auf die Aktionstaste klicken", + "filter-placeholder": "Nr, Titel oder Erstellungsdatum", + "loading": "Karte laden…", + "table": { + "id": "Nr.", + "title": "Titel", + "date": "Erstellungsdatum ", + "action": "Aktion" + }, + "back": "Hauptmenü" + }, + + "map-scale-error": { + "title": "Fehler", + "content": "Es ist nicht möglich, eine Karte für so ein grosses Gebiet zu erstellen! Bitte wählen Sie einen kleineren Bereich auf der Karte aus." + }, + + "print-error": { + "title": "Fehler", + "content": "Before Sie diese Karte ausdrucken können, müssen Sie die Karte mit einem Dateinamen speichern." + }, + + "touchpad-open-error": { + "title": "Fehler", + "content": "Sie müssen die Karte speichern, bevor Sie sie mit dem Touchpad öffnen können." + }, + + "loading": { + "title": "Laden", + "content": "Bitte warten Sie, dieser Vorgang dauert in der Regel weniger als eine Minute..." + } + }, + + "top-bar": { + "navigation": "Navigieren Sie auf der Karte, bis Sie das Gebiet sehen, das Sie bearbeiten möchten", + + "navigation-bar": { + "search-bar-placeholder": "Die Suchadresse", + "search-button-hint": "Suche starten", + + "zoom-plus-hint": "Heranzoomen", + "zoom-minus-hint": "Herauszommen", + + "arrow-left-hint": "Nach links scrollen", + "arrow-right-hint": "Nach rechts scrollen", + "arrow-up-hint": "Nach oben scrollen", + "arrow-down-hint": "Nach unten scrollen", + + "back-button-hint": "Zurück zum Hauptmenü", + "check-button-hint": "Den ausgewählten Bereich auf der Karte bearbeiten", + "help-button-hint": "Hilfe zeigen" + }, + + "navigation-help": { + "title": "Navigation - Hilfe", + "content": { + "search": "Um nach einer Adresse zu suchen, verwenden Sie die Suchleiste", + "navigation": "Verwenden Sie die Zoomstaste um heran-/herauszoomen und den Pfeil auf der Karte zu bewegen", + "precision": "Das Lineal ermöglicht Ihnen die Zoomgeschwindigket/Bewegunggeschwindigket auf der Karte zu ändern", + "back": "Drücken Sie die Zurückstatse um zum Hauptmenü zurückzukehren", + "check": "Drücken Sie die blaue Taste um den ausgewählten Bereich zu bestätigen und zu bearbeiten" + } + }, + + "edition": "Auf die Karte bearbeiten/zeichnen", + + "edition-bar": { + "layers": { + "basemap": "Karte", + "topography": "Symbolauswahl", + "drawings": "Korrektur" + }, + + "topographicCategories": { + "roads": "Strasse", + "city": "Stadt" + }, + + "modify-hint": "Eine bestehende Zeichnung auf der Karte ändern", + "delete-hint": "Eine bestehende Zeichnung auf der Karte löschen", + + "circle-hint": "Einen Kreis auf der Karte zeichnen", + "polygon-hint": "Ein Polygon auf die Karte zeichnen", + "guideline-hint": "Eine Hilfslinie auf die Karte zeichnen", + "pedestrian-hint": "Einen Fussgängerüberweg auf die Karte zeichnen", + "marker-hint": "Eine Sehenswürdigkeit auf die Karte zeichnen", + + "save-hint": "Die Karte speichern", + "print-hint": "Die Karte ausdrucken", + "touchpad-hint": "Die Karte mit dem Touchpad öffnen", + + "leave-hint": "Zurück zum Hauptmenü", + "help-hint": "Hilfe anzeigen" + }, + + "edition-help": { + "title": "Bearbeitung - Hilfe", + "content": { + "edit": "Klicken Sie auf die Bereichstaste und dann auf eine Zeichnung um sie zu ändern", + "delete": "Klicken Sie auf die Abbruchstaste und dann auf eine Zeichnung, auf dem Plan, um sie zu löschen", + "draw": "Um auf der Karte zu zeichnen, klicken Sie auf eine der vier Zeichnentaste (Kreis, Polygon, Hilfslinie oder Fussgängerüberweg), wählen Sie bei Bedarf ein Symbol aus und zeichnen Sie auf der Karte", + "circle": "Um einen Kreis zu zeichnen, klicken Sie auf die Karte, auf dem Sie seine Mitte platzieren möchten und bewegen Sie dann die Maus während Sie den Mauszeiger gedrückt halten, um seine Grösse zu definieren", + "polygon": "Um ein Polygon zu zeichnen, klicken Sie auf die Karte um die Eckpunkte des Polygons zu definieren", + "guideline": "Um eine Hilfslinie zu zeichnen, klicken Sie auf jeden Punkt auf der Karte um diese zu definieren", + "pedestrian": "Um ein Fussgängerübergang zu zeichnen, klicken Sie auf die Karte wo er beginnen soll und bewegen Sie dann die Maus, während Sie die Taste gedrückt halten bis Sie ihren Zielpunkt erreichen", + "visible-layers": "Mit den Optionen 'Karte', 'Symbol' und 'Korrekturen', können Sie festlegen ob die Karte, die topografischen Daten und Ihren Zeichnungen auf dem Plan sichtbar sind oder nicht", + "surfaces-groups": "Mit der Option 'Strassen'/'Stadt' können Sie festlegen, ob die Strassen oder Gebäude und Fussgängerzonen angezeigt werden sollen", + "print": "Es ist notwendig eine Karte mit einem Speichername/Dateiname zu sichern, bevor man diesen ausdruckt" + } + }, + + "texture-selection": { + "title": "Symbolauswahl", + "content": { + "selection-button": "Auswählen", + "cancel-button": "Abbrechen" + } + }, + + "marker-edition": { + "set-text": "Marker Name : ", + "text-error": "Sie müssen Text für die Markierung eingeben" + }, + + "map-saving": { + "map-exists-confirm": "Es ist nicht möglich, einen bestehenden Plan zu überschreiben. Dieser Vorgang erstellt daher einen neuen. Fortfahren?", + "new-title": "Karten Name:", + "title-error": "Eine Karte mit leerem Name kann nicht gespeichert werden!", + "success": "Karte erfolgreich gespeichert", + "error": "Beim Speichern der Karte ist ein Fehler aufgetretet" + }, + + "confirmMultipleGraphicsDeletion": "Bei diesem Vorgang werden mehrere übereinanderliegende Zeichnungen auf der Karte gelöscht. Fortfahren?", + "confirmSingleGraphicDeletion": "Bei diesem Vorgang wird eine Zeichnung auf der Karte gelöscht. Fortfahren?" + }, + + "touchpad": { + "speech-recognition-alert": "Warnung: die Spracherkennung ist in dem von Ihnen verwendeten Browser nicht verfügbar. Wir empfehlen Ihnen Google Chrome zu verwenden, um Zugriff darauf zu erhalten.", + + "voice-instructions": { + "calibration": { + "top-left": "Eine Kalibrierung ist erforderlich. Bitte drücken Sie auf die linke obere Ecke der Karte.", + "top-right": "Bitte drücken Sie auf die rechte obere Ecke der Karte.", + "bottom-left": "Bitte drücken Sie auf die untere linke Ecke der Karte.", + "bottom-right": "Bitte drücken Sie auf die untere rechte Ecke der Karte.", + "complete": "Kalibrierung abgeschlossen." + }, + + "click-outside": "Sie haben ausserhalb der Karte gedrückt.", + + "lang-ok": "Verstanden", + "lang-error": "Die gewünschte Sprache ist nicht verfügbar", + + "read-mode": "Lesemodus aktiviert", + "no-address": "Aucune addresse trouvée près du point pressé", + + "search": { + "start": "suche Adresse ", + "error": "Ungültige Suche", + "outside": "Die gesuchte Adresse befindet sich ausserhalb der Karte.", + "loading": "Suchvorgang", + "arrived": "Sie sind angekommen" + }, + + "directions": { + "search": "Suche", + "at-distance": "Bei", + "up": "Nach oben", + "down": "Nach unten", + "left": "Nach links", + "right": "Nach rechts", + "up-left": "Nach oben links", + "up-right": "Nach oben rechts", + "down-left": "Nach unten links", + "down-right": "Nach unten rechts", + "meters": "Meter", + "kilometers": "Kilometer" + }, + + "transportation": { + "start-search-nearest": "Die nächstgelegene Haltstelle für öffentliche Verkehrsmittel ist", + "no-stations-nearby": "Keine Haltestelle der öffentlichen Verkehrsmittel in der Nähe gefunden", + "no-point-selected": "Sie müssen zuerst einen Punkt auf der Karte auswehlen" + }, + + "train-station": { + "start-search-nearest": "Der nächste Bahnhof ist", + "no-stations-nearby": "Keine Bahnhöfe in der Nähe gefunden", + "no-point-selected": "Sie müssen zuerst einen Punkt auf der Karte auswählen" + }, + + "itinerary": { + "start": "Reiseroutemodus aktiviert", + "add-point-1": "Punkt", + "add-point-2": "ergänzt", + "add-point-error": "Fehler beim Hinzufügen des Punktes", + "delete-point": "Letzter gelöschter Punkt", + "delete-point-error": "Fehler beim löschen", + "stop": "Ende der Reiseroutemodus", + "save": "Reiseroute gespeichert unter", + "save-error": "Fehler beim speichern der Reiseroute", + "wrong-mode": "Der Reiseroutemodus ist nicht aktiviert" + } + }, + + "voice-commands": { + "change-lang": ["Sprechen", "sprechen Sie", "Sprache"], + "read-mode": ["Lesemodus", "Karte lesen", "lesen"], + "search": ["Suchen", "Suche", "finden", "die Adresse finden"], + "transportation-nearest": ["Haltestelle", "nächster Halt,", "nächste Haltestelle", "nächst gelegene Haltestelle", "Suche nach Haltestelle"], + "transportation-line": ["Liniensuche", "Liniehaltestelle", "suche Linienhaltestelle"], + "train-station": ["cherche la gare", "cherche gare", "recherche la gare", "recherche gare"], + "itinerary-start": ["Reiseroute", "Reiseroute starten", "Reiseroutestart"], + "itinerary-add-point": ["Hinzufügen", "hinzufügen von Punkten zur Reiseroute"], + "itinerary-delete-point": ["Löschen", "Punkt löschen", "zuletzt gelöschter Punkt", "letzten Punkt löschen"], + "itinerary-save": ["Speichern", " Reiseroute speichern", "speichern"], + "itinerary-stop": ["Anhalten", "die Reiseroute anhalten", "halt der Reiseroute"] + } + } +} \ No newline at end of file diff --git a/frontend/src/assets/i18n/en.json b/frontend/src/assets/i18n/en.json new file mode 100644 index 000000000..594d23402 --- /dev/null +++ b/frontend/src/assets/i18n/en.json @@ -0,0 +1,239 @@ +{ + "languages": { + "fr": "Français", + "en": "English", + "de": "Deutsch", + "it": "Italiano" + }, + + "editor-modals": { + "main-menu": { + "title": "Map editor", + "create-map": "Create a new map", + "open-existing-map": "Open (edit) an existing map", + "back": "Go back to the website", + "info": "The map editor is part of the ABAplans project." + }, + + "maps-menu": { + "title": "Existing plans", + "instructions": "Select a map to edit by clicking on the action button", + "filter-placeholder": "N°, title or creation date", + "loading": "Loading maps...", + "table": { + "id": "N°", + "title": "Title", + "date": "Creation date", + "action": "Action" + }, + "back": "Main menu" + }, + + "map-scale-error": { + "title": "Error", + "content": "It is not possible to create a map for an area that large! Please select a smaller area on the map." + }, + + "print-error": { + "title": "Error", + "content": "Before you can print this map, you need to save it with a title." + }, + + "touchpad-open-error": { + "title": "Error", + "content": "You need to save the map before you can open it with the touchpad" + }, + + "loading": { + "title": "Loading", + "content": "Please wait, this operation usually takes less than a minute..." + } + }, + + "top-bar": { + "navigation": "Navigate on the map until you see the area you wish to edit", + + "navigation-bar": { + "search-bar-placeholder": "Search address", + "search-button-hint": "Start search", + + "zoom-plus-hint": "Zoom in", + "zoom-minus-hint": "Zoom out", + + "arrow-left-hint": "Move to the left", + "arrow-right-hint": "Move to the right", + "arrow-up-hint": "Move up", + "arrow-down-hint": "Move down", + + "back-button-hint": "Go back to main menu", + "check-button-hint": "Edit the selected area on the map", + "help-button-hint": "Show help" + }, + + "navigation-help": { + "title": "Navigation - Help", + "content": { + "search": "To search for an address, use the search bar", + "navigation": "Use the zoom buttons to zoom in/out and the arrows to move on the map", + "precision": "Use the range bar to change the zoom and movement speed", + "back": "Press the back button to go back to the main menu", + "check": "Press the blue button to confirm the selected area and start editing it" + } + }, + + "edition": "Edit/draw on the map", + + "edition-bar": { + "layers": { + "basemap": "Map", + "topography": "Textures", + "drawings": "Drawings" + }, + + "topographicCategories": { + "roads": "Roads", + "city": "City" + }, + + "modify-hint": "Modify an existing drawing on the map", + "delete-hint": "Delete an existing drawing on the map", + + "circle-hint": "Draw a circle on the map", + "polygon-hint": "Draw a polygon on the map", + "guideline-hint": "Draw a guiding line on the map", + "pedestrian-hint": "Draw a pedestrian crossing on the map", + "marker-hint": "Put a point of interest on the map", + + "save-hint": "Save the map", + "print-hint": "Print the map", + "touchpad-hint": "Open the map with the touchpad", + + "leave-hint": "Go back to the main menu", + "help-hint": "Print help" + }, + + "texture-selection": { + "title": "Texture selection", + "content": { + "selection-button": "Select", + "cancel-button": "Cancel" + } + }, + + "edition-help": { + "title": "Edition - Help", + "content": { + "edit": "To edit a drawing, click on the edition button and then on the map where the drawing is", + "delete": "To delete a drawing, first click on the deletion button and then on the map where the drawing is", + "draw": "To draw on the map, click on one of the four drawing buttons (circle, polygon, guiding line and pedestrian passage), select a texture if you are asked to, and then click on the map to draw", + "circle": "To draw a circle, click on the map where tits center should be located, and then drag the mouse while holding the button down to define its size", + "polygon": "To draw a polygon, click on the map where its vertices should be located", + "guideline": "To draw a guiding line, click on the map to define the points through which it goes", + "pedestrian": "To draw a pedestrian passage, click on the map where it should start, and drag the mouse while holding the button down to the point where it should end", + "visible-layers": "The options 'Map', 'Textures', and 'Corrections' allow you to define if the map, topographic data and your drawings are visible on the map", + "surfaces-groups": "The 'Roads'/'City' option allows you to choose if the roads or the buildings and walkable areas are shown on the map", + "print": "Before you can print a map, you need to save it with a title" + } + }, + + "marker-edition": { + "set-text": "Text associated to the marker: ", + "text-error": "You need to enter some text for the marker" + }, + + "map-saving": { + "map-exists-confirm": "Overwriting an existing map is not possible. This operation will hence create a new one. Continue?", + "new-title": "Map title:", + "title-error": "Cannot save a map with an empty title!", + "success": "Map successfully saved", + "error": "An error occurred while saving the map" + }, + + "confirmMultipleGraphicsDeletion": "This operation will delete multiple superimposed drawings on the map. Continue?", + "confirmSingleGraphicDeletion": "This operation will delete a drawing on the map. Continue?" + }, + + "touchpad": { + "speech-recognition-alert": "Warning: speech recognition is unavailable in the browser you are using. We advise you to use Google Chrome to have access to it.", + + "voice-instructions": { + "calibration": { + "top-left": "A calibration is necessary. Please press the top-left corner of the map.", + "top-right": "Please press the top-right corner of the map.", + "bottom-left": "Please press the bottom-left corner of the map.", + "bottom-right": "Please press the bottom-right corner of the map.", + "complete": "Calibration complete." + }, + + "click-outside": "You pressed outside of the map.", + + "lang-ok": "Understood", + "lang-error": "The language required is unavailable", + + "read-mode": "Read mode activated", + "no-address": "No address was found near the point you pressed", + + "search": { + "start": "Searching address ", + "error": "Invalid search", + "outside": "The searched address is outside of the map.", + "loading": "Search loading", + "arrived": "You have arrived" + }, + + "directions": { + "search": "Search", + "at-distance": "at", + "up": "upwards", + "down": "downwards", + "left": "to the left", + "right": "to the right", + "up-left": "upwards to the left", + "up-right": "upwards to the right", + "down-left": "downwards to the left", + "down-right": "downwards to the right", + "meters": "meters", + "kilometers": "kilometers" + }, + + "transportation": { + "start-search-nearest": "The nearest station is", + "no-stations-nearby": "No public transportation station found nearby", + "no-point-selected": "You need to select a point on the map first" + }, + + "train-station": { + "start-search-nearest": "The nearest train station is", + "no-stations-nearby": "No train station was found nearby", + "no-point-selected": "You need to select a point on the map first" + }, + + "itinerary": { + "start": "Itinerary mode activated", + "add-point-1": "Point", + "add-point-2": "added", + "add-point-error": "Error while adding point", + "delete-point": "Last point deleted", + "delete-point-error": "Error while deleting the last point", + "stop": "Itinerary mode ended", + "save": "Itinerary saved as", + "save-error": "Error while saving the itinerary", + "wrong-mode": "Itinerary mode is not activated" + } + }, + + "voice-commands": { + "change-lang": ["speak", "start speaking", "language"], + "read-mode": ["reading mode", "map reading mode", "reading", "read mode", "read"], + "search": ["search", "search for", "find", "find the address"], + "transportation-nearest": ["station", "nearest station", "search nearest station"], + "transportation-line": ["search line", "station line", "search station line", "station for line"], + "train-station": ["search train station", "find train station", "search for train station", "find the train station"], + "itinerary-start": ["itinerary", "start itinerary", "itinerary start"], + "itinerary-add-point": ["add", "add point", "add point to itinerary"], + "itinerary-delete-point": ["delete", "delete point", "delete last", "erase point", "delete last point", "erase last point"], + "itinerary-save": ["save", "save itinerary", "saving", "saving itinerary", "save the itinerary"], + "itinerary-stop": ["stop", "stop itinerary", "stop the itinerary"] + } + } +} \ No newline at end of file diff --git a/frontend/src/assets/i18n/fr.json b/frontend/src/assets/i18n/fr.json new file mode 100644 index 000000000..c5ffad0cd --- /dev/null +++ b/frontend/src/assets/i18n/fr.json @@ -0,0 +1,239 @@ +{ + "languages": { + "fr": "Français", + "en": "English", + "de": "Deutsch", + "it": "Italiano" + }, + + "editor-modals": { + "main-menu": { + "title": "Éditeur de plans", + "create-map": "Créer un nouveau plan", + "open-existing-map": "Ouvrir (modifier) un plan existant", + "back": "Retour au site", + "info": "L'éditeur de plans fait partie du projet ABAplans." + }, + + "maps-menu": { + "title": "Plans existants", + "instructions": "Sélectionnez un plan à afficher en cliquant sur le bouton action", + "filter-placeholder": "N°, titre ou date de création", + "loading": "Chargement des plans...", + "table": { + "id": "N°", + "title": "Titre", + "date": "Date de création", + "action": "Action" + }, + "back": "Menu principal" + }, + + "map-scale-error": { + "title": "Erreur", + "content": "Impossible de créer un plan pour une zone aussi large ! Veuillez sélectionner une zone plus petite sur la carte." + }, + + "print-error": { + "title": "Erreur", + "content": "Avant de pouvoir imprimer le plan, veuillez sauvegarder ce dernier avec un titre." + }, + + "touchpad-open-error": { + "title": "Erreur", + "content": "Vous devez sauvegarder le plan avant de pouvoir l'ouvrir avec la dalle tactile" + }, + + "loading": { + "title": "Chargement en cours", + "content": "Veuillez patienter, cette opération prend généralement moins d'une minute..." + } + }, + + "top-bar": { + "navigation": "Naviguez sur la carte jusqu'à voir la zone du plan à éditer", + + "navigation-bar": { + "search-bar-placeholder": "Adresse à rechercher", + "search-button-hint": "Lancer la recherche", + + "zoom-plus-hint": "Zoomer vers l'avant", + "zoom-minus-hint": "Zoomer vers l'arrière", + + "arrow-left-hint": "Naviguer vers la gauche", + "arrow-right-hint": "Naviguer vers la droite", + "arrow-up-hint": "Naviguer vers le haut", + "arrow-down-hint": "Naviguer vers le bas", + + "back-button-hint": "Revenir au menu", + "check-button-hint": "Éditer le plan pour la zone sélectionnée", + "help-button-hint": "Afficher l'aide" + }, + + "navigation-help": { + "title": "Navigation - Aide", + "content": { + "search": "Pour rechercher une adresse, utilisez la barre de recherche", + "navigation": "Utilisez les loupes pour zoomer/dé-zoomer et les flèches pour vous déplacer sur la carte", + "precision": "La réglette permet de modifier la vitesse de zoom/déplacement sur la carte", + "back": "Le bouton de retour permet de revenir au menu principal", + "check": "Le bouton bleu permet de confirmer la zone sélectionnée sur la carte afin de la modifier" + } + }, + + "edition": "Modifiez/dessinez sur le plan", + + "edition-bar": { + "layers": { + "basemap": "Carte", + "topography": "Textures", + "drawings": "Dessins" + }, + + "topographicCategories": { + "roads": "Routes", + "city": "Ville" + }, + + "modify-hint": "Modifier un dessin sur la carte", + "delete-hint": "Supprimer un dessin sur la carte", + + "circle-hint": "Dessiner un cercle sur la carte", + "polygon-hint": "Dessiner un polygone sur la carte", + "guideline-hint": "Dessiner une ligne de guidage sur la carte", + "pedestrian-hint": "Dessiner un passage piéton sur la carte", + "marker-hint": "Placer un point d'intérêt sur la carte", + + "save-hint": "Enregistrer la carte", + "print-hint": "Imprimer la carte", + "touchpad-hint": "Ouvrir la carte dans le lecteur tactile", + + "leave-hint": "Retourner au menu principal", + "help-hint": "Afficher l'aide" + }, + + "edition-help": { + "title": "Édition - Aide", + "content": { + "edit": "Cliquez sur le bouton d'édition puis sur un dessin pour modifier ce dernier", + "delete": "Cliquez sur le bouton de suppression puis sur un dessin sur le plan pour supprimer ce dernier", + "draw": "Pour dessiner sur le plan, cliquez sur l'un des quatre boutons de dessin (cercle, polygone, ligne de guidage ou passage piétons), sélectionnez une texture si cela vous est demandé, puis dessinez sur le plan", + "circle": "Pour dessiner un cercle, cliquez sur le plan là où vous désirez placer son centre, puis déplacez la souris en maintenant le clic appuyé pour définir sa taille", + "polygon": "Pour dessiner un polygone, cliquez sur la carte pour définir les sommets de ce dernier", + "guideline": "Pour dessiner une ligne de guidage, cliquez sur la carte pour définir chaque point par lesquels cette dernière passe", + "pedestrian": "Pour dessiner un passage piétons, cliquez sur la carte là où doit commencer ce dernier, puis déplacez la souris en maintenant le bouton appuyé jusqu'à atteindre son point d'arrivée", + "visible-layers": "Les options 'Carte', 'Textures' et 'Corrections' permettent de définir si la carte, les données topographiques et vos dessins sont visible ou non sur le plan", + "surfaces-groups": "L'option 'Routes'/'Ville' permet de définir si les routes ou les bâtiments et zones piétonnes doivent être affichés", + "print": "Il est nécessaire de sauvegarder une carte avec un titre avant de pouvoir l'imprimer" + } + }, + + "texture-selection": { + "title": "Sélection de la texture", + "content": { + "selection-button": "Sélectionner", + "cancel-button": "Annuler" + } + }, + + "marker-edition": { + "set-text": "Texte associé au marqueur : ", + "text-error": "Vous devez entrer du texte pour le marqueur" + }, + + "map-saving": { + "map-exists-confirm": "Il n'est pas possible d'écraser un plan existant. Cette opération va donc en créer un nouveau. Continuer?", + "new-title": "Titre du plan:", + "title-error": "Impossible de sauvegarder un plan avec un titre vide!", + "success": "Plan sauvegardé avec succès", + "error": "Une erreur s'est produite lors de la sauvegarde du plan" + }, + + "confirmMultipleGraphicsDeletion": "Cette opération va supprimer plusieurs dessins superposés sur la carte. Continuer?", + "confirmSingleGraphicDeletion": "Cette opération va supprimer un dessin sur la carte. Continuer?" + }, + + "touchpad": { + "speech-recognition-alert": "Attention, la reconnaissance vocale est indisponible dans le navigateur utilisé. Il est conseillé d'utiliser Google Chrome pour avoir accès à cette fonctionalité.", + + "voice-instructions": { + "calibration": { + "top-left": "Une calibration est nécessaire. Veuillez presser le coin supérieur gauche de la carte.", + "top-right": "Pressez le coin supérieur droit de la carte.", + "bottom-left": "Pressez le coin inférieur gauche de la carte.", + "bottom-right": "Pressez le coin inférieur droit de la carte.", + "complete": "Calibration terminée." + }, + + "click-outside": "Vous avez appuyé en dehors de la carte.", + + "lang-ok": "Compris", + "lang-error": "La langue demandée est indisponible", + + "read-mode": "Mode lecture activé", + "no-address": "Aucune addresse trouvée près du point pressé", + + "search": { + "start": "Recherche de l'adresse ", + "error": "Recherche invalide", + "outside": "L'adresse recherchée se trouve en dehors de la carte.", + "loading": "Recherche en cours", + "arrived": "Vous êtes arrivé" + }, + + "directions": { + "search": "Cherchez vers", + "at-distance": "à", + "up": "le haut", + "down": "le bas", + "left": "la gauche", + "right": "la droite", + "up-left": "le haut à gauche", + "up-right": "le haut à droite", + "down-left": "le bas à gauche", + "down-right": "le bas à droite", + "meters": "mètres", + "kilometers": "kilomètres" + }, + + "transportation": { + "start-search-nearest": "L'arrêt de transports publics le plus proche est", + "no-stations-nearby": "Aucun arrêt de transport public trouvé à proximité", + "no-point-selected": "Vous devez d'abord choisir un point sur la carte" + }, + + "train-station": { + "start-search-nearest": "La gare la plus proche est", + "no-stations-nearby": "Aucune gare trouvée à proximité", + "no-point-selected": "Vous devez d'abord choisir un point sur la carte" + }, + + "itinerary": { + "start": "Mode itinéraire activé", + "add-point-1": "Point", + "add-point-2": "ajouté", + "add-point-error": "Erreur lors de l'ajout du point", + "delete-point": "Dernier point supprimé", + "delete-point-error": "Erreur lors de la suppression", + "stop": "Fin du mode itinéraire", + "save": "Itinéraire sauvegardé sous le nom", + "save-error": "Erreur lors de la sauvegarde de l'itinéraire", + "wrong-mode": "Le mode itinéraire n'est pas activé" + } + }, + + "voice-commands": { + "change-lang": ["parle", "parle moi en", "parler", "langue"], + "read-mode": ["mode lecture", "lecture de la carte", "lecture"], + "search": ["cherche", "recherche", "trouver", "trouver l'adresse"], + "transportation-nearest": ["arrêt transport", "arrêt de transport", "arrêt le plus proche", "arrêt de transport le plus proche", "cherche arrêt", "arrête transport", "arrête de transport"], + "transportation-line": ["cherche ligne", "arrêt ligne", "cherche arrêt ligne", "arrêt de transport ligne"], + "train-station": ["cherche la gare", "cherche gare", "recherche la gare", "recherche gare"], + "itinerary-start": ["itinéraire", "démarrer itinéraire", "démarre itinéraire"], + "itinerary-add-point": ["ajoute", "ajoute.", "ajouter", "ajouter."], + "itinerary-delete-point": ["supprimer", "supprimer point", "supprime", "supprime point", "supprimer dernier point", "supprime dernier point"], + "itinerary-save": ["sauvegarde", "sauvegarder", "enregistre", "enregistrer", "enregistre itinéraire", "enregistrer itinéraire"], + "itinerary-stop": ["arrêter itinératire", "arrête l'itinéraire", "arrête itinéraire"] + } + } +} \ No newline at end of file -- GitLab