Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

libai / fireflyReg

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • fireflyReg
  • lib
  • lang.js
Find file
BlameHistoryPermalink
  • libai's avatar
    测试 · 8e24e39a
    libai committed a year ago
    8e24e39a
lang.js 5.09 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
var langStr =(navigator.language || navigator.browserLanguage).toLowerCase();
if(sessionStorage.clang == undefined || sessionStorage.clang == 'undefined'){
	//中文
	if(langStr.indexOf('zh')>=0){
		$('.L-En').hide();
		$('.L-Ar').hide();
	  $('.L-Cn').show();
	  sessionStorage.clangn = 2;
	  sessionStorage.clang = 'cn';
	  $('title').html('Firefly Live-螢火蟲直播官網-See u in Firefly!');
	  $('.changeLang span').text('繁體中文');
	  $('.changeLang').attr('data-num',0);
	  $('.changeLang li').eq(0).addClass('check');
	} else if(langStr.indexOf('ar')>=0){
		//a=阿拉伯語
		$('.L-Cn').hide();
	  $('.L-En').hide();
		$('.L-Ar').show();
	  sessionStorage.clangn = 7;
	  sessionStorage.clang = 'ar';
	  $('.login-no').addClass('direction');
	  $('title').html('Firefly Live-Live video streaming-See you in Firefly!');
	  $('.changeLang span').text('العربية');
	  $('.changeLang').attr('data-num',2);
	   $('.changeLang li').eq(2).addClass('check');
	} else {
		//英文
		$('.L-Cn').hide();
		$('.L-Ar').hide();
		$('.L-En').show();
		sessionStorage.clangn = 1;
		sessionStorage.clang = 'en';
	 $('title').html('Firefly Live-Live video streaming-See you in Firefly!');
	 $('.changeLang span').text('English');
	 $('.changeLang').attr('data-num',1);
	  $('.changeLang li').eq(1).addClass('check');
	}
} else {
	if(sessionStorage.clang == 'cn'){
		$('title').html('Firefly Live-螢火蟲直播官網-See u in Firefly!');
	  $('.L-En').hide();
	  $('.L-Ar').hide();
	  $('.L-Cn').show();
	  sessionStorage.clangn = 2;
	  $('.changeLang span').text('繁體中文');
	  $('.changeLang').attr('data-num',0);
	   $('.changeLang li').eq(0).addClass('check');
	}  else if(sessionStorage.clang == 'ar'){
		$('.login-no').addClass('direction');
		$('.L-Cn').hide();
	  $('.L-En').hide();
	  $('.L-Ar').show();
	  sessionStorage.clangn = 7;
	  $('title').html('Firefly Live-Live video streaming-See you in Firefly!');
	  $('.changeLang span').text('العربية');
	  $('.changeLang').attr('data-num',2);
	   $('.changeLang li').eq(2).addClass('check');
	} else {
		sessionStorage.clangn = 1;
		$('.L-Cn').hide();
		$('.L-Ar').hide();
		$('.L-En').show();
		$('title').html('Firefly Live-Live video streaming-See you in Firefly!');
		$('.changeLang span').text('English');
		$('.changeLang').attr('data-num',1);
		 $('.changeLang li').eq(1).addClass('check');
	}
}
var cName = '';
var flagLang = true;

$('.changeLang li').on('click',function(){
		$(this).addClass('check').siblings().removeClass('check');
		$('.login-no').removeClass('direction');
		$('.bilibi-box>div').html('');
		$('.changeLang ul').hide();
	  	$('.changeLang .cbottom').attr('src','images/cbottom.png');
		if($(this).index()==0){
			sessionStorage.clang = 'cn';
			sessionStorage.clangn = 2;
	  	$('.L-En').hide();
	  	$('.L-Ar').hide();
	  	$('.L-Cn').show();
	  	$('title').html('Firefly Live-螢火蟲直播官網-See u in Firefly!');
	  	$('.changeLang span').text('繁體中文');
	  	$('.changeLang').attr('data-num',0);
	  	
		} else if($(this).index()==1){
			sessionStorage.clang = 'en'
			sessionStorage.clangn = 1;
			$('.L-Cn').hide();
			$('.L-Ar').hide();
			$('.L-En').show();
			$('title').html('Firefly Live-Live video streaming-See you in Firefly!');
			$('.changeLang span').text('English');
			$('.changeLang').attr('data-num',1);
	 } else if($(this).index()==2){
	 		sessionStorage.clang = 'ar'
			sessionStorage.clangn = 7;
			$('.L-Cn').hide();
			$('.L-En').hide();
			$('.L-Ar').show();
			$('.login-no').addClass('direction');
			$('title').html('Firefly Live-Live video streaming-See you in Firefly!');
			$('.changeLang span').text('العربية');
	   $('.changeLang').attr('data-num',2);
	 }
		if(sessionStorage.clang=='cn'){
			$('.login-no').removeClass('direction');
			cName = '.L-Cn';
			flagLang = true;
			$('title').html('Firefly Live-螢火蟲直播官網-See u in Firefly!');
		} else if(sessionStorage.clang == 'en'){
			$('.login-no').removeClass('direction');
			$('title').html('Firefly Live-Live video streaming-See you in Firefly!');
			cName = '.L-En';
			flagLang = false;
		} else if(sessionStorage.clang == 'ar'){
			$('.login-no').addClass('direction');
			$('title').html('Firefly Live-Live video streaming-See you in Firefly!');
			cName = '.L-Ar';
			flagLang = false;
		} else {
			$('.login-no').removeClass('direction');
			$('title').html('Firefly Live-Live video streaming-See you in Firefly!');
			cName = '.L-En';
			flagLang = false;
		}
})

$('.changeLang').hover(function(){
	$(this).find('ul').show();
	$(this).find('.cbottom').attr('src','images/ctop.png');
},function(){
	$(this).find('ul').hide();
	$(this).find('.cbottom').attr('src','images/cbottom.png');
	$('.changeLang li').eq($(this).attr('data-num')).addClass('check').siblings().removeClass('check');
})
$('.changeLang li').hover(function(){
	$(this).addClass('check').siblings().removeClass('check');
})
if(sessionStorage.clang=='cn'){
	cName = '.L-Cn';
	flagLang = true;
} else if(sessionStorage.clang == 'en'){
	cName = '.L-En';
	flagLang = false;
} else if(sessionStorage.clang == 'ar'){
	cName = '.L-Ar';
	flagLang = false;
} else {
	cName = '.L-En';
	flagLang = false;
}