44@inject Microsoft .AspNetCore .Authorization .IAuthorizationService authorization
55@model GamesListModel
66@{
7- ViewData [" Title" ] = " Game list" ;
7+ ViewData [" Title" ] = " ib: list.title " ;
88
99 HtmlHelpers .RenderHeaderSection (this , Url , commonUIConfigureOptions );
1010
1818
1919<div class =' container inkgames' >
2020 <div class =" table-responsive" >
21- <a href =' Home' class =' btn btn-outline-primary mt-4 m-sm-1' >Home</a >
21+ <a href =' Home' class =' btn btn-outline-primary mt-4 m-sm-1' data-i18n = ' ib:list.home ' >Home</a >
2222 <table class =' table game_tab' >
2323 <thead >
2424 <tr >
2525 <th scope =' row' >#</th >
26- <th scope =' col' >Player 1</th >
27- <th scope =' col' >Player 2</th >
28- <th scope =' col' >Game state</th >
29- <th scope =' col' >Action</th >
30- <th scope =' col' >Game type</th >
26+ <th scope =' col' data-i18n = ' ib:game.player1 ' >Player 1</th >
27+ <th scope =' col' data-i18n = ' ib:game.player2 ' >Player 2</th >
28+ <th scope =' col' data-i18n = ' ib:list.gameState ' >Game state</th >
29+ <th scope =' col' data-i18n = ' ib:list.action ' >Action</th >
30+ <th scope =' col' data-i18n = ' ib:list.gameType ' >Game type</th >
3131 </tr >
3232 </thead >
3333 <tbody >
5757 switch (game .GameState )
5858 {
5959 case InkBallGame .GameStateEnum .AWAITING :
60- < td class = 'fst-italic gtd' > waiting for another player < / td >
60+ < td class = 'fst-italic gtd' data - i18n = 'ib:list.waiting' > waiting for another player < / td >
6161 < td class = 'gtd' >
6262 @if (bIsMyOwnGame )
6363 {
64- < a href = 'Game' class = 'btn btn-outline-primary' > Continue < / a >
64+ < a href = 'Game' class = 'btn btn-outline-primary' data - i18n = 'ib:home.continue' > Continue < / a >
6565 }
6666 else if (! bIsCurrentGameOk )
6767 {
6868 < form method = 'post' >
6969 < input type = 'hidden' name = 'GameID' value = '@game.iId' / >
70- < input type = 'submit' name = 'action' value = 'Join' class = 'btn btn-outline-primary' / >
70+ < button type = 'submit' name = 'action' value = 'Join' class = 'btn btn-outline-primary' data - i18n = 'ib:list.join' > Join < / button >
7171 < / form >
7272 }
7373 < / td >
7474 break ;
7575
7676 case InkBallGame .GameStateEnum .ACTIVE :
77- < td class = 'fst-italic gtd' > game in progress < / td >
77+ < td class = 'fst-italic gtd' data - i18n = 'ib:list.inProgress' > game in progress < / td >
7878 < td class = 'gtd' >
7979 @if (bIsMyOwnGame )
8080 {
81- < a href = 'Game' class = " btn btn-outline-primary" > Continue < / a >
81+ < a href = 'Game' class = " btn btn-outline-primary" data - i18n = 'ib:home.continue' > Continue < / a >
8282 }
8383 else if (! bIsCurrentGameOk && bCanViewOtherPlayerGames )
8484 {
85- < a href = 'Game?handler=View&[email protected] ' > View only < / a > 85+ < a href = 'Game?handler=View&[email protected] ' data - i18n = 'ib:list.viewOnly' > View only < / a > 8686 }
8787 < / td >
8888 break ;
8989
9090 case InkBallGame .GameStateEnum .INACTIVE :
91- < td class = 'fst-italic gtd' colspan = " 2" > game inactive < / td >
91+ < td class = 'fst-italic gtd' colspan = " 2" data - i18n = 'ib:list.gameInactive' > game inactive < / td >
9292 break ;
9393 case InkBallGame .GameStateEnum .FINISHED :
94- < td class = 'fst-italic gtd' colspan = " 2" > game finished < / td >
94+ < td class = 'fst-italic gtd' colspan = " 2" data - i18n = 'ib:list.gameFinished' > game finished < / td >
9595 break ;
9696 default :
9797 throw new ArgumentNullException (nameof (game .GameState ), " bad game state" );
100100 switch (game .GameType )
101101 {
102102 case InkBallGame .GameTypeEnum .FIRST_5_ADVANTAGE_PATHS :
103- < td class = 'fst-italic gtd' > FIRST 5 ADVANTAGE PATHS < / td >
103+ < td class = 'fst-italic gtd' data - i18n = 'ib:list.gameTypes.advantageOf5' > FIRST 5 ADVANTAGE PATHS < / td >
104104 break ;
105105 case InkBallGame .GameTypeEnum .FIRST_5_CAPTURES :
106- < td class = 'fst-italic gtd' > FIRST 5 CAPTURES < / td >
106+ < td class = 'fst-italic gtd' data - i18n = 'ib:list.gameTypes.first5Captures' > FIRST 5 CAPTURES < / td >
107107 break ;
108108 case InkBallGame .GameTypeEnum .FIRST_5_PATHS :
109- < td class = 'fst-italic gtd' > FIRST 5 PATHS < / td >
109+ < td class = 'fst-italic gtd' data - i18n = 'ib:list.gameTypes.first5Paths' > FIRST 5 PATHS < / td >
110110 break ;
111111 case InkBallGame .GameTypeEnum .FIRST_CAPTURE :
112- < td class = 'fst-italic gtd' > FIRST CAPTURE < / td >
112+ < td class = 'fst-italic gtd' data - i18n = 'ib:list.gameTypes.firstCapture' > FIRST CAPTURE < / td >
113113 break ;
114114 default :
115115 throw new ArgumentNullException (nameof (game .GameType ), " bad game type" );
122122 {
123123 <tr >
124124 <td colspan =" 6" class =" h4 p-3 text-center gtd-nogame" >
125- <span >↓↓↓</span > No games , create below
125+ <span >↓↓↓</span > < span data-i18n = ' ib:list.noGamesCreate ' > No games , create below </ span >
126126 </td >
127127 </tr >
128128 }
133133 {
134134 <form method =' post' class =" was-validated" >
135135 <fieldset class =" g-3" >
136- <legend class =" col-sm-12 col-md-4 col-lg-4 col-xl-3" >New game creation </legend >
137- <div class =" row" role =" group" aria-label =" New game options" >
136+ <legend class =" col-sm-12 col-md-4 col-lg-4 col-xl-3" data-i18n = ' ib:list.newGameLeg ' >New game creation </legend >
137+ <div class =" row" role =" group" aria-label =" New game options" data-i18n = ' [aria-label]ib:list.newGameOpts ' >
138138 <div class =" col-sm-12 col-md-4 col-lg-4 col-xl-3" >
139139 <select name =' GameType' id =' GameType' class =" form-select" required >
140- <option value =' ' selected =' selected' >Choose game type </option >
141- <optgroup label =' Game types' >
142- <option value =' 0' >First capture wins </option >
143- <option value =' 1' >First 5 captures wins </option >
144- <option value =' 2' >First 5 paths wins </option >
145- <option value =' 3' >Advantage of 5 paths wins </option >
140+ <option value =' ' selected =' selected' data-i18n = ' ib:home.chooseGameType ' >Choose game type </option >
141+ <optgroup label =' Game types' data-i18n = ' [label]ib:home.gameTypes.name ' >
142+ <option value =' 0' data-i18n = ' ib:home.gameTypes.firstCapture ' >First capture wins </option >
143+ <option value =' 1' data-i18n = ' ib:home.gameTypes.first5Captures ' >First 5 captures wins </option >
144+ <option value =' 2' data-i18n = ' ib:home.gameTypes.first5Paths ' >First 5 paths wins </option >
145+ <option value =' 3' data-i18n = ' ib:home.gameTypes.advantageOf5 ' >Advantage of 5 paths wins </option >
146146 </optgroup >
147147 </select >
148- <div class =" invalid-feedback" >Invalid game type </div >
148+ <div class =" invalid-feedback" data-i18n = ' ib:home.chooseGameType ' >Invalid game type </div >
149149 </div >
150150 <div class =" col-sm-12 col-md-4 col-lg-4 col-xl-3" >
151151 <select name =' BoardSize' id =' BoardSize' class =" form-select" required >
152- <option value =' ' selected =' selected' >Choose board size </option >
153- <optgroup label =' Board sizes' >
152+ <option value =' ' selected =' selected' data-i18n = ' ib:home.boardSize.chooseBoardSize ' >Choose board size </option >
153+ <optgroup label =' Board sizes' data-i18n = ' [label]ib:home.boardSize.boardSizes ' >
154154 <option value =' 20' >20 x 26 </option >
155155 <option value =' 40' >40 x 52 </option >
156156 <option value =' 64' >64 x 64 </option >
157157 </optgroup >
158158 </select >
159- <div class =" invalid-feedback" >Invalid bard size </div >
159+ <div class =" invalid-feedback" data-i18n = ' ib:home.boardSize.chooseBoardSize ' >Invalid board size </div >
160160 </div >
161161 <div class =" col-sm-12 col-md-auto col-xl-3 form-check form-switch ps-2" >
162162 <input type =" checkbox" class =" form-check-input form-control-input mx-1" name =" CpuOponent" id =" CpuOponent" />
163- <label class =" form-check-label" for =" CpuOponent" >Play against CPU </label >
163+ <label class =" form-check-label" for =" CpuOponent" data-i18n = ' ib:home.playAgainstCPU ' >Play against CPU </label >
164164 </div >
165165 <div class =" col-sm-12 col-md-auto" >
166- <input type =' submit' name =' action' value =' New game' class =' btn btn-primary' / >
166+ <button type =' submit' name =' action' value =' New game' class =' btn btn-primary' data-i18n = ' ib:home.newGame ' > New game </ button >
167167 </div >
168168 </div >
169169 </fieldset >
174174<script type =' module' >
175175 import { ListOnLoad } from " @Url.Content(Constants.WwwIncludeInkballJS)" ;
176176
177- ListOnLoad ();
177+ ListOnLoad (' @Model.Message ' );
178178 </script >
0 commit comments