From 772f9c0b782f5dff796d1f0118edb3073ad1d2e7 Mon Sep 17 00:00:00 2001 From: MikLay Date: Mon, 19 Aug 2024 16:33:57 +0300 Subject: [PATCH] Add Norwegian translation and match its naming with Intl localization's naming, Remove unused file 'ua.ts' --- docusaurus/docs/intro.md | 2 +- example/app/index.tsx | 2 ++ src/index.tsx | 3 ++- src/translations/noNO.ts | 23 +++++++++++++++++++++++ src/translations/ua.ts | 23 ----------------------- 5 files changed, 28 insertions(+), 25 deletions(-) create mode 100644 src/translations/noNO.ts delete mode 100644 src/translations/ua.ts diff --git a/docusaurus/docs/intro.md b/docusaurus/docs/intro.md index 64ea78e..48d6c17 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` 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` 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 bebbffa..ee422ab 100644 --- a/example/app/index.tsx +++ b/example/app/index.tsx @@ -53,6 +53,7 @@ import { ja, th, ukUA, + noNO, } from 'react-native-paper-dates' import { useCallback, useMemo, useState } from 'react' import React from 'react' @@ -85,6 +86,7 @@ const locales: [string, TranslationsType][] = [ ['ja', ja], ['th', th], ['uk-UA', ukUA], + ['no-NO', noNO], ] locales.forEach((locale) => { diff --git a/src/index.tsx b/src/index.tsx index d62a006..8ee0954 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -32,4 +32,5 @@ export { default as ro } from './translations/ro' export { default as id } from './translations/id' export { default as ja } from './translations/ja' export { default as th } from './translations/th' -export { default as ukUA } from 'src/translations/ukUA' +export { default as ukUA } from './translations/ukUA' +export { default as noNO } from './translations/noNO' diff --git a/src/translations/noNO.ts b/src/translations/noNO.ts new file mode 100644 index 0000000..e40f7f9 --- /dev/null +++ b/src/translations/noNO.ts @@ -0,0 +1,23 @@ +import type { TranslationsType } from './utils' + +const noNO: TranslationsType = { + save: 'Lagre', + selectSingle: 'Velg dato', + selectMultiple: 'Velg datoer', + selectRange: 'Velg periode', + notAccordingToDateFormat: (inputFormat) => + `Datoformatet må være ${inputFormat}`, + mustBeHigherThan: (date) => `Må være senere enn ${date}`, + mustBeLowerThan: (date) => `Må være tidligere enn ${date}`, + mustBeBetween: (startDate, endDate) => + `Må være mellom ${startDate} - ${endDate}`, + dateIsDisabled: 'Denne dagen er ikke tillatt', + previous: 'Forrige', + next: 'Neste', + typeInDate: 'Skriv inn dato', + pickDateFromCalendar: 'Velg dato fra kalenderen', + close: 'Lukk', + hour: 'Time', + minute: 'Minutt', +} +export default noNO diff --git a/src/translations/ua.ts b/src/translations/ua.ts deleted file mode 100644 index 0dc12c3..0000000 --- a/src/translations/ua.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { TranslationsType } from './utils' - -const ukUA: TranslationsType = { - save: 'Зберегти', - selectSingle: 'Оберіть дату', - selectMultiple: 'Оберіть дати', - selectRange: 'Оберіть період', - notAccordingToDateFormat: (inputFormat: string) => - `Формат дати має бути ${inputFormat}`, - mustBeHigherThan: (date: string) => `Має бути пізніше ніж ${date}`, - mustBeLowerThan: (date: string) => `Має бути раніше ніж ${date}`, - mustBeBetween: (startDate: string, endDate: string) => - `Має бути між ${startDate} - ${endDate}`, - dateIsDisabled: 'Цей день не дозволено обирати', - previous: 'Попередній', - next: 'Наступний', - typeInDate: 'Введіть дату', - pickDateFromCalendar: 'Оберіть дату з календаря', - close: 'Закрити', - hour: 'Година', - minute: 'Хвилина', -} -export default ukUA