re-add missing timezone locales

add timezone locales that were lost when moving from vendoring the
library to pulling it from npm. custom locales were apparently added
to the vendored lib.

fixes CNVS-38138

test plan:
- change user locale to each of the following:
  ar, da, fa, ht, hy, mi, nn, tr
- load a page
- ensure there is not a 404 when trying to load the timezone js file

Change-Id: Idff0059e3e445d1602f5d595d595af4780b34517
Reviewed-on: https://gerrit.instructure.com/123653
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
This commit is contained in:
Brent Burgoyne 2017-08-23 08:29:31 -06:00
parent 086a3f7bbe
commit 2be11521b1
19 changed files with 628 additions and 230 deletions

View File

@ -4,10 +4,12 @@ const path = require('path')
// Put any custom moment locales here:
const customMomentLocales = [
'de',
'fa',
'fr',
'fr-ca',
'he',
'ht-ht',
'hy-am',
'mi-nz',
'pl'
]

View File

@ -0,0 +1,19 @@
require('moment/locale/fa')
const moment = require('moment')
const data = moment.localeData('fa')
data._monthsShort = [
'ژانویه',
'فوریه',
'مارس',
'آوریل',
'مه',
'ژوئن',
'ژوییه',
'آگوست',
'سپتامبر',
'اکتبر',
'نوامبر',
'دسامبر'
]

View File

@ -0,0 +1,19 @@
require('moment/locale/hy-am')
const moment = require('moment')
const data = moment.localeData('hy-am')
data._monthsShort = [
'Հնվ',
'Փտր',
'Մրտ',
'Ապր',
'Մյս',
'Հնս',
'Հլս',
'Օգս',
'Սպտ',
'Հկտ',
'Նմբ',
'Դկտ'
]

View File

