@stemy/ngx-utils 19.7.25 → 19.7.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,8 +55,9 @@ export interface ITranslation {
55
55
  translation: string;
56
56
  }
57
57
  export interface ITranslations {
58
- [key: string]: any;
58
+ [key: string]: string;
59
59
  }
60
+ export type GlobalTranslations = Record<string, ITranslations>;
60
61
  export interface ILanguageSetting {
61
62
  unavailable?: string;
62
63
  [key: string]: string | boolean | number;
@@ -4,7 +4,7 @@ import * as i0 from "@angular/core";
4
4
  export declare class TranslatePipe implements PipeTransform {
5
5
  readonly cdr: ChangeDetectorRef;
6
6
  readonly language: ILanguageService;
7
- private lang;
7
+ private dictionary;
8
8
  private enabled;
9
9
  private query;
10
10
  private args;
@@ -4,6 +4,7 @@ export declare class EventsService {
4
4
  readonly eventForwarded: Subject<Event>;
5
5
  readonly stickyUpdated: Subject<boolean>;
6
6
  readonly languageChanged: Subject<string>;
7
+ readonly editLanguageChanged: Subject<string>;
7
8
  readonly translationsEnabled: Subject<boolean>;
8
9
  readonly userChanged: Subject<any>;
9
10
  private sticky;
@@ -3,7 +3,7 @@ import { ILanguageSetting, ILanguageSettings, ITranslations } from "../common-ty
3
3
  import { StaticLanguageService } from "./static-language.service";
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class LanguageService extends StaticLanguageService {
6
- protected translationRequests: ITranslations;
6
+ protected translationRequests: Record<string, Promise<ITranslations>>;
7
7
  protected settingsPromise: Promise<ILanguageSettings>;
8
8
  protected languageSettings: BehaviorSubject<ILanguageSettings>;
9
9
  get currentLanguage(): string;
@@ -13,6 +13,7 @@ export declare class LanguageService extends StaticLanguageService {
13
13
  protected initService(): void;
14
14
  initFromSettings(): Promise<any>;
15
15
  protected useLanguage(lang: string): Promise<ITranslations>;
16
+ getDictionary(lang: string): Promise<ITranslations>;
16
17
  protected loadDictionary(): Promise<ITranslations>;
17
18
  protected loadSettings(): Promise<ILanguageSettings>;
18
19
  static ɵfac: i0.ɵɵFactoryDeclaration<LanguageService, never>;
@@ -1,4 +1,4 @@
1
- import { IConfigService, IConfiguration, ILanguageService, IPromiseService, ITranslation, ITranslations } from "../common-types";
1
+ import { GlobalTranslations, IConfigService, IConfiguration, ILanguageService, IPromiseService, ITranslation, ITranslations } from "../common-types";
2
2
  import { EventsService } from "./events.service";
3
3
  import { StorageService } from "./storage.service";
4
4
  import { UniversalService } from "./universal.service";
@@ -30,11 +30,14 @@ export declare class StaticLanguageService implements ILanguageService {
30
30
  protected currentLang: string;
31
31
  protected enableTrans: boolean;
32
32
  protected languageList: string[];
33
- protected readonly translations: ITranslations;
33
+ protected readonly translations: GlobalTranslations;
34
+ protected overrideTranslations: GlobalTranslations;
35
+ protected mergedTranslations: GlobalTranslations;
34
36
  constructor(events: EventsService, storage: StorageService, configs: IConfigService, promises: IPromiseService, client: BaseHttpClient);
35
37
  protected initService(): void;
36
38
  replaceLanguages(languages: string[]): void;
37
39
  addLanguages(languages: string[]): void;
40
+ setOverrideTranslations(translations: GlobalTranslations): void;
38
41
  getTranslationSync(key: string, params?: Object): string;
39
42
  getTranslation(key: string, params?: any): Promise<string>;
40
43
  getTranslations(...keys: string[]): Promise<ITranslations>;
@@ -45,6 +48,7 @@ export declare class StaticLanguageService implements ILanguageService {
45
48
  protected interpolate(expr: string | Function, params?: Object): string;
46
49
  protected interpolateString(expr: string, params?: Object): string;
47
50
  protected getDefaultLanguage(): string;
51
+ protected mergeTranslations(): void;
48
52
  static ɵfac: i0.ɵɵFactoryDeclaration<StaticLanguageService, never>;
49
53
  static ɵprov: i0.ɵɵInjectableDeclaration<StaticLanguageService>;
50
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stemy/ngx-utils",
3
- "version": "19.7.25",
3
+ "version": "19.7.27",
4
4
  "license": "MIT",
5
5
  "public": true,
6
6
  "repository": "https://github.com/stemyke/ngx-utils.git",
package/public_api.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import "zone.js";
2
2
  export { MaybePromise, MaybeArray, KeysOfType, ObjOfType, StringKeys, CapitalizeFirst, CamelJoin, PrefixedPick } from "./ngx-utils/helper-types";
3
- export { DurationUnit, TypedFactoryProvider, TypedValueProvider, TypedExistingProvider, TypedClassProvider, TypedTokenProvider, TypedProvider, CachedFactory, ResolveFactory, IResolveFactory, CanvasColor, IIconService, ITranslation, ITranslations, ILanguageSetting, ILanguageSettings, ILanguageService, IUserData, IAuthService, RouteValidator, IRouteData, IRoute, IAclComponent, IDialogButtonConfig, IDialogConfig, IConfirmMessageConfig, IConfirmDialogConfig, IDialogService, IPromiseService, IRouteStateInfo, NavigationUrlParam, StorageMode, ToastType, IToasterService, IAsyncMessage, AsyncMethod, IconMap, IconProps, ButtonType, ButtonSize, ButtonProps, TabValue, TabOption, ChipValue, ChipStatus, ChipOption, DropdownAttachTo, UnorderedListTemplate, UnorderedListTemplates, UnorderedListStyle, UploadType, IFileUploadResult, IFileUploadProcess, IAjaxRequestDetails, AjaxRequestCallback, ScriptType, ILoadableElement, ILoaderPromises, ISearchObservable, FactoryDependencies, ObjectType, ITimer, IExtraProperties, IGroupMap, TranslationQuery, IPageInfo, IPaginationData, PaginationDataLoader, PaginationItemContext, IPoint, ShapeIntersection, ShapeDistance, IShape, CanvasResizeMode, CanvasItemDirection, CanvasPaintFunc, RangeCoords, RectCoords, Frame, InteractiveCanvasParams, InteractiveCanvasItem, InteractiveCanvasItems, InteractiveCanvas, InteractiveCanvasRenderer, InteractivePanEvent, InteractiveCanvasPointer, HttpRequestHeaders, HttpRequestQuery, HttpClientRequestOptions, HttpRequestOptions, UploadData, IIssueContext, IProgress, ProgressListener, CacheExpireMode, IHttpService, SvgSourceModifier, IBaseHttpClient, IApiService, DynamicSchemaRef, OpenApiSchemaProperty, OpenApiSchema, OpenApiSchemas, TableFilterType, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataItems, TableDataLoader, DragDropEvent, DragEventHandler, ITableDragEvent, DynamicTableDragHandler, ResourceIfContext, CssSelector, CssSelectorList, DynamicComponentLocation, DynamicModuleInfo, DynamicEntryComponents, IConfiguration, IConfigService, ResizeEventStrategy, ErrorHandlerCallback, GlobalComponentModifier, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
3
+ export { DurationUnit, TypedFactoryProvider, TypedValueProvider, TypedExistingProvider, TypedClassProvider, TypedTokenProvider, TypedProvider, CachedFactory, ResolveFactory, IResolveFactory, CanvasColor, IIconService, ITranslation, ITranslations, GlobalTranslations, ILanguageSetting, ILanguageSettings, ILanguageService, IUserData, IAuthService, RouteValidator, IRouteData, IRoute, IAclComponent, IDialogButtonConfig, IDialogConfig, IConfirmMessageConfig, IConfirmDialogConfig, IDialogService, IPromiseService, IRouteStateInfo, NavigationUrlParam, StorageMode, ToastType, IToasterService, IAsyncMessage, AsyncMethod, IconMap, IconProps, ButtonType, ButtonSize, ButtonProps, TabValue, TabOption, ChipValue, ChipStatus, ChipOption, DropdownAttachTo, UnorderedListTemplate, UnorderedListTemplates, UnorderedListStyle, UploadType, IFileUploadResult, IFileUploadProcess, IAjaxRequestDetails, AjaxRequestCallback, ScriptType, ILoadableElement, ILoaderPromises, ISearchObservable, FactoryDependencies, ObjectType, ITimer, IExtraProperties, IGroupMap, TranslationQuery, IPageInfo, IPaginationData, PaginationDataLoader, PaginationItemContext, IPoint, ShapeIntersection, ShapeDistance, IShape, CanvasResizeMode, CanvasItemDirection, CanvasPaintFunc, RangeCoords, RectCoords, Frame, InteractiveCanvasParams, InteractiveCanvasItem, InteractiveCanvasItems, InteractiveCanvas, InteractiveCanvasRenderer, InteractivePanEvent, InteractiveCanvasPointer, HttpRequestHeaders, HttpRequestQuery, HttpClientRequestOptions, HttpRequestOptions, UploadData, IIssueContext, IProgress, ProgressListener, CacheExpireMode, IHttpService, SvgSourceModifier, IBaseHttpClient, IApiService, DynamicSchemaRef, OpenApiSchemaProperty, OpenApiSchema, OpenApiSchemas, TableFilterType, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataItems, TableDataLoader, DragDropEvent, DragEventHandler, ITableDragEvent, DynamicTableDragHandler, ResourceIfContext, CssSelector, CssSelectorList, DynamicComponentLocation, DynamicModuleInfo, DynamicEntryComponents, IConfiguration, IConfigService, ResizeEventStrategy, ErrorHandlerCallback, GlobalComponentModifier, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
4
4
  export { ICON_TYPE, ICON_MAP, BUTTON_TYPE, ERROR_HANDLER, STATIC_SCHEMAS, RESIZE_STRATEGY, RESIZE_DELAY, ROOT_ELEMENT, SCRIPT_PARAMS, BASE_CONFIG, CONFIG_SERVICE, APP_BASE_URL, API_SERVICE, EXPRESS_REQUEST, PROMISE_SERVICE, DIALOG_SERVICE, TOASTER_SERVICE, AUTH_SERVICE, LANGUAGE_SERVICE, ICON_SERVICE, OPTIONS_TOKEN } from "./ngx-utils/tokens";
5
5
  export { AjaxRequestHandler } from "./ngx-utils/utils/ajax-request-handler";
6
6
  export { ArrayUtils } from "./ngx-utils/utils/array.utils";