File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed
Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -411,9 +411,11 @@ var handleSearch = function (data) {
411411 clearInterval ( costTiming ) ;
412412 if ( document . getElementById ( 'type' ) . value != 'cograph' ) {
413413 let nums = document . getElementById ( "tbody" ) . rows . length ;
414- let msg = tr ( 'Find ' ) + nums + tr ( ' results.' ) ;
414+ // let msg = tr('Find ') + nums + tr(' results.');
415+ let msg = tr ( 'Find %1 results. ' ) . arg ( nums ) ;
415416 if ( costMsec >= 100 ) {
416- msg += tr ( '(Cost time: ' ) + costMsec / 1000 + tr ( 's)' ) ;
417+ msg += tr ( '(Cost time: %1 s)' ) . arg ( costMsec / 1000 ) ;
418+ // msg += tr('(Cost time: ') + costMsec / 1000 + tr('s)');
417419 }
418420 alertMsg ( 'success' , msg ) ;
419421 }
Original file line number Diff line number Diff line change @@ -42,9 +42,7 @@ var strings = {
4242 "Save successfully, please go to the index file directory to view." : "保存成功,请前往索引文件目录查看。" ,
4343 "Save failed!" : "保存失败!" ,
4444 "The number of k-cliques" : "k阶完全子图的个数" ,
45- "Find " : "找到" ,
46- " results." : "条结果。" ,
47- "(Cost time: " : "(用时:" ,
48- "s)" : "秒)" ,
4945 "keyWord(s)" : "关键词" ,
46+ "Find %1 results. " : "找到 %1 条结果。" ,
47+ "(Cost time: %1 s)" : "(用时:%1 秒)"
5048} ;
Original file line number Diff line number Diff line change 1+ String . prototype . arg = function ( ) {
2+ let args = [ ] . slice . call ( arguments , 0 ) ;
3+ if ( args . length == 1 && typeof args [ 0 ] == "object" ) {
4+ return this . replace ( / \{ ( \w + ) \} / g, function ( match , cap ) {
5+ return args [ 0 ] [ cap ] || match ;
6+ } ) ;
7+ }
8+ return this . replace ( / \% ( \d + ) / g, function ( match , cap ) {
9+ return String ( args [ cap - 1 ] ) || match ;
10+ } ) ;
11+ }
12+
113function $ ( s ) {
214 if ( s [ 0 ] == '#' ) {
315 return document . getElementById ( s . substr ( 1 ) ) ;
You can’t perform that action at this time.
0 commit comments