From 93c7d92298b2c24c7cad1f9a8812ac1071319d67 Mon Sep 17 00:00:00 2001 From: Emanuel Claesson Date: Wed, 19 Mar 2025 18:09:34 +0100 Subject: [PATCH] Added Swedish (sv) translation. --- docusaurus/docs/intro.md | 2 +- example/app/index.tsx | 2 ++ src/index.tsx | 1 + src/translations/sv.ts | 23 +++++++++++++++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/translations/sv.ts diff --git a/docusaurus/docs/intro.md b/docusaurus/docs/intro.md index 48d6c17f..2f45582a 100644 --- a/docusaurus/docs/intro.md +++ b/docusaurus/docs/intro.md @@ -36,7 +36,7 @@ npm install react-native-paper-dates --save ### Supported -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/cs/el/ru/ro/id/ja/th/uk-UA/no-NO` 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/cs/el/ru/ro/id/ja/th/uk-UA/no-NO/sv` 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' diff --git a/example/app/index.tsx b/example/app/index.tsx index ee422ab9..fd08f8a8 100644 --- a/example/app/index.tsx +++ b/example/app/index.tsx @@ -54,6 +54,7 @@ import { th, ukUA, noNO, + sv, } from 'react-native-paper-dates' import { useCallback, useMemo, useState } from 'react' import React from 'react' @@ -87,6 +88,7 @@ const locales: [string, TranslationsType][] = [ ['th', th], ['uk-UA', ukUA], ['no-NO', noNO], + ['sv', sv], ] locales.forEach((locale) => { diff --git a/src/index.tsx b/src/index.tsx index 8ee09546..4e53b78e 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -34,3 +34,4 @@ export { default as ja } from './translations/ja' export { default as th } from './translations/th' export { default as ukUA } from './translations/ukUA' export { default as noNO } from './translations/noNO' +export { default as sv } from './translations/sv' diff --git a/src/translations/sv.ts b/src/translations/sv.ts new file mode 100644 index 00000000..b9aa6408 --- /dev/null +++ b/src/translations/sv.ts @@ -0,0 +1,23 @@ +import type { TranslationsType } from './utils' + +const sv: TranslationsType = { + save: 'Spara', + selectSingle: 'Välj datum', + selectMultiple: 'Välj datum', + selectRange: 'Välj period', + notAccordingToDateFormat: (inputFormat) => + `Datum måste vara i formatet ${inputFormat}`, + mustBeHigherThan: (date) => `Måste vara efter ${date}`, + mustBeLowerThan: (date) => `Måste vara före ${date}`, + mustBeBetween: (startDate, endDate) => + `Måste vara mellan ${startDate} - ${endDate}`, + dateIsDisabled: 'Datumet är inte tillåtet', + previous: 'Föregående', + next: 'Nästa', + typeInDate: 'Skriv datum', + pickDateFromCalendar: 'Välj datum i kalender', + close: 'Stäng', + minute: 'Minut', + hour: 'Timme', +} +export default sv