Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function App() {
const pastDate = new Date(new Date().setDate(new Date().getDate() - 5))
const futureDate = new Date(new Date().setDate(new Date().getDate() + 5))

const locale = 'en'
const locale = 'en-gb'
return (
<>
<ScrollView
Expand Down
4 changes: 4 additions & 0 deletions example/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import {
en,
nl,
pl,
enGB,
registerTranslation,
// @ts-ignore TODO: try to fix expo to work with local library
} from 'react-native-paper-dates'
registerTranslation('en', en)
registerTranslation('nl', nl)
registerTranslation('pl', pl)
registerTranslation('en-GB', enGB)

import App from './App'
export default App
2 changes: 2 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ export type { TranslationsType } from './translations/utils'
export { registerTranslation, getTranslation } from './translations/utils'
export { default as nl } from './translations/nl'
export { default as en } from './translations/en'
export { default as pl } from './translations/pl'
export { default as enGB } from './translations/enGB'
15 changes: 15 additions & 0 deletions src/translations/enGB.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { TranslationsType } from './utils'

const enGB: TranslationsType = {
save: 'Save',
selectSingle: 'Select date',
selectMultiple: 'Select dates',
selectRange: 'Select period',
notAccordingToDateFormat: (inputFormat: string) =>
`Date format must be ${inputFormat}`,
mustBeHigherThan: 'Must be later then',
mustBeLowerThan: 'Must be earlier then',
mustBeBetween: 'Must be between',
dateIsDisabled: 'Day is not allowed',
}
export default enGB
15 changes: 15 additions & 0 deletions src/translations/pl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { TranslationsType } from './utils'

const pl: TranslationsType = {
save: 'Zapisz',
selectSingle: 'Wybierz datę',
selectMultiple: 'Wybierz daty',
selectRange: 'Wybierz zakres',
notAccordingToDateFormat: (inputFormat: string) =>
`Data musi mieć format ${inputFormat}`,
mustBeHigherThan: 'Nie wcześniej niż',
mustBeLowerThan: 'Nie później niż',
mustBeBetween: 'Pomiędzy',
dateIsDisabled: 'Niedozwolona data',
}
export default pl