mirror of
https://github.com/zammad/zammad
synced 2026-05-24 09:48:36 +00:00
15 lines
396 B
TypeScript
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
|
|
}
|