1 //! moment.js locale configuration
2 //! locale : Klingon (tlh)
3 //! author : Dominika Kruk : https://github.com/amaranthrose
5 import moment from '../moment';
7 var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');
9 function translateFuture(output) {
11 time = (output.indexOf('jaj') !== -1) ?
12 time.slice(0, -3) + 'leS' :
13 (output.indexOf('jar') !== -1) ?
14 time.slice(0, -3) + 'waQ' :
15 (output.indexOf('DIS') !== -1) ?
16 time.slice(0, -3) + 'nem' :
21 function translatePast(output) {
23 time = (output.indexOf('jaj') !== -1) ?
24 time.slice(0, -3) + 'Hu’' :
25 (output.indexOf('jar') !== -1) ?
26 time.slice(0, -3) + 'wen' :
27 (output.indexOf('DIS') !== -1) ?
28 time.slice(0, -3) + 'ben' :
33 function translate(number, withoutSuffix, string, isFuture) {
34 var numberNoun = numberAsNoun(number);
37 return numberNoun + ' tup';
39 return numberNoun + ' rep';
41 return numberNoun + ' jaj';
43 return numberNoun + ' jar';
45 return numberNoun + ' DIS';
49 function numberAsNoun(number) {
50 var hundred = Math.floor((number % 1000) / 100),
51 ten = Math.floor((number % 100) / 10),
55 word += numbersNouns[hundred] + 'vatlh';
58 word += ((word !== '') ? ' ' : '') + numbersNouns[ten] + 'maH';
61 word += ((word !== '') ? ' ' : '') + numbersNouns[one];
63 return (word === '') ? 'pagh' : word;
66 export default moment.defineLocale('tlh', {
67 months : 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'),
68 monthsShort : 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'),
69 monthsParseExact : true,
70 weekdays : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
71 weekdaysShort : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
72 weekdaysMin : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
78 LLL : 'D MMMM YYYY HH:mm',
79 LLLL : 'dddd, D MMMM YYYY HH:mm'
82 sameDay: '[DaHjaj] LT',
83 nextDay: '[wa’leS] LT',
85 lastDay: '[wa’Hu’] LT',
90 future : translateFuture,
104 ordinalParse: /\d{1,2}\./,
107 dow : 1, // Monday is the first day of the week.
108 doy : 4 // The week that contains Jan 4th is the first week of the year.