scolladon/sfdx-git-delta

View on GitHub
src/utils/MessageService.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Messages } from '@salesforce/core'

export class MessageService {
  private static instance: Messages<string>

  constructor() {
    if (!MessageService.instance) {
      Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
      MessageService.instance = Messages.loadMessages('sfdx-git-delta', 'delta')
    }
  }

  getMessage(key: string, tokens?: string[]): string {
    return MessageService.instance.getMessage(key, tokens)
  }

  getMessages(key: string, tokens?: string[]): string[] {
    return MessageService.instance.getMessages(key, tokens)
  }
}