Skip to content

Commit 18784d9

Browse files
Merge pull request #253 from IlanKro/translation/hebrew
Adding hebrew translation
2 parents 88e4f64 + 1a024f3 commit 18784d9

File tree

3 files changed

+50
-33
lines changed

3 files changed

+50
-33
lines changed

docusaurus/docs/intro.md

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,10 @@ npm install react-native-paper-dates --save
3636

3737
### Supported
3838

39-
React-Native-Paper-Dates currently supports `en/nl/de/pl/pt/ar/ko/fr/tr/enGB` translations. Ideally you would do this somewhere before react-native-paper-dates is used. For example, you might add the follow to your `index.js` or `app.js`.
39+
React-Native-Paper-Dates currently supports `en/nl/de/pl/pt/ar/ko/fr/he/tr/enGB` translations. Ideally you would do this somewhere before react-native-paper-dates is used. For example, you might add the follow to your `index.js` or `app.js`.
4040

4141
```javascript
42-
import {
43-
enGB,
44-
registerTranslation,
45-
} from 'react-native-paper-dates'
42+
import { enGB, registerTranslation } from 'react-native-paper-dates'
4643
registerTranslation('en-GB', enGB)
4744
```
4845

@@ -51,10 +48,8 @@ registerTranslation('en-GB', enGB)
5148
React-Native-Paper-Dates also provides the ability to register your own translation. Ideally you would do this somewhere before react-native-paper-dates is used. For example, you might add the follow to your `index.js` or `app.js`.
5249

5350
```javascript
54-
import {
55-
registerTranslation,
56-
} from 'react-native-paper-dates'
57-
registerTranslation("pl", {
51+
import { registerTranslation } from 'react-native-paper-dates'
52+
registerTranslation('pl', {
5853
save: 'Save',
5954
selectSingle: 'Select date',
6055
selectMultiple: 'Select dates',
@@ -119,41 +114,41 @@ Don't forget to import the languages you want to support, in the example only en
119114

120115
```javascript
121116
// on top of your index.android.js file
122-
const isAndroid = require('react-native').Platform.OS === 'android'; // this line is only needed if you don't use an .android.js file
123-
const isHermesEnabled = !!global.HermesInternal; // this line is only needed if you don't use an .android.js file
117+
const isAndroid = require('react-native').Platform.OS === 'android' // this line is only needed if you don't use an .android.js file
118+
const isHermesEnabled = !!global.HermesInternal // this line is only needed if you don't use an .android.js file
124119