@ -22,7 +22,7 @@ import moment from 'moment'
export default moment.defineLocale('mi-nz', {
months: 'Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea'.split('_'),
monthsShort: 'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split('_'),
monthsShort: ['Hān', 'Pēp', 'Māe', 'Āpe', 'Mei', 'Hun', 'Hūr', 'Āku', 'Hep', 'Oke', 'Noe', 'Tīh'],
weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'),
weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
@ -60,5 +60,3 @@ export default moment.defineLocale('mi-nz', {
ordinalParse: /\d{1,2}º/,
ordinal: '%dº'
});

View File

@ -0,0 +1,59 @@
module.exports = { // eslint-disable-line import/no-commonjs
name: 'ar_SA',
day: {
abbrev: [
'الأحد',
'الاثنين',
'الثلاثاء',
'الأربعاء',
'الخميس',
'الجمعة',
'السبت'
],
full: [
'الأحد',
'الاثنين',
'الثلاثاء',
'الأربعاء',
'الخميس',
'الجمعة',
'السبت'
]
},
month: {
abbrev: [
'يناير',
'فبراير',
'مارس',
'أبريل',
'مايو',
'يونيو',
'يوليو',
'أغسطس',
'سبتمبر',
'أكتوبر',
'نوفمبر',
'ديسمبر'
],
full: [
'يناير',
'فبراير',
'مارس',
'أبريل',
'مايو',
'يونيو',
'يوليو',
'أغسطس',
'سبتمبر',
'أكتوبر',
'نوفمبر',
'ديسمبر'
]
},
meridiem: ['صباحًا', 'مساءً'],
date: '%d/%m/%Y',
time24: '%T',
dateTime: '%a %d %b %Y %T %Z',
time12: '',
full: '%a %b %e %H:%M:%S %Z %Y'
}

View File

@ -0,0 +1,51 @@
module.exports = { // eslint-disable-line import/no-commonjs
name: 'da_DK',
day: {
abbrev: ['søn', 'man', 'tir', 'ons', 'tor', 'fre', 'lør'],
full: [
'søndag',
'mandag',
'tirsdag',
'onsdag',
'torsdag',
'fredag',
'lørdag'
]
},
month: {
abbrev: [
'jan',
'feb',
'mar',
'apr',
'maj',
'jun',
'jul',
'aug',
'sep',
'okt',
'nov',
'dec'
],
full: [
'januar',
'februar',
'marts',
'april',
'maj',
'juni',
'juli',
'august',
'september',
'oktober',
'november',
'december'
]
},
meridiem: ['', ''],
date: '%Y-%m-%d',
time24: '%H:%M:%S',
dateTime: '%a %e %b %Y %H:%M:%S',
time12: '',
full: '%a %b %e %H:%M:%S %Z %Y'
}

View File

@ -1,15 +1,7 @@
module.exports = { // eslint-disable-line import/no-commonjs
name: 'de_DE',
day: {
abbrev: [
'So',
'Mo',
'Di',
'Mi',
'Do',
'Fr',
'Sa'
],
abbrev: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
full: [
'Sonntag',
'Montag',
@ -50,10 +42,7 @@ module.exports = { // eslint-disable-line import/no-commonjs
'Dezember'
]
},
meridiem: [
'',
''
],
meridiem: ['', ''],
date: '%d.%m.%Y',
time24: '%T',
dateTime: '%a %d %b %Y %T %Z',

View File

@ -0,0 +1,59 @@
module.exports = { // eslint-disable-line import/no-commonjs
name: 'fa_IR',
day: {
abbrev: [
'یکشنبه',
'دوشنبه',
'سه شنبه',
'چهارشنبه',
'پنجشنبه',
'جمعه',
'شنبه'
],
full: [
'یکشنبه',
'دوشنبه',
'سه شنبه',
'چهارشنبه',
'پنجشنبه',
'جمعه',
'شنبه'
]
},
month: {
abbrev: [
'ژانویه',
'فوریه',
'مارس',
'آوریل',
'مه',
'ژوئن',
'ژوییه',
'آگوست',
'سپتامبر',
'اکتبر',
'نوامبر',
'دسامبر'
],
full: [
'ژانویه',
'فوریه',
'مارس',
'آوریل',
'مه',
'ژوئن',
'ژوییه',
'آگوست',
'سپتامبر',
'اکتبر',
'نوامبر',
'دسامبر'
]
},
meridiem: ['قبل از ظهر', 'بعد از ظهر'],
date: '%d/%m/%Y',
time24: '%T',
dateTime: '%a %d %b %Y %T %Z',
time12: '',
full: '%a %b %e %H:%M:%S %Z %Y'
}

View File

@ -1,27 +1,19 @@
module.exports = {
"name": "fr_CA",
"day": {
"abbrev": [
"dim",
"lun",
"mar",
"mer",
"jeu",
"ven",
"sam"
],
"full": [
"dimanche",
"lundi",
"mardi",
"mercredi",
"jeudi",
"vendredi",
"samedi"
module.exports = { // eslint-disable-line import/no-commonjs
name: 'fr_CA',
day: {
abbrev: ['dim', 'lun', 'mar', 'mer', 'jeu', 'ven', 'sam'],
full: [
'dimanche',
'lundi',
'mardi',
'mercredi',
'jeudi',
'vendredi',
'samedi'
]
},
"month": {
"abbrev": [
month: {
abbrev: [
'Jan',
'Fév',
'Mar',
@ -35,28 +27,25 @@ module.exports = {
'Nov',
'Déc'
],
"full": [
"janvier",
"février",
"mars",
"avril",
"mai",
"juin",
"juillet",
"août",
"septembre",
"octobre",
"novembre",
"décembre"
full: [
'janvier',
'février',
'mars',
'avril',
'mai',
'juin',
'juillet',
'août',
'septembre',
'octobre',
'novembre',
'décembre'
]
},
"meridiem": [
"",
""
],
"date": "%Y-%m-%d",
"time24": "%T",
"dateTime": "%a %d %b %Y %T %Z",
"time12": "",
"full": "%A %-e %B %Y, %H:%M:%S (UTC%z)"
meridiem: ['', ''],
date: '%Y-%m-%d',
time24: '%T',
dateTime: '%a %d %b %Y %T %Z',
time12: '',
full: '%A %-e %B %Y, %H:%M:%S (UTC%z)'
}

View File

@ -1,27 +1,19 @@
module.exports = {
"name": "fr_FR",
"day": {
"abbrev": [
"dim.",
"lun.",
"mar.",
"mer.",
"jeu.",
"ven.",
"sam."
],
"full": [
"dimanche",
"lundi",
"mardi",
"mercredi",
"jeudi",
"vendredi",
"samedi"
module.exports = { // eslint-disable-line import/no-commonjs
name: 'fr_FR',
day: {
abbrev: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
full: [
'dimanche',
'lundi',
'mardi',
'mercredi',
'jeudi',
'vendredi',
'samedi'
]
},
"month": {
"abbrev": [
month: {
abbrev: [
'Jan',
'Fév',
'Mar',
@ -35,28 +27,25 @@ module.exports = {
'Nov',
'Déc'
],
"full": [
"janvier",
"février",
"mars",
"avril",
"mai",
"juin",
"juillet",
"août",
"septembre",
"octobre",
"novembre",
"décembre"
full: [
'janvier',
'février',
'mars',
'avril',
'mai',
'juin',
'juillet',
'août',
'septembre',
'octobre',
'novembre',
'décembre'
]
},
"meridiem": [
"",
""
],
"date": "%d/%m/%Y",
"time24": "%T",
"dateTime": "%a %d %b %Y %T %Z",
"time12": "",
"full": "%A %-e %B %Y, %H:%M:%S (UTC%z)"
meridiem: ['', ''],
date: '%d/%m/%Y',
time24: '%T',
dateTime: '%a %d %b %Y %T %Z',
time12: '',
full: '%A %-e %B %Y, %H:%M:%S (UTC%z)'
}

View File

@ -1,24 +1,8 @@
module.exports = { // eslint-disable-line import/no-commonjs
name: 'he_IL',
day: {
abbrev: [
"א'",
"ב'",
"ג'",
"ד'",
"ה'",
"ו'",
"ש'"
],
full: [
'ראשון',
'שני',
'שלישי',
'רביעי',
'חמישי',
'שישי',
'שבת'
]
abbrev: ["א'", "ב'", "ג'", "ד'", "ה'", "ו'", "ש'"],
full: ['ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת']
},
month: {
abbrev: [
@ -50,10 +34,7 @@ module.exports = { // eslint-disable-line import/no-commonjs
'דצמבר'
]
},
meridiem: [
'AM',
'PM'
],
meridiem: ['AM', 'PM'],
date: '%d/%m/%y',
time24: '%H:%M:%S',
dateTime: '%Z %H:%M:%S %Y %b %d %a',

View File

@ -0,0 +1,43 @@
module.exports = { // eslint-disable-line import/no-commonjs
name: 'ht_HT',
day: {
abbrev: ['dim', 'len', 'mad', 'mèk', 'jed', 'van', 'sam'],
full: ['dimanch', 'lendi', 'madi', 'mèkredi', 'jedi', 'vandredi', 'samdi']
},
month: {
abbrev: [
'jan',
'fev',
'mas',
'avr',
'me',
'jen',
'jiy',
'out',
'sep',
'okt',
'nov',
'des'
],
full: [
'janvye',
'fevriye',
'mas',
'avril',
'me',
'jen',
'jiyè',
'out',
'septanm',
'oktòb',
'novanm',
'desanm'
]
},
meridiem: ['', ''],
date: '%d-%m-%Y',
time24: '%R',
dateTime: '%a, %d %b %Y %H:%M:%S %z',
time12: '',
full: '%b %-d, %Y %H:%M'
}

View File

@ -0,0 +1,51 @@
module.exports = { // eslint-disable-line import/no-commonjs
name: 'hy_AM',
day: {
abbrev: ['կրկ', 'երկ', 'երք', 'չրք', 'հնգ', 'ուրբ', 'շբթ'],
full: [
'կիրակի',
'երկուշաբթի',
'երեքշաբթի',
'չորեքշաբթի',
'հինգշաբթի',
'ուրբաթ',
'շաբաթ'
]
},
month: {
abbrev: [
'Հնվ',
'Փտր',
'Մրտ',
'Ապր',
'Մյս',
'Հնս',
'Հլս',
'Օգս',
'Սպտ',
'Հկտ',
'Նմբ',
'Դկտ'
],
full: [
'հունվար',
'փետրվար',
'մարտ',
'ապրիլ',
'մայիս',
'հունիս',
'հուլիս',
'օգոստոս',
'սեպտեմբեր',
'հոկտեմբեր',
'նոյեմբեր',
'դեկտեմբեր'
]
},
meridiem: ['առավոտվա', 'ցերեկվա'],
date: '%d.%m.%Y',
time24: '%T',
dateTime: '%a, %d %b %Y թ., %R %Z',
time12: '',
full: '%a %b %e %H:%M:%S %Z %Y'
}

View File

@ -1,62 +1,51 @@
module.exports = {
"name": "is_IS",
"day": {
"abbrev": [
"Sun",
"Mán",
"Þri",
"Mið",
"Fim",
"Fös",
"Lau"
],
"full": [
"Sunnudagur",
"Mánudagur",
"Þriðjudagur",
"Miðvikudagur",
"Fimmtudagur",
"Föstudagur",
"Laugardagur"
module.exports = { // eslint-disable-line import/no-commonjs
name: 'is_IS',
day: {
abbrev: ['Sun', 'Mán', 'Þri', 'Mið', 'Fim', 'Fös', 'Lau'],
full: [
'Sunnudagur',
'Mánudagur',
'Þriðjudagur',
'Miðvikudagur',
'Fimmtudagur',
'Föstudagur',
'Laugardagur'
]
},
"month": {
"abbrev": [
"Jan",
"Feb",
"Mar",
"Apr",
"Maí",
"Jún",
"Júl",
"Ágú",
"Sep",
"Okt",
"Nóv",
"Des"
month: {
abbrev: [
'Jan',
'Feb',
'Mar',
'Apr',
'Maí',
'Jún',
'Júl',
'Ágú',
'Sep',
'Okt',
'Nóv',
'Des'
],
"full": [
"Janúar",
"Febrúar",
"Mars",
"Apríl",
"Maí",
"Júní",
"Júlí",
"Ágúst",
"September",
"Október",
"Nóvember",
"Desember"
full: [
'Janúar',
'Febrúar',
'Mars',
'Apríl',
'Maí',
'Júní',
'Júlí',
'Ágúst',
'September',
'Október',
'Nóvember',
'Desember'
]
},
"meridiem": [
"",
""
],
"date": "%Y-%m-%d",
"time24": "%T",
"dateTime": "%a %d %b %Y %T %Z",
"time12": "",
"full": "%b %-d, %Y %-l:%M%P"
meridiem: ['', ''],
date: '%Y-%m-%d',
time24: '%T',
dateTime: '%a %d %b %Y %T %Z',
time12: '',
full: '%b %-d, %Y %-l:%M%P'
}

View File

@ -0,0 +1,51 @@
module.exports = { // eslint-disable-line import/no-commonjs
name: 'mi_NZ',
day: {
abbrev: ['Ta', 'Ma', 'Tū', 'We', 'Tāi', 'Pa', 'Hā'],
full: [
'Rātapu',
'Mane',
'Tūrei',
'Wenerei',
'Tāite',
'Paraire',
'Hātarei'
]
},
month: {
abbrev: [
'Hān',
'Pēp',
'Māe',
'Āpe',
'Mei',
'Hun',
'Hūr',
'Āku',
'Hep',
'Oke',
'Noe',
'Tīh'
],
full: [
'Kohi-tātea',
'Hui-tanguru',
'Poutū-te-rangi',
'Paenga-whāwhā',
'Haratua',
'Pipiri',
'Hōngoingoi',
'Here-turi-kōkā',
'Mahuru',
'Whiringa-ā-nuku',
'Whiringa-ā-rangi',
'Hakihea'
]
},
meridiem: ['', ''],
date: '%d/%m/%y',
time24: '%T',
dateTime: 'Te %A, te %d o %B, %Y %T %Z',
time12: '',
full: 'Te %A, te %d o %B, %Y %T %Z'
}

View File

@ -0,0 +1,51 @@
module.exports = { // eslint-disable-line import/no-commonjs
name: 'nn_NO',
day: {
abbrev: ['sø.', 'må.', 'ty.', 'on.', 'to.', 'fr.', 'la.'],
full: [
'sundag',
'måndag',
'tysdag',
'onsdag',
'torsdag',
'fredag',
'laurdag'
]
},
month: {
abbrev: [
'jan.',
'feb.',
'mars',
'april',
'mai',
'juni',
'juli',
'aug.',
'sep.',
'okt.',
'nov.',
'des.'
],
full: [
'januar',
'februar',
'mars',
'april',
'mai',
'juni',
'juli',
'august',
'september',
'oktober',
'november',
'desember'
]
},
meridiem: ['', ''],
date: '%Y-%m-%d',
time24: 'kl. %H.%M %z',
dateTime: '%b %-d at %l:%M%P',
time12: '',
full: '%b %-d, %Y %-l:%M%P'
}

View File

@ -1,27 +1,19 @@
module.exports = {
"name": "pl_PL",
"day": {
"abbrev": [
"nie",
"pon",
"wto",
"śro",
"czw",
"pią",
"sob"
],
"full": [
"niedziela",
"poniedziałek",
"wtorek",
"środa",
"czwartek",
"piątek",
"sobota"
module.exports = { // eslint-disable-line import/no-commonjs
name: 'pl_PL',
day: {
abbrev: ['nie', 'pon', 'wto', 'śro', 'czw', 'pią', 'sob'],
full: [
'niedziela',
'poniedziałek',
'wtorek',
'środa',
'czwartek',
'piątek',
'sobota'
]
},
"month": {
"abbrev": [
month: {
abbrev: [
'Sty',
'Lut',
'Mar',
@ -35,28 +27,25 @@ module.exports = {
'Lis',
'Gru'
],
"full": [
"styczeń",
"luty",
"marzec",
"kwiecień",
"maj",
"czerwiec",
"lipiec",
"sierpień",
"wrzesień",
"październik",
"listopad",
"grudzień"
full: [
'styczeń',
'luty',
'marzec',
'kwiecień',
'maj',
'czerwiec',
'lipiec',
'sierpień',
'wrzesień',
'październik',
'listopad',
'grudzień'
]
},
"meridiem": [
"",
""
],
"date": "%d.%m.%Y",
"time24": "%T",
"dateTime": "%a, %-d %b %Y, %T",
"time12": "",
"full": "%a, %-d %b %Y, %T %Z"
meridiem: ['', ''],
date: '%d.%m.%Y',
time24: '%T',
dateTime: '%a, %-d %b %Y, %T',
time12: '',
full: '%a, %-d %b %Y, %T %Z'
}

View File

@ -0,0 +1,51 @@
module.exports = { // eslint-disable-line import/no-commonjs
name: 'tr_TR',
day: {
abbrev: ['Paz', 'Pzt', 'Sal', 'Çar', 'Per', 'Cum', 'Cmt'],
full: [
'Pazar',
'Pazartesi',
'Salı',
'Çarşamba',
'Perşembe',
'Cuma',
'Cumartesi'
]
},
month: {
abbrev: [
'Oca',
'Şub',
'Mar',
'Nis',
'May',
'Haz',
'Tem',
'Ağu',
'Eyl',
'Eki',
'Kas',
'Ara'
],
full: [
'Ocak',
'Şubat',
'Mart',
'Nisan',
'Mayıs',
'Haziran',
'Temmuz',
'Ağustos',
'Eylül',
'Ekim',
'Kasım',
'Aralık'
]
},
meridiem: ['AM', 'PM'],
date: '%d.%m.%Y',
time24: '%T',
dateTime: '%a %d %b %Y %T %Z',
time12: '',
full: '%a %b %e %H:%M:%S %Z %Y'
}

View File

@ -23,7 +23,6 @@ import $ from 'jquery'
import I18n from 'i18nObj'
import 'translations/_core'
import 'translations/_core_en'
import moment from 'moment'
import bigeasyLocales from 'timezone/locales'
import bigeasyLocale_de_DE from 'custom_timezone_locales/de_DE'
@ -31,14 +30,25 @@ import bigeasyLocale_fr_FR from 'custom_timezone_locales/fr_FR'
import bigeasyLocale_fr_CA from 'custom_timezone_locales/fr_CA'
import bigeasyLocale_he_IL from 'custom_timezone_locales/he_IL'
import bigeasyLocale_pl_PL from 'custom_timezone_locales/pl_PL'
import bigeasyLocale_is_IS from 'custom_timezone_locales/is_IS'
import bigeasyLocale_ar_SA from 'custom_timezone_locales/ar_SA'
import bigeasyLocale_da_DK from 'custom_timezone_locales/da_DK'
import bigeasyLocale_fa_IR from 'custom_timezone_locales/fa_IR'
import bigeasyLocale_ht_HT from 'custom_timezone_locales/ht_HT'
import bigeasyLocale_hy_AM from 'custom_timezone_locales/hy_AM'
import bigeasyLocale_mi_NZ from 'custom_timezone_locales/mi_NZ'
import bigeasyLocale_nn_NO from 'custom_timezone_locales/nn_NO'
import bigeasyLocale_tr_TR from 'custom_timezone_locales/tr_TR'
import 'custom_moment_locales/de'
import 'custom_moment_locales/he'
import 'custom_moment_locales/pl'
import 'custom_moment_locales/fa'
import 'custom_moment_locales/fr'
import 'custom_moment_locales/fr_ca'
import 'custom_moment_locales/ht_ht'
import 'custom_moment_locales/mi_nz'
import 'custom_moment_locales/hy_am'
let originalLocale
let originalFallbacksMap
@ -50,6 +60,15 @@ const bigeasyLocalesWithCustom = [
bigeasyLocale_fr_CA,
bigeasyLocale_he_IL,
bigeasyLocale_pl_PL,
bigeasyLocale_is_IS,
bigeasyLocale_ar_SA,
bigeasyLocale_da_DK,
bigeasyLocale_fa_IR,
bigeasyLocale_ht_HT,
bigeasyLocale_hy_AM,
bigeasyLocale_mi_NZ,
bigeasyLocale_nn_NO,
bigeasyLocale_tr_TR
]
const preloadedData = bigeasyLocalesWithCustom.reduce((memo, locale) => {
@ -96,7 +115,6 @@ function assertFormattedParsesToDate (formatted, date) {
}
locales.forEach((locale) => {
//if (locale.key !== 'de') return
test(`timezone -> moment for ${locale.key}`, () => {
I18n.locale = locale.key
try {
@ -106,7 +124,7 @@ locales.forEach((locale) => {
assertFormattedParsesToDate(formatted, date)
})
} catch (err) {
ok(true, 'missing bigeasy locale file')
ok(false, 'missing bigeasy locale file')
}
})
@ -120,7 +138,7 @@ locales.forEach((locale) => {
assertFormattedParsesToDate(formatted, date)
})
} catch (err) {
ok(true, 'missing bigeasy locale file')
ok(false, 'missing bigeasy locale file')
}
})
})