Client - application translation (wip)

This commit is contained in:
Sam
2019-09-16 10:26:02 +02:00
parent 745d102ee2
commit 77bc32d4a5
33 changed files with 651 additions and 374 deletions

View File

@ -86,3 +86,17 @@ export const formatRecord = (record, tz) => {
value: value,
}
}
const sortSports = (a, b) => {
const sportALabel = a.label.toLowerCase()
const sportBLabel = b.label.toLowerCase()
return sportALabel > sportBLabel ? 1 : sportALabel < sportBLabel ? -1 : 0
}
export const translateSports = (sports, t) =>
sports
.map(sport => ({
...sport,
label: t(`sports:${sport.label}`),
}))
.sort(sortSports)