Changeset 843 for trunk/Modules/Translation
- Timestamp:
- Jan 14, 2016, 10:25:47 PM (9 years ago)
- Location:
- trunk/Modules/Translation
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Translation/Form.php
r836 r843 91 91 92 92 if(($Line['Language'] <> 0) and ($LineUser['Name'] <> '')) 93 $Output .= 'Přeložil: <a href="'.$this->System->Link('/user .php?user='.$Line['User']).'"><strong>'.$LineUser['Name'].'</strong></a> dne '.HumanDate($Line['ModifyTime']).'<br />';93 $Output .= 'Přeložil: <a href="'.$this->System->Link('/user/?user='.$Line['User']).'"><strong>'.$LineUser['Name'].'</strong></a> dne '.HumanDate($Line['ModifyTime']).'<br />'; 94 94 if(($Line['Take'] <> 0) and ($Line['Take'] <> $Line['ID'])) 95 95 { -
trunk/Modules/Translation/LoadNames.php
r816 r843 15 15 } else { 16 16 $Text = str_replace(' '.$orig,' <span Title="Přelož jako: '.$tran_replace. 17 '" class="edit"><a class="edit" target="_NEW2" href="'.$this->System->Link('/ dictionary/?search='.$tran).'">'.$orig_replace.'</a></span>',$Text);17 '" class="edit"><a class="edit" target="_NEW2" href="'.$this->System->Link('/'.T('dictionary', 'URL').'/?search='.$tran).'">'.$orig_replace.'</a></span>',$Text); 18 18 } 19 19 // } -
trunk/Modules/Translation/Translation.php
r842 r843 30 30 $this->System->RegisterPage('save.php', 'PageTranslationSave'); 31 31 $this->System->RegisterPage('progress', 'PageProgress'); 32 $this->System->RegisterPage('translation-groups', 'PageTranslationGroups'); 32 33 $this->System->RegisterPage('TranslationList.php', 'PageTranslationList'); 33 34 $this->System->RegisterPage('LoadNames.php', 'PageLoadNames'); … … 44 45 'Title' => T('Data source'), 45 46 'Hint' => 'Informace o překladových skupinách', 46 'Link' => $this->System->Link('/ TranslationList.php?action=grouplist'),47 'Link' => $this->System->Link('/translation-groups/'), 47 48 'Permission' => LICENCE_ANONYMOUS, 48 49 'Icon' => '', -
trunk/Modules/Translation/TranslationList.php
r842 r843 24 24 $Output = '<form action="?" method="post">'. 25 25 '<table class="BaseTable"><tr>'. 26 '<th> Zpracování</th>'.27 '<th> Skupina</th>'.28 '<th> Verze</th>'.29 '<th> Jazyk</th>'.30 '<th> Překladatel</th>'.31 '<th> Slova</th>'.32 '<th> Položka</th>'.26 '<th>'.T('Processing').'</th>'. 27 '<th>'.T('Group').'</th>'. 28 '<th>'.T('Version').'</th>'. 29 '<th>'.T('Language').'</th>'. 30 '<th>'.T('Translator').'</th>'. 31 '<th>'.T('Words').'</th>'. 32 '<th>'.T('Item').'</th>'. 33 33 '<th></th></tr><tr>'; 34 34 … … 37 37 $Output .= '<td><select name="state">'; 38 38 $StateTypes = array( 39 CompletionState::All => 'Všechny',40 CompletionState::NotTranslated => 'Nepřeložené',41 CompletionState::Translated => 'Přeložené',42 CompletionState::NotFinished => 'Rozpracované',43 CompletionState::Original => 'Anglické',44 CompletionState::NotFinishedNotTranslated => 'Rozpracované-Nepřeložené',45 CompletionState::Missing1 => 'Chybějící $ ($N,$s..)',46 CompletionState::Missing2 => 'Chybějící $-Neopravený'39 CompletionState::All => T('All'), 40 CompletionState::NotTranslated => T('Not translated'), 41 CompletionState::Translated => T('Translated'), 42 CompletionState::NotFinished => T('Unfinished'), 43 CompletionState::Original => T('Original'), 44 CompletionState::NotFinishedNotTranslated => T('Unfinished - Not translated'), 45 CompletionState::Missing1 => T('Missing $ ($N,$s..)'), 46 CompletionState::Missing2 => T('Missing $ - Not fixed'), 47 47 ); 48 foreach ($StateTypes as $index =>$StateType) {48 foreach ($StateTypes as $index => $StateType) { 49 49 if($Filter['State'] == $index) $Selected = ' selected="selected"'; 50 50 else $Selected = ''; … … 71 71 if($Filter['Group'] == 0) $Selected = ' selected="selected"'; 72 72 else $Selected = ''; 73 $Output .= '<option value="0"'.$Selected.'> Všechny</option>';73 $Output .= '<option value="0"'.$Selected.'>'.T('All').'</option>'; 74 74 $DbResult = $this->Database->query('SELECT `Id`,`Name` FROM `Group` ORDER BY `Name`'); 75 75 while($Group = $DbResult->fetch_assoc()) … … 97 97 if($Filter['Version'] == 0) $Selected = ' selected="selected"'; 98 98 else $Selected = ''; 99 $Output .= '<option value="0"'.$Selected.'> Všechny</option>';99 $Output .= '<option value="0"'.$Selected.'>'.T('All').'</option>'; 100 100 $DbResult = $this->Database->query('SELECT `Id`, `BuildNumber`,`Version` FROM `ClientVersion` WHERE `Imported` = 1 ORDER BY `BuildNumber` DESC'); 101 101 while($Version = $DbResult->fetch_assoc()) … … 136 136 if($Filter['User'] == 0) $Selected = ' selected="selected"'; 137 137 else $Selected = ''; 138 $Output .= '<option value="0"'.$Selected.'> Všichni</option>';138 $Output .= '<option value="0"'.$Selected.'>'.T('All').'</option>'; 139 139 $DbResult = $this->Database->query('SELECT `Id`, `Name` FROM `User` ORDER BY `Name`'); 140 140 while($User = $DbResult->fetch_assoc()) … … 238 238 */ 239 239 240 $Output .= '<td><input type="submit" value=" Filtrovat"/></td>';240 $Output .= '<td><input type="submit" value="'.T('Filter').'"/></td>'; 241 241 $Output .= '</tr></table>'; 242 242 $Output .= '</form><br/>'; … … 270 270 $Output .= $PageList['Output']; 271 271 $TableColumns = array( 272 array('Name' => 'ID', 'Title' => 'Číslo'),273 array('Name' => 'Entry', 'Title' => 'Položka'),274 array('Name' => $TranslationTree[$Filter['Group']]['Items'][0]['Column'], 'Title' => 'Název'),275 array('Name' => 'VersionStart', 'Title' => 'Verze od'),276 array('Name' => 'VersionEnd', 'Title' => 'Verze do'),277 array('Name' => 'LanguageName', 'Title' => 'Jazyk'),278 array('Name' => 'UserName', 'Title' => 'Překladatel'),279 array('Name' => 'ModifyTime', 'Title' => 'Datum'),272 array('Name' => 'ID', 'Title' => T('Number')), 273 array('Name' => 'Entry', 'Title' => T('Item')), 274 array('Name' => $TranslationTree[$Filter['Group']]['Items'][0]['Column'], 'Title' => T('Name')), 275 array('Name' => 'VersionStart', 'Title' => T('From version')), 276 array('Name' => 'VersionEnd', 'Title' => T('To version')), 277 array('Name' => 'LanguageName', 'Title' => T('Language')), 278 array('Name' => 'UserName', 'Title' => T('Translator')), 279 array('Name' => 'ModifyTime', 'Title' => T('Date')), 280 280 ); 281 281 … … 295 295 GetVersionWOWId($Line['VersionEnd'])).'">'.GetVersionWOW($Line['VersionEnd']).'</a></td>'. 296 296 '<td>'.$Line['LanguageName'].'</td>'. 297 '<td><a href=" user.php?user='.$Line['UserId'].'">'.$Line['UserName'].'</a></td>'.297 '<td><a href="'.$this->System->Link('/user/?user='.$Line['UserId']).'">'.$Line['UserName'].'</a></td>'. 298 298 '<td>'.HumanDate($Line['ModifyTime']).'</td>'. 299 299 '</tr>'; … … 310 310 $Output = $Filter['Output']; 311 311 312 $Output .= '<table class="BaseTable"><tr><th> Skupina</th><th>Počet</th></tr>';312 $Output .= '<table class="BaseTable"><tr><th>'.T('Group').'</th><th>'.T('Count').'</th></tr>'; 313 313 $Total = 0; 314 314 foreach($TranslationTree as $Group) … … 322 322 $Total += $Line[0]; 323 323 } 324 $Output .= '<tr><td><strong> Celkem</strong></td><td><strong>'.$Total.'</strong></td></tr>'.324 $Output .= '<tr><td><strong>'.T('Total').'</strong></td><td><strong>'.$Total.'</strong></td></tr>'. 325 325 '</table>'; 326 326 return($Output); 327 }328 329 function ShowGroupTypeList()330 {331 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `Group`');332 $DbRow = $DbResult->fetch_row();333 $PageList = GetPageList($DbRow[0]);334 $Output = '<h3>'.T('List of translation groups').'</h3>'.335 $PageList['Output'];336 337 $Output .= '<table class="BaseTable">';338 $TableColumns = array(339 array('Name' => 'Name', 'Title' => T('Name')),340 array('Name' => 'SourceType', 'Title' => T('Source type')),341 array('Name' => '', 'Title' => T('Sources')),342 array('Name' => 'LastImport', 'Title' => T('Date of last import')),343 array('Name' => 'LastVersion', 'Title' => T('Version of last import')),344 );345 if($this->System->User->Licence(LICENCE_ADMIN))346 $TableColumns[] = array('Name' => '', 'Title' => T('Actions'));347 348 $Order = GetOrderTableHeader($TableColumns, 'Name', 0);349 $Output .= $Order['Output'];350 351 $DbResult = $this->Database->query('SELECT * FROM `Group`'.$Order['SQL'].$PageList['SQLLimit']);352 while($Group = $DbResult->fetch_assoc())353 {354 $Output .= '<tr><td><a href="?group='.$Group['Id'].'&action=filter">'.$Group['Name'].'</a></td>'.355 '<td>'.$Group['SourceType'].'</td><td>';356 if($Group['MangosTable'] != '') $Output .= $Group['MangosTable'].'.sql ';357 if($Group['DBCFileName'] != '') $Output .= $Group['DBCFileName'].'.dbc ';358 if($Group['LuaFileName'] != '') $Output .= $Group['LuaFileName'].'.lua ';359 $Output .= '</td>';360 if($this->System->User->Licence(LICENCE_ADMIN))361 $Output .= '<td><a title="Změny po posledním importu u vybrané překladové skupiny" href="'.$this->System->Link('/log/?group='.362 $Group['Id'].'&type=11').'">'.HumanDate($Group['LastImport']).'</a></td>';363 else $Output .= '<td>'.HumanDate($Group['LastImport']).'</td>';364 $Output .= '<td><a href="'.$this->System->Link('/client-version/?action=item&id='.365 GetVersionWOWId($Group['LastVersion'])).'">'.GetVersionWOW($Group['LastVersion']).'</a></td>';366 if($this->System->User->Licence(LICENCE_ADMIN))367 $Output .= '<td><a href="?action=groupdelete&id='.$Group['Id'].'">'.T('Remove').'</a></td>';368 $Output .= '</tr>';369 370 }371 $Output .= '</table>'.372 '<br /><a title="'.T('Changelog of changes after import').'" href="'.$this->System->Link('/log/?type=11').'">'.T('Changelog of text modification during import').'</a><br/>';373 if($this->System->User->Licence(LICENCE_ADMIN)) $Output .= '<a href="?action=groupadd">'.T('Add translation group').'</a>';374 return($Output);375 327 } 376 328 … … 417 369 $Output .= '</table>'; 418 370 } 371 return($Output); 372 } 373 374 function Show() 375 { 376 $this->Title = T('Translation groups'); 377 $Action = GetParameter('action', ''); 378 if($Action == 'filter') $Output = $this->ShowMenu(); 379 else 380 { 381 $Filter = $this->ShowFilter(); 382 if($Filter['Group'] > 0) $Output = $this->ShowTranslationList($Filter); 383 else $Output = $this->ShowGroupList($Filter); 384 } 385 return($Output); 386 } 387 } 388 389 class PageTranslationGroups extends Page 390 { 391 function ShowList() 392 { 393 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `Group`'); 394 $DbRow = $DbResult->fetch_row(); 395 $PageList = GetPageList($DbRow[0]); 396 $Output = '<h3>'.T('List of translation groups').'</h3>'. 397 $PageList['Output']; 398 399 $Output .= '<table class="BaseTable">'; 400 $TableColumns = array( 401 array('Name' => 'Name', 'Title' => T('Name')), 402 array('Name' => 'SourceType', 'Title' => T('Source type')), 403 array('Name' => '', 'Title' => T('Sources')), 404 array('Name' => 'LastImport', 'Title' => T('Date of last import')), 405 array('Name' => 'LastVersion', 'Title' => T('Version of last import')), 406 ); 407 if($this->System->User->Licence(LICENCE_ADMIN)) 408 $TableColumns[] = array('Name' => '', 'Title' => T('Actions')); 409 410 $Order = GetOrderTableHeader($TableColumns, 'Name', 0); 411 $Output .= $Order['Output']; 412 413 $DbResult = $this->Database->query('SELECT * FROM `Group`'.$Order['SQL'].$PageList['SQLLimit']); 414 while($Group = $DbResult->fetch_assoc()) 415 { 416 $Output .= '<tr><td><a href="?group='.$Group['Id'].'&action=filter">'.$Group['Name'].'</a></td>'. 417 '<td>'.$Group['SourceType'].'</td><td>'; 418 if($Group['MangosTable'] != '') $Output .= $Group['MangosTable'].'.sql '; 419 if($Group['DBCFileName'] != '') $Output .= $Group['DBCFileName'].'.dbc '; 420 if($Group['LuaFileName'] != '') $Output .= $Group['LuaFileName'].'.lua '; 421 $Output .= '</td>'; 422 if($this->System->User->Licence(LICENCE_ADMIN)) 423 $Output .= '<td><a title="Změny po posledním importu u vybrané překladové skupiny" href="'.$this->System->Link('/log/?group='. 424 $Group['Id'].'&type=11').'">'.HumanDate($Group['LastImport']).'</a></td>'; 425 else $Output .= '<td>'.HumanDate($Group['LastImport']).'</td>'; 426 $Output .= '<td><a href="'.$this->System->Link('/client-version/?action=item&id='. 427 GetVersionWOWId($Group['LastVersion'])).'">'.GetVersionWOW($Group['LastVersion']).'</a></td>'; 428 if($this->System->User->Licence(LICENCE_ADMIN)) 429 $Output .= '<td><a href="?action=groupdelete&id='.$Group['Id'].'">'.T('Remove').'</a></td>'; 430 $Output .= '</tr>'; 431 } 432 $Output .= '</table>'. 433 '<br /><a title="'.T('Changelog of changes after import').'" href="'.$this->System->Link('/log/?type=11').'">'.T('Changelog of text modification during import').'</a><br/>'; 434 if($this->System->User->Licence(LICENCE_ADMIN)) $Output .= '<a href="?action=groupadd">'.T('Add translation group').'</a>'; 419 435 return($Output); 420 436 } … … 478 494 $Output = ShowMessage('Překladová skupina vytvořena', MESSAGE_INFORMATION); 479 495 } else $Output = ShowMessage('Překladová skupina '.$TableName.' již existuje', MESSAGE_CRITICAL); 480 $Output .= $this->Show GroupTypeList();496 $Output .= $this->ShowList(); 481 497 } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL); 482 498 return($Output); … … 497 513 } else $Output = ShowMessage('Překladová skupina nenalezena', MESSAGE_CRITICAL); 498 514 } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL); 499 $Output .= $this->Show GroupTypeList();515 $Output .= $this->ShowList(); 500 516 return($Output); 501 517 } … … 506 522 $Action = GetParameter('action', ''); 507 523 if($Action == 'filter') $Output = $this->ShowMenu(); 508 else if($Action == 'grouplist') $Output = $this->ShowGroupTypeList();509 524 else if($Action == 'groupadd') $Output = $this->ShowGroupAdd(); 510 525 else if($Action == 'groupdelete') $Output = $this->ShowGroupDelete(); 511 526 else if($Action == 'groupaddfinish') $Output = $this->ShowGroupAddFinish(); 512 else 513 { 514 $Filter = $this->ShowFilter(); 515 if($Filter['Group'] > 0) $Output = $this->ShowTranslationList($Filter); 516 else $Output = $this->ShowGroupList($Filter); 517 } 527 else $Output = $this->ShowList(); 518 528 return($Output); 519 529 }
Note:
See TracChangeset
for help on using the changeset viewer.