Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Maori support #125

Merged
merged 5 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node_modules
package-lock.json
4 changes: 3 additions & 1 deletion lib/common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export const defaultLocale = 'en';
export const supportedBaseLocales = ['ar', 'cy', 'da', 'de', 'en', 'es', 'fr', 'hi', 'ja', 'ko', 'nl', 'pt', 'sv', 'tr', 'zh'];
export const supportedBaseLocales = ['ar', 'cy', 'da', 'de', 'en', 'es', 'fr', 'hi', 'ja', 'ko', 'mi', 'nl', 'pt', 'sv', 'tr', 'zh'];
export const supportedLangpacks = ['ar', 'cy', 'da', 'de', 'en', 'en-gb', 'es', 'es-es', 'fr', 'fr-fr', 'fr-on', 'hi', 'ja', 'ko', 'mi', 'nl', 'pt', 'sv', 'tr', 'zh-cn', 'zh-tw'];
export const supportedLocalesDetails = [
{ code: 'ar-sa', name: 'العربية' },
{ code: 'cy-gb', name: 'Cymraeg (Y Deyrnas Unedig)' },
Expand All @@ -16,6 +17,7 @@ export const supportedLocalesDetails = [
{ code: 'hi-in', name: 'हिन्दी Hindi (India)' },
{ code: 'ja-jp', name: '日本語 (日本)' },
{ code: 'ko-kr', name: '한국어 (대한민국)' },
{ code: 'mi-nz', name: 'Māori (Aotearoa)' },
{ code: 'nl-nl', name: 'Nederlands (Nederland)' },
{ code: 'pt-br', name: 'Português (Brasil)' },
{ code: 'sv-se', name: 'Svenska (Sverige)' },
Expand Down
15 changes: 14 additions & 1 deletion lib/dateTime.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { getDocumentLocaleSettings, getLanguage, merge } from './common.js';

// to-do: These should be based on region, not language
const hour24locales = ['cy', 'da', 'de', 'es', 'fr', 'nl', 'pt', 'sv', 'tr', 'zh'];
const mondayFirstDayLocales = ['cy', 'da', 'de', 'fr', 'hi', 'nl', 'sv', 'tr'];
const mondayFirstDayLocales = ['cy', 'da', 'de', 'fr', 'hi', 'mi', 'nl', 'sv', 'tr'];

// timezone abbreviations and offsets from https://www.timeanddate.com/time/zones/
const timezoneOffsetMap = {
Expand Down Expand Up @@ -825,6 +826,18 @@ export function getDateTimeDescriptor() {
days[0] = ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'];
days[1] = days[2] = ['일', '월', '화', '수', '목', '금', '토'];
break;
case 'mi':
dateFormats = ['dddd, d MMMM y', 'd MMMM y', 'dd-MM-y', 'MMMM yyyy', 'd MMMM', 'd MMM'];
months = [
['Kohitātea', 'Huitanguru', 'Poutūterangi', 'Paengawhāwhā', 'Haratua', 'Pipiri', 'Hōngongoi', 'Hereturikōkā', 'Mahuru', 'Whiringa-ā-nuku', 'Whiringa-ā-rangi', 'Hakihea'],
['Kohi', 'Hui', 'Pou', 'Pae', 'Hara', 'Pipi', 'Hōngo', 'Here', 'Mahu', 'Nuku', 'Rangi', 'Haki']
];
days = [
['Rātapu', 'Rāhina', 'Rātū', 'Rāapa', 'Rāpare', 'Rāmere', 'Rāhoroi'],
['Tap', 'Hin', 'Tū', 'Apa', 'Par', 'Mer', 'Hor'],
['T', 'H', 'T', 'A', 'P', 'M', 'H']
Comment on lines +831 to +838
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are now confirmed correct.

];
break;
case 'nl':
dateFormats = ['dddd d MMMM yyyy', 'd MMMM yyyy', 'dd-MM-yyyy', 'MMMM yyyy', 'd MMMM', 'd MMM'];
dayPeriods = ['a.m.', 'p.m.'];
Expand Down
1 change: 1 addition & 0 deletions lib/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export function getNumberDescriptor() {
case 'es':
case 'hi':
case 'ja':
case 'mi':
case 'pt':
case 'zh':
percentPattern = '{number}%';
Expand Down
Loading