Options
All
  • Public
  • Public/Protected
  • All
Menu

TranslationsSystem manages messages across core, systems and modules.

collboard-system

Hierarchy

  • AbstractSystem
    • TranslationsSystem

Implements

  • ITranslateMessagePicker

Index

Constructors

  • Parameters

    • systems: ISystemsExtended

    Returns TranslationsSystem

Properties

Translate: (props: PropsWithChildren<{ html?: boolean; isNonBreakSpaced?: true; name: string; parameters?: any }>) => Element

Type declaration

    • (props: PropsWithChildren<{ html?: boolean; isNonBreakSpaced?: true; name: string; parameters?: any }>): Element
    • Parameters

      • props: PropsWithChildren<{ html?: boolean; isNonBreakSpaced?: true; name: string; parameters?: any }>

      Returns Element

TranslateComponent: any
WithTranslateContext: (__namedParameters: { children?: ReactNode }) => Element

Type declaration

    • (__namedParameters: { children?: ReactNode }): Element
    • Creates context for providing translator

      Parameters

      • __namedParameters: { children?: ReactNode }
        • Optional children?: ReactNode

      Returns Element

_WithTranslateContext: any
_language: any
missingTranslateMessages: Observable<ITranslateMessage>
missingTranslateMessagesObserver?: any
missingTranslation: any
ready: Promise<void>
readyResolve: any
replacer: IReplacer
systems: ISystemsExtended
translateMessagesRecord: any

Accessors

  • get isDestroyed(): boolean
  • Is this object destroyed?

    Returns boolean

  • get isReady(): boolean
  • Checks if the system is initialized and ready to use.

    Returns boolean

  • get language(): string_translate_language
  • set language(language: string_translate_language): void
  • Returns string_translate_language

  • Parameters

    • language: string_translate_language

    Returns void

  • get preferedLanguages(): any
  • Returns any

  • get secondaryLanguage(): any
  • Returns any

  • get translateMessages(): ITranslateMessage[]
  • Returns ITranslateMessage[]

Methods

  • Binds new registration with itself. This registration/destroyable will be destroyed with this.

    Parameters

    • Rest ...subdestroyable: ITeardownLogic[]

    Returns TranslationsSystem

  • checkIsReady(): void
  • Checks if the system is initialized and ready to use. If not, throws an error. If it is, do nothing.

    Returns void

  • checkWhetherNotDestroyed(errorMessage?: string, runBeforeError?: () => void): void
  • Checks, whether the object is not destroyed

    Parameters

    • Optional errorMessage: string

      Message that will replace default one before error

    • Optional runBeforeError: () => void

      Callback runed before error is thrown; typically this can be some logging

        • (): void
        • Returns void

    Returns void

  • destroy(): Promise<void>
  • Returns Promise<void>

  • init(): Promise<void>
  • Returns Promise<void>

  • Parameters

    Returns Element

  • pickStringMessage(message: IMessage): string
  • Parameters

    Returns string

  • pushMessages(...translateMessages: ITranslateMessage[]): void
  • Parameters

    • Rest ...translateMessages: ITranslateMessage[]

    Returns void

  • showDateAndTime(date: string | Date): string
  • Parameters

    • date: string | Date

    Returns string

  • translate(nameNN: string, note?: string, parameters?: {}): string
  • Translate message

    Note: Prefer to use component <Translate... because component can be updated during a livetime of the page

    Parameters

    • nameNN: string
    • Optional note: string
    • Optional parameters: {}
      • [key: string]: string

    Returns string

  • useTemplate(html: string): string
  • Parameters

    • html: string

    Returns string

  • isDestroyable(obj: any): obj is IDestroyable
  • Chcek whether the given object is destroyable

    Parameters

    • obj: any

    Returns obj is IDestroyable