@@ -81,8 +81,8 @@ <h2 class="txt-center">
8181 < i class ="ion-android-sync spinner fontSize30 spinner-with-logo-icon "> </ i >
8282 </ div >
8383 < div class ="width100 positionTop ">
84- < a class ="btn btn-txt rowTop10 marginRight10 pull-right js-indexReload "> < i class ="ion-android-sync "> </ i > < span class ="js-translate "> Reload</ span > </ a >
85- < a class ="btn btn-txt rowTop10 marginRight10 pull-right " href ="#home "> < i class ="ion-home "> </ i > < span class ="js-translate "> LoadIndex</ span > </ a >
84+ < a class ="btn btn-txt rowTop10 marginRight10 pull-right js-indexReload "> < i class ="ion-android-sync "> </ i > < span class ="js-translate " data-translate =" Reload " > </ span > </ a >
85+ < a class ="btn btn-txt rowTop10 marginRight10 pull-right " href ="#home "> < i class ="ion-home "> </ i > < span class ="js-translate " data-translate =" LoadIndex " > </ span > </ a >
8686 </ div >
8787 </ div >
8888
@@ -92,6 +92,13 @@ <h2 class="txt-center">
9292 < script >
9393 var app = require ( './js/main' ) ,
9494 remote = require ( 'remote' ) ;
95+
96+ window . translateIndex = function ( ) {
97+ $ ( '.js-translate' ) . each ( function ( ) {
98+ $ ( this ) . text ( polyglot . t ( $ ( this ) . data ( "translate" ) ) ) ;
99+ } ) ;
100+ } ;
101+ translateIndex ( ) ;
95102 $ ( '.js-closeIndexModal' ) . on ( 'click' , function ( ) {
96103 $ ( this ) . closest ( '.modal' ) . addClass ( 'hide' ) ;
97104 } ) ;
@@ -114,10 +121,6 @@ <h2 class="txt-center">
114121 $ ( '.js-defaultServerIndexApp' ) . on ( 'click' , function ( ) {
115122 app . loadNewServer ( "http://localhost:18469/api/v1/" ) ;
116123 } ) ;
117- $ ( '.js-translate' ) . each ( function ( ) {
118- var translationKey = $ ( this ) . html ( ) ;
119- $ ( this ) . replaceWith ( polyglot . t ( translationKey ) ) ;
120- } ) ;
121124 </ script >
122125</ body >
123126</ html >
0 commit comments