Changeset 73


Ignore:
Timestamp:
Feb 7, 2009, 12:58:56 AM (16 years ago)
Author:
george
Message:
  • Opraveno: Generování kódu $g pro rody v addonu, nadbytečné mezery u generované anglické části addonu a správný překlad odřádkování na symboly \r\n.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/addon/CzWoW/CzWoW.lua

    r61 r73  
    115115                Show_Status();
    116116        else
    117                 DEFAULT_CHAT_FRAME:AddMessage("/czwow quests - zaptne/vypne překládání questů");
    118                 DEFAULT_CHAT_FRAME:AddMessage("/czwow spells - zaptne/vypne překládání spells");
    119                 DEFAULT_CHAT_FRAME:AddMessage("/czwow books - zaptne/vypne překládání books");
    120                 DEFAULT_CHAT_FRAME:AddMessage("/czwow monsters - zaptne/vypne překládání monsters");
    121                 DEFAULT_CHAT_FRAME:AddMessage("/czwow npcs - zaptne/vypne překládání npcs");
    122                 DEFAULT_CHAT_FRAME:AddMessage("/czwow interface - zaptne/vypne překládání interface");
    123                 DEFAULT_CHAT_FRAME:AddMessage("/czwow combatlog - zaptne/vypne překládání combatlog");
     117                DEFAULT_CHAT_FRAME:AddMessage("/czwow quests - zapne/vypne překládání questů");
     118                DEFAULT_CHAT_FRAME:AddMessage("/czwow spells - zapne/vypne překládání spells");
     119                DEFAULT_CHAT_FRAME:AddMessage("/czwow books - zapne/vypne překládání books");
     120                DEFAULT_CHAT_FRAME:AddMessage("/czwow monsters - zapne/vypne překládání monsters");
     121                DEFAULT_CHAT_FRAME:AddMessage("/czwow npcs - zapne/vypne překládání npcs");
     122                DEFAULT_CHAT_FRAME:AddMessage("/czwow interface - zapne/vypne překládání interface");
     123                DEFAULT_CHAT_FRAME:AddMessage("/czwow combatlog - zapne/vypne překládání combatlog");
    124124                DEFAULT_CHAT_FRAME:AddMessage("/czwow show - zobrazit");
    125125        end
  • trunk/addon/make.php

    r61 r73  
    88*/
    99
     10// Replace special codes by lua functions
    1011function ReplaceVarInText($string)
    1112{
    1213  $string = str_replace('$N', '"..strlower(UnitName("player")).."', $string);
    1314  $string = str_replace('$n', '"..strlower(UnitName("player")).."', $string);
     15  $string = str_replace('$C', '"..strlower(UnitClass("player")).."', $string);
    1416  $string = str_replace('$c', '"..strlower(UnitClass("player")).."', $string);
    15   $string = str_replace('$C', '"..strlower(UnitClass("player")).."', $string);
    1617  $string = str_replace('$R', '"..strlower(UnitRace("player")).."', $string);
    1718  $string = str_replace('$r', '"..strlower(UnitRace("player")).."', $string);
     19  $Gender = '$G';
     20  while(strpos($string, $Gender) !== false)
     21  {
     22        $Before = substr($string, 0, strpos($string, $Gender));
     23        $Man = substr($string, strpos($string, $Gender) + 2);
     24        $Woman = substr($Man, strpos($Man, ':') + 1);
     25        $After = substr($Woman, strpos($Woman, ';') + 1);
     26        $Man = substr($Man, 0, strpos($Man, ':'));
     27        $Woman = substr($Woman, 0, strpos($Woman, ';'));
     28        $string = $Before.'"..gsub(gsub(UnitSex("player"), "^2$", "'.
     29          $Man.'"), "^3$", "'.$Woman.'").."'.$After;
     30  }
     31  $Gender = '$g';
     32  while(strpos($string, $Gender) !== false)
     33  {
     34        $Before = substr($string, 0, strpos($string, $Gender));
     35        $Man = substr($string, strpos($string, $Gender) + 2);
     36        $Woman = substr($Man, strpos($Man, ':') + 1);
     37        $After = substr($Woman, strpos($Woman, ';') + 1);
     38        $Man = substr($Man, 0, strpos($Man, ':'));
     39        $Woman = substr($Woman, 0, strpos($Woman, ';'));
     40        $string = $Before.'"..gsub(gsub(UnitSex("player"), "^2$", "'.$Man.'"), "^3$", "'.$Woman.'").."'.$After;
     41  }
    1842
    1943  $string = str_replace('$', '', $string);
    20   $string = str_replace(chr(13), '', $string);
    21   $string = str_replace(chr(10), '', $string);
     44  $string = str_replace("\r", '', $string);
     45  $string = str_replace("\n", '\r\n', $string);
    2246  return($string);     
    2347}
     
    2751  //    $string = mysql_escape_string($string);
    2852  $string = strtolower($string);
    29   $string = str_replace('$gman:woman;', '"..gsub(gsub(UnitSex("player"), "^2$", "man"), "^3$", "woman").."', $string);
    30   $string = str_replace('$g man : woman;', '"..gsub(gsub(UnitSex("player"), "^2$", "man"), "^3$", "woman").."', $string);
    31   $string = str_replace('$ghis:her;', '"..gsub(gsub(UnitSex("player"), "^2$", "his"), "^3$", "her").."', $string);
    32   $string = str_replace('$g his : her;', '"..gsub(gsub(UnitSex("player"), "^2$", "his"), "^3$", "her").."', $string);
    33   $string = str_replace('$glad:lass;', '"..gsub(gsub(UnitSex("lad"), "^2$", "his"), "^3$", "lass").."', $string);
    34   $string = str_replace('$g lad : lass;', '"..gsub(gsub(UnitSex("lad"), "^2$", "his"), "^3$", "lass").."', $string);
    35 
     53 
    3654  $string = str_replace('"', '\"', $string);
    3755  $string = str_replace('$b$b', ' ', $string); 
    3856  $string = str_replace('$b $b', ' ', $string);         
    3957  $string = str_replace('$b', ' ', $string);   
    40   $string = str_replace('  ', ' ', $string);
     58  while(strpos($string, '  '))
     59    $string = str_replace('  ', ' ', $string);
    4160  $string = ReplaceVarInText($string); 
    4261  return($string);
     
    144163  while($Line = mysql_fetch_array($DbResult))
    145164  {
    146     $Buffer .= 'f("'.addslashes($Line['id_text']).'", "'.addslashes($Line['Original']).'", "'.addslashes($Line['Translation']).'");'."\n";
     165    $Buffer .= 'f("'.addslashes($Line['id_text']).'", "'.str_replace("\n", '\r\\', addslashes($Line['Original'])).'", "'.str_replace("\n", '\r\\', addslashes($Line['Translation'])).'");'."\n";
    147166  }
    148167  file_put_contents($TempDir.'LocalizationStrings.lua', $Buffer);
  • trunk/sql/structure.sql

    r71 r73  
    2727  `File` int(11) NOT NULL default '0',
    2828  `Language` int(11) NOT NULL default '0',
    29   `Vote` float NOT NULL,
    30   `CountVote` int(11) NOT NULL,
    31   `User` int(11) NOT NULL,
    32   `Complete` int(11) NOT NULL,
    33   `Take` int(11) NOT NULL,
    34   `admin_check` int(11) NOT NULL,
     29  `User` int(11) NOT NULL,
     30  `Complete` int(11) NOT NULL,
     31  `Take` int(11) NOT NULL,
    3532  PRIMARY KEY  (`ID`),
    3633  KEY `entry` (`entry`),
     
    9491  `castbarcaption` varchar(255) NOT NULL,
    9592  `Language` int(11) NOT NULL default '0',
    96   `Vote` float NOT NULL,
    97   `CountVote` int(11) NOT NULL,
    98   `User` int(11) NOT NULL,
    99   `Complete` int(11) NOT NULL,
    100   `Take` int(11) NOT NULL,
    101   `admin_check` int(11) NOT NULL default '0',
     93  `User` int(11) NOT NULL,
     94  `Complete` int(11) NOT NULL,
     95  `Take` int(11) NOT NULL,
    10296  PRIMARY KEY  (`ID`),
    10397  KEY `entry` (`entry`),
     
    119113  `Text` text NOT NULL,
    120114  `Language` int(11) NOT NULL default '0',
    121   `Vote` float NOT NULL,
    122   `CountVote` int(11) NOT NULL,
    123   `User` int(11) NOT NULL,
    124   `Complete` int(11) NOT NULL,
    125   `Take` int(11) NOT NULL,
    126   `admin_check` int(11) NOT NULL default '0',
     115  `User` int(11) NOT NULL,
     116  `Complete` int(11) NOT NULL,
     117  `Take` int(11) NOT NULL,
    127118  PRIMARY KEY  (`ID`),
    128119  KEY `entry` (`entry`),
     
    180171  `Description` varchar(255) NOT NULL,
    181172  `Language` int(11) NOT NULL default '0',
    182   `Vote` float NOT NULL,
    183   `CountVote` int(11) NOT NULL,
    184   `User` int(11) NOT NULL,
    185   `Complete` int(11) NOT NULL,
    186   `Take` int(11) NOT NULL,
    187   `admin_check` int(11) NOT NULL default '0',
     173  `User` int(11) NOT NULL,
     174  `Complete` int(11) NOT NULL,
     175  `Take` int(11) NOT NULL,
    188176  PRIMARY KEY  (`ID`),
    189177  KEY `entry` (`entry`),
     
    209197  PRIMARY KEY  (`ID`),
    210198  KEY `user` (`user`)
    211 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=12925 ;
     199) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=12926 ;
    212200
    213201-- --------------------------------------------------------
     
    222210  `help` varchar(255) NOT NULL,
    223211  `Language` int(11) NOT NULL default '0',
    224   `Vote` float NOT NULL,
    225   `CountVote` int(11) NOT NULL,
    226   `User` int(11) NOT NULL,
    227   `Complete` int(11) NOT NULL,
    228   `Take` int(11) NOT NULL,
    229   `admin_check` int(11) NOT NULL default '0',
     212  `User` int(11) NOT NULL,
     213  `Complete` int(11) NOT NULL,
     214  `Take` int(11) NOT NULL,
    230215  PRIMARY KEY  (`ID`),
    231216  KEY `entry` (`entry`),
     
    247232  `content_default` varchar(255) NOT NULL,
    248233  `Language` int(11) NOT NULL default '0',
    249   `Vote` float NOT NULL,
    250   `CountVote` int(11) NOT NULL,
    251   `User` int(11) NOT NULL,
    252   `Complete` int(11) NOT NULL,
    253   `Take` int(11) NOT NULL,
    254   `admin_check` int(11) NOT NULL default '0',
     234  `User` int(11) NOT NULL,
     235  `Complete` int(11) NOT NULL,
     236  `Take` int(11) NOT NULL,
    255237  PRIMARY KEY  (`ID`),
    256238  KEY `entry` (`entry`),
     
    301283  `Text7_1` text character set latin2 collate latin2_czech_cs,
    302284  `Language` int(11) NOT NULL default '0',
    303   `Vote` float NOT NULL,
    304   `CountVote` int(11) NOT NULL,
    305   `User` int(11) NOT NULL,
    306   `Complete` int(11) NOT NULL,
    307   `Take` int(11) NOT NULL,
    308   `admin_check` int(11) NOT NULL default '0',
     285  `User` int(11) NOT NULL,
     286  `Complete` int(11) NOT NULL,
     287  `Take` int(11) NOT NULL,
    309288  PRIMARY KEY  (`ID`),
    310289  KEY `entry` (`entry`),
     
    326305  `Text` text character set latin2 collate latin2_czech_cs,
    327306  `Language` int(11) NOT NULL,
    328   `Vote` float NOT NULL,
    329   `CountVote` int(11) NOT NULL,
    330   `User` int(11) NOT NULL,
    331   `Complete` int(11) NOT NULL,
    332   `Take` int(11) NOT NULL,
    333   `admin_check` int(11) NOT NULL default '0',
     307  `User` int(11) NOT NULL,
     308  `Complete` int(11) NOT NULL,
     309  `Take` int(11) NOT NULL,
    334310  PRIMARY KEY  (`ID`),
    335311  KEY `entry` (`entry`),
     
    360336  `ObjectiveText4` text character set latin2 collate latin2_czech_cs NOT NULL,
    361337  `Language` int(11) NOT NULL default '1',
    362   `Vote` float NOT NULL default '0',
    363   `CountVote` int(11) NOT NULL,
    364338  `User` int(11) NOT NULL,
    365339  `Complete` int(11) NOT NULL default '1',
    366340  `Take` int(11) NOT NULL,
    367   `admin_check` int(11) NOT NULL default '0',
    368341  PRIMARY KEY  (`ID`),
    369342  KEY `entry` (`entry`),
     
    385358  `comment` text NOT NULL,
    386359  `Language` int(11) NOT NULL default '0',
    387   `Vote` float NOT NULL,
    388   `CountVote` int(11) NOT NULL,
    389   `User` int(11) NOT NULL,
    390   `Complete` int(11) NOT NULL,
    391   `Take` int(11) NOT NULL,
    392   `admin_check` int(11) NOT NULL default '0',
     360  `User` int(11) NOT NULL,
     361  `Complete` int(11) NOT NULL,
     362  `Take` int(11) NOT NULL,
    393363  PRIMARY KEY  (`ID`),
    394364  KEY `entry` (`entry`),
     
    411381  `comment` text NOT NULL,
    412382  `Language` int(11) NOT NULL default '0',
    413   `Vote` float NOT NULL,
    414   `CountVote` int(11) NOT NULL,
    415   `User` int(11) NOT NULL,
    416   `Complete` int(11) NOT NULL,
    417   `Take` int(11) NOT NULL,
    418   `admin_check` int(11) NOT NULL default '0',
     383  `User` int(11) NOT NULL,
     384  `Complete` int(11) NOT NULL,
     385  `Take` int(11) NOT NULL,
    419386  PRIMARY KEY  (`ID`),
    420387  KEY `entry` (`entry`),
     
    454421  `Description` text NOT NULL,
    455422  `Language` int(11) NOT NULL default '0',
    456   `Vote` float NOT NULL,
    457   `CountVote` int(11) NOT NULL,
    458   `User` int(11) NOT NULL,
    459   `Complete` int(11) NOT NULL,
    460   `Take` int(11) NOT NULL,
    461   `admin_check` int(11) NOT NULL default '0',
     423  `User` int(11) NOT NULL,
     424  `Complete` int(11) NOT NULL,
     425  `Take` int(11) NOT NULL,
    462426  PRIMARY KEY  (`ID`),
    463427  KEY `entry` (`entry`),
     
    467431  KEY `Complete` (`Complete`)
    468432) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=42088 ;
    469 
    470 -- --------------------------------------------------------
    471 
    472 --
    473 -- Struktura tabulky `tag`
    474 --
    475 
    476 CREATE TABLE IF NOT EXISTS `tag` (
    477   `ID` int(11) NOT NULL auto_increment,
    478   `type_translation` int(11) NOT NULL,
    479   `ID_translation` int(11) NOT NULL,
    480   `ID_user` int(11) NOT NULL,
    481   `tag` int(11) NOT NULL,
    482   PRIMARY KEY  (`ID`)
    483 ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=335 ;
    484433
    485434-- --------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.