utils.ts 391 B

123456789101112
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import type { ObjectAttribute } from '#shared/entities/object-attributes/types/store.ts'
  3. import { i18n } from '#shared/i18n.ts'
  4. export const translateOption = (attribute: ObjectAttribute, str?: string) => {
  5. if (!str) return ''
  6. if (attribute.dataOption?.translate) {
  7. return i18n.t(str)
  8. }
  9. return str
  10. }