Skip to content

Commit 5c3a730

Browse files
Merge pull request #113 from maciek2000/master
feat: Polish and EnglishGB localisation
2 parents f1323bd + a47ca32 commit 5c3a730

File tree

5 files changed

+37
-1
lines changed

5 files changed

+37
-1
lines changed

example/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function App() {
123123
const pastDate = new Date(new Date().setDate(new Date().getDate() - 5))
124124
const futureDate = new Date(new Date().setDate(new Date().getDate() + 5))
125125

126-
const locale = 'en'
126+
const locale = 'en-gb'
127127
return (
128128
<>
129129
<ScrollView

example/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import {
22
en,
33
nl,
4+
pl,
5+
enGB,
46
registerTranslation,
57
// @ts-ignore TODO: try to fix expo to work with local library
68
} from 'react-native-paper-dates'
79
registerTranslation('en', en)
810
registerTranslation('nl', nl)
11+
registerTranslation('pl', pl)
12+
registerTranslation('en-GB', enGB)
913

1014
import App from './App'
1115
export default App

src/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ export type { TranslationsType } from './translations/utils'
99
export { registerTranslation, getTranslation } from './translations/utils'
1010
export { default as nl } from './translations/nl'
1111
export { default as en } from './translations/en'
12+
export { default as pl } from './translations/pl'
13+
export { default as enGB } from './translations/enGB'

src/translations/enGB.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { TranslationsType } from './utils'
2+
3+
const enGB: TranslationsType = {
4+
save: 'Save',
5+
selectSingle: 'Select date',
6+
selectMultiple: 'Select dates',
7+
selectRange: 'Select period',
8+
notAccordingToDateFormat: (inputFormat: string) =>
9+
`Date format must be ${inputFormat}`,
10+
mustBeHigherThan: 'Must be later then',
11+
mustBeLowerThan: 'Must be earlier then',
12+
mustBeBetween: 'Must be between',
13+
dateIsDisabled: 'Day is not allowed',
14+
}
15+
export default enGB

src/translations/pl.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { TranslationsType } from './utils'
2+
3+
const pl: TranslationsType = {
4+
save: 'Zapisz',
5+
selectSingle: 'Wybierz datę',
6+
selectMultiple: 'Wybierz daty',
7+
selectRange: 'Wybierz zakres',
8+
notAccordingToDateFormat: (inputFormat: string) =>
9+
`Data musi mieć format ${inputFormat}`,
10+
mustBeHigherThan: 'Nie wcześniej niż',
11+
mustBeLowerThan: 'Nie później niż',
12+
mustBeBetween: 'Pomiędzy',
13+
dateIsDisabled: 'Niedozwolona data',
14+
}
15+
export default pl

0 commit comments

Comments
 (0)