From 4c0a8060af398e12d4f61f98aed432660fa0298c Mon Sep 17 00:00:00 2001 From: Jitendra Adhikari Date: Sat, 9 Mar 2019 12:34:18 +0700 Subject: [PATCH 1/5] feat(locale): add nepali (np) locale --- src/locale/np.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/locale/np.js diff --git a/src/locale/np.js b/src/locale/np.js new file mode 100644 index 000000000..87da79c69 --- /dev/null +++ b/src/locale/np.js @@ -0,0 +1,27 @@ +import dayjs from 'dayjs' + +const locale = { + name: 'np', + weekdays: 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'), + months: 'वैशाख_जेठ_आषाढ_श्रावण_भाद्र_असोज_कार्तिक_मङ्सिर_पौष_माघ_फाल्गुन_चैत्र '.split('_'), + relativeTime: { + future: '%s पछि', + past: '%s अघि', + s: 'सेकेन्ड', + m: 'मिनेट', + mm: '%d मिनेट', + h: 'घन्टा', + hh: '%d घन्टा', + d: 'दिन', + dd: '%d दिन', + M: 'महिना', + MM: '%d महिना', + y: 'वर्ष', + yy: '%d वर्ष' + }, + ordinal: n => (n + '').replace(/\d/g, i => '०१२३४५६७८९'[i]) +} + +dayjs.locale(locale, null, true) + +export default locale From 8b117c496c4d16bd3a78281776f2cd9c5fab3b54 Mon Sep 17 00:00:00 2001 From: Jitendra Adhikari Date: Sat, 9 Mar 2019 12:47:07 +0700 Subject: [PATCH 2/5] style(eslint): prefer template --- src/locale/np.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locale/np.js b/src/locale/np.js index 87da79c69..8f1324cd2 100644 --- a/src/locale/np.js +++ b/src/locale/np.js @@ -19,7 +19,7 @@ const locale = { y: 'वर्ष', yy: '%d वर्ष' }, - ordinal: n => (n + '').replace(/\d/g, i => '०१२३४५६७८९'[i]) + ordinal: n => `${n}`.replace(/\d/g, i => '०१२३४५६७८९'[i]) } dayjs.locale(locale, null, true) From 8b9e4b56556ed2cd18b57675f5c5abbeab4a62be Mon Sep 17 00:00:00 2001 From: Jitendra Adhikari Date: Sat, 9 Mar 2019 12:58:37 +0700 Subject: [PATCH 3/5] fix(locale): np locale unit period --- src/locale/np.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/locale/np.js b/src/locale/np.js index 8f1324cd2..cc83038d2 100644 --- a/src/locale/np.js +++ b/src/locale/np.js @@ -8,15 +8,15 @@ const locale = { future: '%s पछि', past: '%s अघि', s: 'सेकेन्ड', - m: 'मिनेट', + m: 'एक मिनेट', mm: '%d मिनेट', h: 'घन्टा', hh: '%d घन्टा', - d: 'दिन', + d: 'एक दिन', dd: '%d दिन', - M: 'महिना', + M: 'एक महिना', MM: '%d महिना', - y: 'वर्ष', + y: 'एक वर्ष', yy: '%d वर्ष' }, ordinal: n => `${n}`.replace(/\d/g, i => '०१२३४५६७८९'[i]) From 7d7592344908ca87662a651a4fce6be6d9aa122e Mon Sep 17 00:00:00 2001 From: Jitendra Adhikari Date: Sat, 9 Mar 2019 16:14:09 +0700 Subject: [PATCH 4/5] refactor(locale): np => ne --- src/locale/{np.js => ne.js} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/locale/{np.js => ne.js} (98%) diff --git a/src/locale/np.js b/src/locale/ne.js similarity index 98% rename from src/locale/np.js rename to src/locale/ne.js index cc83038d2..426a57fc3 100644 --- a/src/locale/np.js +++ b/src/locale/ne.js @@ -1,7 +1,7 @@ import dayjs from 'dayjs' const locale = { - name: 'np', + name: 'ne', weekdays: 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'), months: 'वैशाख_जेठ_आषाढ_श्रावण_भाद्र_असोज_कार्तिक_मङ्सिर_पौष_माघ_फाल्गुन_चैत्र '.split('_'), relativeTime: { From 88661ff722b3ecaf877d6a18aa1ba1edfc5ad10b Mon Sep 17 00:00:00 2001 From: Jitendra Adhikari Date: Sat, 9 Mar 2019 16:26:39 +0700 Subject: [PATCH 5/5] fix(locale): it uses AD system and not BS --- src/locale/ne.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locale/ne.js b/src/locale/ne.js index 426a57fc3..1fdd171b7 100644 --- a/src/locale/ne.js +++ b/src/locale/ne.js @@ -3,7 +3,7 @@ import dayjs from 'dayjs' const locale = { name: 'ne', weekdays: 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'), - months: 'वैशाख_जेठ_आषाढ_श्रावण_भाद्र_असोज_कार्तिक_मङ्सिर_पौष_माघ_फाल्गुन_चैत्र '.split('_'), + months: 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मे_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'), relativeTime: { future: '%s पछि', past: '%s अघि',