Skip to content

Commit

Permalink
Added translations for catalan language and updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoanGil committed Sep 4, 2023
1 parent 18b2292 commit 7cc8cd2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docusaurus/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ npm install react-native-paper-dates --save

### Supported

React-Native-Paper-Dates currently supports `ar/de/en/en-GB/es/fr/he/hi/it/ko/nl/pl/pt/tr/zh/zh-TW` 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`.
React-Native-Paper-Dates currently supports `ar/ca/de/en/en-GB/es/fr/he/hi/it/ko/nl/pl/pt/tr/zh/zh-TW` 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`.

```javascript
import { enGB, registerTranslation } from 'react-native-paper-dates'
Expand Down
2 changes: 2 additions & 0 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
registerTranslation,
TranslationsType,
ar,
ca,
de,
en,
enGB,
Expand All @@ -52,6 +53,7 @@ import { useCallback, useState } from 'react'

const locales: [string, TranslationsType][] = [
['ar', ar],
['ca', ca],
['de', de],
['en', en],
['en-GB', enGB],
Expand Down
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type { TranslationsType } from './translations/utils'
export { registerTranslation, getTranslation } from './translations/utils'

export { default as ar } from './translations/ar'
export { default as ca } from './translations/ca'
export { default as de } from './translations/de'
export { default as en } from './translations/en'
export { default as enGB } from './translations/enGB'
Expand Down
21 changes: 21 additions & 0 deletions src/translations/ca.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { TranslationsType } from './utils'

const ca: TranslationsType = {
save: 'Guardar',
selectSingle: 'Seleccionar data',
selectMultiple: 'Seleccionar dates',
selectRange: 'Seleccionar període',
notAccordingToDateFormat: (inputFormat) =>
`El format de la data ha de ser ${inputFormat}`,
mustBeHigherThan: (date) => `Ha de ser posterior a ${date}`,
mustBeLowerThan: (date) => `Ha de ser anterior a ${date}`,
mustBeBetween: (startDate, endDate) =>
`Ha d'estar entre ${startDate} - ${endDate}`,
dateIsDisabled: 'Dia no permès',
previous: 'Anterior',
next: 'Següent',
typeInDate: 'Escriu la data',
pickDateFromCalendar: 'Seleccionar la data del calendari',
close: 'Tancar',
}
export default ca

0 comments on commit 7cc8cd2

Please sign in to comment.