namespace TheDatepicker { export enum TitleName { GoBack , GoForward , Close , Reset , Deselect , Month , Year , GoBackTableOfYears , GoForwardTableOfYears } export class Translator { public dayOfWeekFullTranslations_ = [ 'Sunday' , 'Monday' , 'Tuesday' , 'Wednesday' , 'Thursday' , 'Friday' , 'Saturday' , ] ; public dayOfWeekTranslations_ = [ 'Su' , 'Mo' , 'Tu' , 'We' , 'Th' , 'Fr' , 'Sa' , ] ; public monthTranslations_ = [ 'January' , 'February' , 'March' , 'April' , 'May' , 'June' , 'July' , 'August' , 'September' , 'October' , 'November' , 'December' , ] ; public monthShortTranslations_ = [ 'Jan' , 'Feb' , 'Mar' , 'Apr' , 'May' , 'Jun' , 'Jul' , 'Aug' , 'Sep' , 'Oct' , 'Nov' , 'Dec' , ] ; private titles_ = [ 'Go to previous month' , 'Go to next month' , 'Close calendar' , 'Reset calendar' , 'Deselect date' , 'Month selection' , 'Year selection' , 'Show earlier years' , 'Show later years' , ] ; public clone ( ) { const translator = new Translator ( ) ; let index ; for ( index = 0 ; index < this . dayOfWeekFullTranslations_ . length ; index ++ ) { translator . dayOfWeekFullTranslations_ = this . dayOfWeekFullTranslations_ . slice ( 0 ) ; } for ( index = 0 ; index < this . dayOfWeekTranslations_ . length ; index ++ ) { translator . dayOfWeekTranslations_ = this . dayOfWeekTranslations_ . slice ( 0 ) ; } for ( index = 0 ; index < this . monthTranslations_ . length ; index ++ ) { translator . monthTranslations_ = this . monthTranslations_ . slice ( 0 ) ; } for ( index = 0 ; index < this . monthShortTranslations_ . length ; index ++ ) { translator . monthShortTranslations_ = this . monthShortTranslations_ . slice ( 0 ) ; } for ( index = 0 ; index < this . titles_ . length ; index ++ ) { translator . titles_ = this . titles_ . slice ( 0 ) ; } return translator ; } public setDayOfWeekTranslation ( dayOfWeek , translation ) { this . dayOfWeekTranslations_ [ Helper_ . checkNumber_ ( 'Day of week' , dayOfWeek , 0 , 6 ) ] = Helper_ . checkString_ ( 'Translation' , translation , true ) ; } public setDayOfWeekFullTranslation ( dayOfWeek , translation ) { this . dayOfWeekFullTranslations_ [ Helper_ . checkNumber_ ( 'Day of week' , dayOfWeek , 0 , 6 ) ] = Helper_ . checkString_ ( 'Translation' , translation , true ) ; } public setMonthTranslation ( month , translation ) { this . monthTranslations_ [ Helper_ . checkNumber_ ( 'Month' , month , 0 , 11 ) ] = Helper_ . checkString_ ( 'Translation' , translation , true ) ; } public setMonthShortTranslation ( month , translation ) { this . monthShortTranslations_ [ Helper_ . checkNumber_ ( 'Month' , month , 0 , 11 ) ] = Helper_ . checkString_ ( 'Translation' , translation , true ) ; } public setTitleTranslation ( titleName , translation ) { this . titles_ [ Helper_ . checkNumber_ ( 'Title' , titleName , 0 , this . titles_ . length - 1 ) ] = Helper_ . checkString_ ( 'Translation' , translation ) ; } public translateDayOfWeek ( dayOfWeek ) { return this . dayOfWeekTranslations_ [ dayOfWeek ] ; } public translateDayOfWeekFull ( dayOfWeek ) { return this . dayOfWeekFullTranslations_ [ dayOfWeek ] ; } public translateMonth ( month ) { return this . monthTranslations_ [ month ] ; } public translateMonthShort ( month ) { return this . monthShortTranslations_ [ month ] ; } public translateTitle ( titleName ) { return this . titles_ [ titleName ] ; } } }