125120
// in your index.js file
126-
if (isHermesEnabled || isAndroid) { // this line is only needed if you don't use an .android.js file
121+
if (isHermesEnabled || isAndroid) {
122+
// this line is only needed if you don't use an .android.js file
127123

128-
require('@formatjs/intl-getcanonicallocales/polyfill');
129-
require('@formatjs/intl-locale/polyfill');
124+
require('@formatjs/intl-getcanonicallocales/polyfill')
125+
require('@formatjs/intl-locale/polyfill')
130126

131-
require('@formatjs/intl-pluralrules/polyfill');
132-
require('@formatjs/intl-pluralrules/locale-data/en.js'); // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
127+
require('@formatjs/intl-pluralrules/polyfill')
128+
require('@formatjs/intl-pluralrules/locale-data/en.js') // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
133129

134-
require('@formatjs/intl-displaynames/polyfill');
135-
require('@formatjs/intl-displaynames/locale-data/en.js'); // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
130+
require('@formatjs/intl-displaynames/polyfill')
131+
require('@formatjs/intl-displaynames/locale-data/en.js') // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
136132

137-
require('@formatjs/intl-listformat/polyfill');
138-
require('@formatjs/intl-listformat/locale-data/en.js'); // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
133+
require('@formatjs/intl-listformat/polyfill')
134+
require('@formatjs/intl-listformat/locale-data/en.js') // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
139135

140-
require('@formatjs/intl-numberformat/polyfill');
141-
require('@formatjs/intl-numberformat/locale-data/en.js'); // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
136+
require('@formatjs/intl-numberformat/polyfill')
137+
require('@formatjs/intl-numberformat/locale-data/en.js') // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
142138

143-
require('@formatjs/intl-relativetimeformat/polyfill');
144-
require('@formatjs/intl-relativetimeformat/locale-data/en.js'); // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
139+
require('@formatjs/intl-relativetimeformat/polyfill')
140+
require('@formatjs/intl-relativetimeformat/locale-data/en.js') // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
145141

146-
require('@formatjs/intl-datetimeformat/polyfill');
147-
require('@formatjs/intl-datetimeformat/locale-data/en.js'); // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
142+
require('@formatjs/intl-datetimeformat/polyfill')
143+
require('@formatjs/intl-datetimeformat/locale-data/en.js') // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
148144

149-
require('@formatjs/intl-datetimeformat/add-golden-tz.js');
145+
require('@formatjs/intl-datetimeformat/add-golden-tz.js')
150146

151147
// https://formatjs.io/docs/polyfills/intl-datetimeformat/#default-timezone
152148
if ('__setDefaultTimeZone' in Intl.DateTimeFormat) {
153-
154149
// If you are using react-native-cli
155-
let RNLocalize = require('react-native-localize');
156-
Intl.DateTimeFormat.__setDefaultTimeZone(RNLocalize.getTimeZone());
150+
let RNLocalize = require('react-native-localize')
151+
Intl.DateTimeFormat.__setDefaultTimeZone(RNLocalize.getTimeZone())
157152

158153
// Are you using Expo, use this instead of previous 2 lines
159154
// Intl.DateTimeFormat.__setDefaultTimeZone(
@@ -169,9 +164,9 @@ if (isHermesEnabled || isAndroid) { // this line is only needed if you don't us
169164
- Try to avoid putting the Picker Modals inside of a scrollView If that is not possible use the following props on the surrounding ScrollViews/Flatlists
170165

171166
```javascript
172-
keyboardDismissMode="on-drag"
173-
keyboardShouldPersistTaps="handled"
174-
contentInsetAdjustmentBehavior="always"
167+
keyboardDismissMode = 'on-drag'
168+
keyboardShouldPersistTaps = 'handled'
169+
contentInsetAdjustmentBehavior = 'always'
175170
```
176171

177172
This is to prevent the need to press 2 times before save or close button in modal works (1 press for closing keyboard, 1 press for confirm/close) [React Native Issue: #10138](https://github.com/facebook/react-native/issues/10138)

src/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export { default as en } from './translations/en'
1414
export { default as enGB } from './translations/enGB'
1515
export { default as es } from './translations/es'
1616
export { default as fr } from './translations/fr'
17+
export { default as he } from './translations/he'
1718
export { default as it } from './translations/it'
1819
export { default as ko } from './translations/ko'
1920
export { default as nl } from './translations/nl'

src/translations/he.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import type { TranslationsType } from './utils'
2+
3+
const he: TranslationsType = {
4+
save: 'שמור',
5+
selectSingle: 'בחר תאריך',
6+
selectMultiple: 'בחר תאריכים',
7+
selectRange: 'בחר טווח',
8+
notAccordingToDateFormat: (inputFormat) =>
9+
`פורמט של תאריך צריך להיות ${inputFormat}`,
10+
mustBeHigherThan: (date) => `חייב להיות אחרי ${date}`,
11+
mustBeLowerThan: (date) => `חייב להיות לפני ${date}`,
12+
mustBeBetween: (startDate, endDate) =>
13+
`חייב להיות בין ${startDate} - ${endDate}`,
14+
dateIsDisabled: 'יום לא מורשה',
15+
previous: 'הקודם',
16+
next: 'הבא',
17+
typeInDate: 'הקש תאריך',
18+
pickDateFromCalendar: 'בחר תאריך מהלוח שנה',
19+
close: 'סגור',
20+
}
21+
export default he

0 commit comments

Comments
 (0)