zammad/app/frontend/shared/components/ObjectAttributes/utils.ts

15 lines
396 B
TypeScript

// Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
import type { ObjectManagerFrontendAttribute } from '@shared/graphql/types'
import { i18n } from '@shared/i18n'
export const translateOption = (
attribute: ObjectManagerFrontendAttribute,
str?: string,
) => {
if (!str) return ''
if (attribute.dataOption.translate) {
return i18n.t(str)
}
return str
}