Skip to content

Commit

Permalink
camel case translations
Browse files Browse the repository at this point in the history
  • Loading branch information
joakbjerk committed Nov 12, 2024
1 parent 8bea594 commit 4bb0b4a
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ function DatePicker(externalProps: DatePickerAllProps) {
props,
defaultProps,
{ skeleton: context?.skeleton },
context.getTranslation(props).DatePicker,
convertSnakeCaseProps(context.getTranslation(props).DatePicker),
pickFormElementProps(context?.FormRow), // Deprecated – can be removed in v11
pickFormElementProps(context?.formElement),
context.DatePicker
Expand Down
32 changes: 16 additions & 16 deletions packages/dnb-eufemia/src/shared/locales/en-GB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ export default {
year: 'Year',
start: 'from',
end: 'to',
selected_date: 'Selected date: %s',
selected_month: 'Selected month %s',
selected_year: 'Selected year %s',
next_month: 'Next month %s',
prev_month: 'Previous month %s',
next_year: 'Next year %s',
prev_year: 'Previous year %s',
open_picker_text: 'Open date picker',
mask_order: 'dd/mm/yyyy',
mask_placeholder: 'dd/mm/yyyy', // have to be same setup as "mask" - but can be like: dd/mm/åååå
date_format: 'yyyy-MM-dd', // in v1 of date-fns we were more flexible in terms of the format
return_format: 'yyyy-MM-dd', // used in date-fns v1: YYYY-MM-DD
submit_button_text: 'OK',
cancel_button_text: 'Cancel',
reset_button_text: 'Reset',
placeholder_characters: {
selectedDate: 'Selected date: %s',
selectedMonth: 'Selected month %s',
selectedYear: 'Selected year %s',
nextMonth: 'Next month %s',
prevMonth: 'Previous month %s',
nextYear: 'Next year %s',
prevYear: 'Previous year %s',
openPickerText: 'Open date picker',
maskOrder: 'dd/mm/yyyy',
maskPlaceholder: 'dd/mm/yyyy', // have to be same setup as "mask" - but can be like: dd/mm/åååå
dateFormat: 'yyyy-MM-dd', // in v1 of date-fns we were more flexible in terms of the format
returnFormat: 'yyyy-MM-dd', // used in date-fns v1: YYYY-MM-DD
submitButtonText: 'OK',
cancelButtonText: 'Cancel',
resetButtonText: 'Reset',
placeholderCharacters: {
day: 'd',
month: 'm',
year: 'y',
Expand Down
8 changes: 4 additions & 4 deletions packages/dnb-eufemia/src/shared/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export default {
...enGB,
DatePicker: {
...enGB.DatePicker,
mask_order: 'mm/dd/yyyy',
mask_placeholder: 'mm/dd/yyyy', // have to be same setup as "mask" - but can be like: mm/dd/åååå
first_day: 'sunday',
maskOrder: 'mm/dd/yyyy',
maskPlaceholder: 'mm/dd/yyyy', // have to be same setup as "mask" - but can be like: mm/dd/åååå
firstDay: 'sunday',
},
} satisfies typeof enGB & {
DatePicker: {
first_day: string
firstDay: string
}
},
}
7 changes: 6 additions & 1 deletion packages/dnb-eufemia/src/shared/locales/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
// import default locales
import nbNO from './nb-NO'
import enGB from './en-GB'
import enUS from './en-US'

const locales = { ...nbNO, ...enGB }
const locales = { ...nbNO, ...enGB, ...enUS }

export type TranslationsNbNO = (typeof locales)['nb-NO']
export type TranslationsEnGB = (typeof locales)['en-GB']
export type TranslationsEnUS = (typeof locales)['en-US']

export default locales
32 changes: 16 additions & 16 deletions packages/dnb-eufemia/src/shared/locales/nb-NO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ export default {
year: 'år',
start: 'fra',
end: 'til',
selected_date: 'Valgt dato: %s',
selected_month: 'Valgt måned %s',
selected_year: 'Valgt år %s',
next_month: 'Neste måned %s',
prev_month: 'Forrige måned %s',
next_year: 'Neste år %s',
prev_year: 'Forrige år %s',
open_picker_text: 'åpne datovelger',
mask_order: 'dd/mm/yyyy',
mask_placeholder: 'dd.mm.åååå', // have to be same setup as "mask" - but can be like: dd/mm/åååå
date_format: 'yyyy-MM-dd', // in v1 of date-fns we were more flexible in terms of the format
return_format: 'yyyy-MM-dd', // used in date-fns v1: YYYY-MM-DD
submit_button_text: 'Ok',
cancel_button_text: 'Avbryt',
reset_button_text: 'Tilbakestill',
placeholder_characters: {
selectedDate: 'Valgt dato: %s',
selectedMonth: 'Valgt måned %s',
selectedYear: 'Valgt år %s',
nextMonth: 'Neste måned %s',
prevMonth: 'Forrige måned %s',
nextYear: 'Neste år %s',
prevYear: 'Forrige år %s',
openPickerText: 'åpne datovelger',
maskOrder: 'dd/mm/yyyy',
maskPlaceholder: 'dd.mm.åååå', // have to be same setup as "mask" - but can be like: dd/mm/åååå
dateFormat: 'yyyy-MM-dd', // in v1 of date-fns we were more flexible in terms of the format
returnFormat: 'yyyy-MM-dd', // used in date-fns v1: YYYY-MM-DD
submitButtonText: 'Ok',
cancelButtonText: 'Avbryt',
resetButtonText: 'Tilbakestill',
placeholderCharacters: {
day: 'd',
month: 'm',
year: 'å',
Expand Down

0 comments on commit 4bb0b4a

Please sign in to comment.