show i18n table capability

This commit is contained in:
Winzlieb - 2022-03-09 22:51:30 +01:00
parent 31dcf44d75
commit c216030c8a
3 changed files with 60 additions and 1 deletions

View File

@ -13,6 +13,9 @@ import {TypeColumn, TypeFilterValue, TypeSingleFilterValue} from "@inovua/reactd
import NumberFilter from "@inovua/reactdatagrid-community/NumberFilter";
import moment from "moment";
import {useTranslation} from "react-i18next";
import { resources } from '../../i18n/config';
global.moment = moment
type HostOfferLookupTableProps = {
@ -171,6 +174,12 @@ const defaultFilterValue: TypeFilterValue = columns
const HostOfferLookupTable = ({ data }: HostOfferLookupTableProps) => {
const dataSource = data.get_offers || []
const { i18n: { language } } = useTranslation()
// @ts-ignore
const reactdatagridi18n = resources[language]?.translation?.reactdatagrid
return <>
<DataGrid
idProperty="id"
@ -184,6 +193,7 @@ const HostOfferLookupTable = ({ data }: HostOfferLookupTableProps) => {
columns={columns}
dataSource={dataSource}
style={{minHeight: '1000px'}}
i18n={ reactdatagridi18n|| undefined}
/>
</>
}

View File

@ -7,7 +7,7 @@ import de from './de.json'
export const resources = {
en: { translation: en },
de: { translation: de }
} as const
}
i18next
.use(initReactI18next)

View File

@ -1,2 +1,51 @@
{
"reactdatagrid": {
"pageText": "Seite ",
"ofText": " von ",
"perPageText": "Ergebnisse pro Seite",
"showingText": "Zeige ",
"clearAll": "Alle leeren",
"clear": "leeren",
"showFilteringRow": "Zeige Filterreihe",
"hideFilteringRow": "Verstecke Filterreihe",
"enable": "ein",
"disable": "aus",
"sortAsc": "Sortiere aufsteigend",
"sortDesc": "Sortiere absteigend",
"unsort": "Sortierung aufheben",
"group": "Gruppieren",
"ungroup": "Degruppieren",
"lockStart": "Start sperren",
"lockEnd": "Ende sperren",
"unlock": "Entsperren",
"columns": "Spalten",
"contains": "Enthält",
"startsWith": "Beginnt mit",
"endsWith": "Ended mit",
"notContains": "Enthält nicht ",
"inlist": "In Liste enthalten",
"notinlist": "Nicht in Liste enthalten",
"neq": "Unglech",
"inrange": "Innerhalb Bereich",
"notinrange": "Außerhalb Bereich",
"eq": "Gleich",
"notEmpty": "Nicht Leer",
"empty": "Leer",
"lt": "Kleiner als",
"lte": "Kleiner/gleich",
"gt": "Größer als",
"gte": "Größer/gleich",
"before": "Bevor",
"beforeOrOn": "Bevor oder am",
"afterOrOn": "Nach oder am",
"after": "Nach`",
"start": "Beginn",
"end": "Ende",
"dragHeaderToGroup": "Ziehe Tabellenkopf um zu gruppieren",
"noRecords": "Keine Einträge vorhanden",
"calendar.todayButtonText": "Heute",
"calendar.clearButtonText": "Leeren",
"calendar.okButtonText": "OK",
"calendar.cancelButtonText": "abbrechen"
}
}