Skip to content

Commit

Permalink
feat(Forms): seperate translations for Boolean and Toggle (#3819)
Browse files Browse the repository at this point in the history
  • Loading branch information
langz authored Aug 19, 2024
1 parent d836c18 commit fa0827b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ import { ToggleProperties } from '@dnb/eufemia/src/extensions/forms/Field/Toggle

## Translations

<TranslationsTable localeKey={['BooleanField', 'Field']} />
<TranslationsTable localeKey={['ToggleField', 'Field']} />
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type ToggleProps = {
export type Props = FieldHelpProps & FieldProps<unknown> & ToggleProps

function Toggle(props: Props) {
const translations = useTranslation().BooleanField
const translations = useTranslation().ToggleField

const preparedProps: Props = {
...props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ export default {
yes: 'Yes',
no: 'No',
},
ToggleField: {
yes: 'Yes',
no: 'No',
},

/**
* Feature fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ export default {
yes: 'Ja',
no: 'Nei',
},
ToggleField: {
yes: 'Ja',
no: 'Nei',
},

/**
* Feature fields
Expand Down

0 comments on commit fa0827b

Please sign in to comment.