Changeset 610
- Timestamp:
- Nov 26, 2013, 11:16:15 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/UpdateTrace.php
r608 r610 2639 2639 } 2640 2640 2641 function UpdateTo610($Manager) 2642 { 2643 $Manager->Execute('ALTER TABLE `Language` ADD `Default` INT NOT NULL , 2644 ADD `Code` VARCHAR( 255 ) NOT NULL ;'); 2645 $Manager->Execute('UPDATE `Language` SET `Default` = 1, 2646 `Code` = "en" WHERE `Language`.`Name` ="Angličitna";'); 2647 $Manager->Execute('UPDATE `Language` SET `Code` = "cs" WHERE `Language`.`Name` ="Čeština";'); 2648 $Manager->Execute('UPDATE `Language` SET `Code` = "sk" WHERE `Language`.`Name` ="Slovenština";'); 2649 } 2650 2651 2641 2652 $Updates = array( 2642 2653 498 => array('Revision' => 506, 'Function' => 'UpdateTo506'), … … 2652 2663 600 => array('Revision' => 604, 'Function' => 'UpdateTo604'), 2653 2664 604 => array('Revision' => 609, 'Function' => 'UpdateTo609'), 2665 609 => array('Revision' => 610, 'Function' => 'UpdateTo610'), 2654 2666 ); -
trunk/admin/index.php
r609 r610 95 95 96 96 $Locale->AnalyzeCode(dirname(dirname(__FILE__))); 97 $Locale->UpdateToDatabase($System->Database, 3);97 $Locale->UpdateToDatabase($System->Database, $Locale->Texts->Code); 98 98 $FileName = dirname(dirname(__FILE__)).'/locale/'.$Locale->Texts->Code.'.php'; 99 99 $Locale->SaveToFile($FileName); -
trunk/includes/Locale.php
r609 r610 108 108 } 109 109 110 function LoadFromDatabase($Database, $Lang uageId)110 function LoadFromDatabase($Database, $LangCode) 111 111 { 112 $this->Texts->Data = array(); 113 $DbResult = $Database->select('Locale', '`Original`, `Translated`', '`Language`='.$LanguageId * 1); 114 while($DbRow = $DbResult->fetch_assoc()) 115 $this->Texts->Data[$DbRow['Original']] = $DbRow['Translated']; 112 $DbResult = $Database->select('Language', '*', 'Code='.$Database->quote($LangCode)); 113 if($DbResult->num_rows > 0) 114 { 115 $Language = $DbResult->fetch_assoc(); 116 $this->Texts->Data = array(); 117 $DbResult = $Database->select('Locale', '`Original`, `Translated`', '`Language`='.$Language['Id']); 118 while($DbRow = $DbResult->fetch_assoc()) 119 $this->Texts->Data[$DbRow['Original']] = $DbRow['Translated']; 120 } 116 121 } 117 122 118 function SaveToDatabase(Database $Database, $Lang uageId)123 function SaveToDatabase(Database $Database, $LangCode) 119 124 { 120 $Database->delete('Locale', '`Language`='.$LanguageId * 1); 121 foreach($this->Texts->Data as $Index => $Item) 122 $Database->query('INSERT INTO `Locale` (`Language`,`Original`,`Translated`) '. 123 'VALUES('.$LanguageId.','.$Database->quote($Index).','.$Database->quote($Item).')'); 125 $DbResult = $Database->select('Language', '*', 'Code='.$Database->quote($LangCode)); 126 if($DbResult->num_rows > 0) 127 { 128 $Language = $DbResult->fetch_assoc(); 129 $Database->delete('Locale', '`Language`='.$Language['Id']); 130 foreach($this->Texts->Data as $Index => $Item) 131 $Database->query('INSERT INTO `Locale` (`Language`,`Original`,`Translated`) '. 132 'VALUES('.$Language['Id'].','.$Database->quote($Index).','.$Database->quote($Item).')'); 133 } 124 134 } 125 135 126 function UpdateToDatabase(Database $Database, $Lang uageId)136 function UpdateToDatabase(Database $Database, $LangCode) 127 137 { 128 foreach($this->Texts->Data as $Index => $Item) 129 { 130 $DbResult = $Database->select('Locale', '*', '`Original` ='.$Database->quote($Index)); 131 if($DbResult->num_rows > 0) 132 $Database->update('Locale', '(`Language`='.($LanguageId * 1).') AND '. 133 '(`Original` ='.$Database->quote($Index).')', array('Translated' => $Item)); 134 else $Database->insert('Locale', array('Language' => $LanguageId * 1, 135 'Original' => $Index, 'Translated' => $Item)); 136 } 138 $DbResult = $Database->select('Language', '*', 'Code='.$Database->quote($LangCode)); 139 if($DbResult->num_rows > 0) 140 { 141 $Language = $DbResult->fetch_assoc(); 142 foreach($this->Texts->Data as $Index => $Item) 143 { 144 $DbResult = $Database->select('Locale', '*', '(`Original` ='.$Database->quote($Index).') AND (`Language`='.($Language['Id']).')'); 145 if($DbResult->num_rows > 0) 146 $Database->update('Locale', '(`Language`='.($Language['Id']).') AND '. 147 '(`Original` ='.$Database->quote($Index).')', array('Translated' => $Item)); 148 else $Database->insert('Locale', array('Language' => $Language['Id'], 149 'Original' => $Index, 'Translated' => $Item)); 150 } 151 } 137 152 } 138 153 } -
trunk/includes/Version.php
r609 r610 6 6 // and system will need database update. 7 7 8 $Revision = 6 09; // Subversion revision9 $DatabaseRevision = 6 08; // Database structure revision8 $Revision = 610; // Subversion revision 9 $DatabaseRevision = 610; // Database structure revision 10 10 $ReleaseTime = '2013-11-26'; -
trunk/includes/system.php
r609 r610 39 39 ( 40 40 array( 41 'Title' => 'Soubory',41 'Title' => T('Files'), 42 42 'Hint' => 'Stahování různých pomocných souborů a programů', 43 43 'Link' => $this->Link('/download.php'), … … 46 46 ), 47 47 array( 48 'Title' => 'Pokyny',48 'Title' => T('Instructions'), 49 49 'Hint' => 'Informace k překladu hry', 50 50 'Link' => $this->Link('/info.php'), … … 53 53 ), 54 54 array( 55 'Title' => 'Zdroje dat',55 'Title' => T('Data source'), 56 56 'Hint' => 'Informace o překladových skupinách', 57 57 'Link' => $this->Link('/TranslationList.php?action=grouplist'), … … 60 60 ), 61 61 array( 62 'Title' => 'Prezentace',62 'Title' => T('Presentation'), 63 63 'Hint' => 'Prezentace a motivace překladu', 64 64 'Link' => $this->Link('/promotion.php'), … … 67 67 ), 68 68 array( 69 'Title' => 'IRC chat',69 'Title' => T('IRC chat'), 70 70 'Hint' => 'IRC chat pro překladatele', 71 71 'Link' => 'http://embed.mibbit.com/?server=game.zdechov.net%3A6667&channel=%23wowpreklad&forcePrompt=true&charset=utf-8', … … 74 74 ), 75 75 array( 76 'Title' => 'Správa',76 'Title' => T('Administration'), 77 77 'Hint' => 'Volby pro správu', 78 78 'Link' => $this->Link('/admin/'), … … 208 208 $this->ModuleManager->Modules['Log']->WriteLog('Stránka "'. 209 209 implode('/', $this->PathItems).'" nenalezena'.$Referer, LOG_TYPE_PAGE_NOT_FOUND); 210 return(ShowMessage( 'Stránka "'.implode('/', $this->PathItems).'" nenalezena.', MESSAGE_CRITICAL));210 return(ShowMessage(sprintf(T('Page "%s" not found'), implode('/', $this->PathItems)), MESSAGE_CRITICAL)); 211 211 } 212 212 … … 238 238 //$Team = $DbResult->fetch_assoc(); 239 239 //$Output .= ''<span class="MenuItem">Moje překlady: <a href="">Dokončené</a> <a href="">Rozpracované</a> <a href="">Exporty</a> Tým: <a href="">'.$Team['name'].'</a></span>'; 240 $Output .= '<span class="MenuItem2">'.$this->System->User->Name.' <a href="'.$this->System->Link('/?action=logout').'"> Odhlášení</a>'.240 $Output .= '<span class="MenuItem2">'.$this->System->User->Name.' <a href="'.$this->System->Link('/?action=logout').'">'.T('Logout').'</a>'. 241 241 ' <a href="'.$this->System->Link('/user.php?user='.$this->System->User->Id).'">'.T('My page').'</a>'. 242 242 ' <a href="'.$this->System->Link('/Options.php').'">'.T('Options').'</a>'. 243 243 ' <a title="Vámi přeložené texty" href="'.$this->System->Link('/TranslationList.php?user='. 244 $this->System->User->Id.'&group=0&state=2&text=&entry=').'"> Přeložené</a>'.244 $this->System->User->Id.'&group=0&state=2&text=&entry=').'">'.T('Translated').'</a>'. 245 245 ' <a title="Vaše rozpracované text" href="'.$this->System->Link('/TranslationList.php?user='. 246 $this->System->User->Id.'&group=0&state=3&text=&entry=').'"> Rozpracované</a>'.247 ' <a title="Nikým nepřeložené texty" href="'.$this->System->Link('/TranslationList.php?user=0&group=0&state=1&text=&entry=').'"> Nepřeložené</a>'.246 $this->System->User->Id.'&group=0&state=3&text=&entry=').'">'.T('Unfinished').'</a>'. 247 ' <a title="Nikým nepřeložené texty" href="'.$this->System->Link('/TranslationList.php?user=0&group=0&state=1&text=&entry=').'">'.T('Untranslated').'</a>'. 248 248 '</span>'; 249 249 } else … … 287 287 function ShowSearchBox() 288 288 { 289 $Output = '<strong> Hledání:</strong>'.289 $Output = '<strong>'.T('Search').':</strong>'. 290 290 '<form action="'.$this->System->Link('/search/').'" method="get"><div>'. 291 291 '<table>'. … … 294 294 '</tr>'. 295 295 '<tr>'. 296 '<th><input type="submit" value=" Hledat" /></th>'.296 '<th><input type="submit" value="'.T('Do search').'" /></th>'. 297 297 '</tr>'. 298 298 '</table></div>'. -
trunk/locale/cs.php
r609 r610 31 31 'Online translators' => 'Online překladatelé', 32 32 'Servers' => 'Servery', 33 'Logout' => 'Odhlášení', 34 'Translated' => 'Přeložené', 35 'Files' => 'Soubory', 36 'Instructions' => 'Pokyny', 37 'Data source' => 'Zdroje dat', 38 'Presentation' => 'Prezentace', 39 'IRC chat' => 'IRC chat', 40 'Administration' => 'Správa', 41 'Page "%s" not found' => 'Stránka "%s" nenalezena', 42 'Unfinished' => 'Rozpracované', 43 'Untranslated' => 'Nepřeložené', 44 'Search' => 'Vyhledávání', 45 'Do search' => 'Hledat', 33 46 ); 34 47 } -
trunk/locale/en.php
r609 r610 5 5 function Load() 6 6 { 7 $this->Code = ' cs';7 $this->Code = 'en'; 8 8 $this->Data = array( 9 9 'Access denied' => '',
Note:
See TracChangeset
for help on using the changeset viewer.