/** * */ var userLang = navigator.language || navigator.userLanguage; $.lang = {}; $.lang.ko = { // 공통 common_title : '서울과학기술대학교 수강신청시스템' , common_leftTtile : '수강신청시스템' , common_notice : '공지사항' , common_basket : '장바구니' , common_sugang : '수강신청' , common_confirm : '수강신청확인서' , common_schedule : '시간표조회' , common_program : '강의계획서조회' , common_admin : '수강신청관리' , common_logout : '로그아웃' , common_user : '님 환영합니다.' , common_btn_dcc_search : '이수체계도' , common_btn_abeek_anb_search : '공학인증선후수체계조회' , common_btn_anb_search : '선후수체계조회' , common_btn_view : '보기' // 로그인화면 , login_input_id : '학번' , login_input_password : '비밀번호' , login_button_login : '로그인' }; $.lang.en = { common_title : 'Course Enrollment System' , common_leftTtile : 'Course Enrollment System' , common_notice : 'Notice' , common_basket : 'Cart' , common_sugang : 'Course Enrollment' , common_confirm : 'Course Enrollment Confirmation' , common_schedule : 'View Course Schedule' , common_program : 'View Course Syllabus' , common_admin : 'Admin' , common_btn_dcc_search : 'Deparment Course Catalogue' // 이수체계도 , common_btn_abeek_anb_search : 'View ABEEK Course Sequence List' // 공학인증선후수체계조회 , common_btn_anb_search : 'View Course Sequence List' // 선후수체계조회 , common_btn_view : 'View' , common_logout : 'Logout' , common_user : 'Welcome ' // 로그인화면 , login_input_id : 'Student ID Number' , login_input_password : 'Password' , login_button_login : 'Login' }; /** * setLanguage * use $.lang[currentLanguage][languageNumber] */ function setLanguage(currentLanguage) { $('[data-lang]').each(function() { var $this = $(this); $this.html($.lang[currentLanguage][$this.data('lang')]); if($(this).prop("tagName") == 'INPUT') { $(this).val($.lang[currentLanguage][$this.data('lang')]); } }); setCookie($.consts.LANG, currentLanguage, 365); } function getLanguage() { var currentLanguage = getCookie($.consts.LANG); if (currentLanguage == '' || currentLanguage == null) { if(userLang.substring(0, 2) == 'ko') { currentLanguage = 'ko'; } else { currentLanguage = 'en'; } } return currentLanguage; } function setLabel(knm, enm) { var lang = getCookie($.consts.LANG); if(lang == 'en') { return enm; } return knm; }; function setCountLabel(obj, count) { var lang = getCookie($.consts.LANG); var txt = ''; if(lang == 'en') { $(obj).text( count + ' result(s) found.'); } else { $(obj).text( '총 ' + count + '건'); } }