Changeset 74


Ignore:
Timestamp:
Feb 7, 2009, 2:36:39 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Generování souboru CzWoW.lua v addonu přímo skriptem.
  • Přidáno: Generování víc souborů stejného názvu u addonů s číselným indexem.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/addon/make.php

    r73 r74  
    7676 
    7777  $CreatedFileList = array();
     78  $CreatedFileListCount = array();
    7879 
    7980  $WhereLang = '';
     
    9899        if($Column['AddonFileName'] != '')     
    99100        {
    100       $FileName = $TempDir.$Column['AddonFileName'].'_1.lua';
     101      if(!isset($CreatedFileListCount[$Column['AddonFileName']]))
     102            $CreatedFileListCount[$Column['AddonFileName']] = 0;
     103          $CreatedFileListCount[$Column['AddonFileName']]++;
     104          $FileIndex = $CreatedFileListCount[$Column['AddonFileName']];
     105         
     106          $CreatedFileList[] = $Column['AddonFileName'].'_'.$FileIndex;
     107      $FileName = $TempDir.$Column['AddonFileName'].'_'.$FileIndex.'.lua';
    101108      echo($Column['AddonFileName'].': ');
    102109      $i = 0;
    103110
    104111      $Buffer = 'CZWOW_'.$Column['AddonFileName'].
    105             '_count=1; CZWOW_'.$Column['AddonFileName'].'_1={';   
     112            '_count='.$FileIndex.'; CZWOW_'.$Column['AddonFileName'].'_'.$FileIndex.'={';         
    106113   
    107114      $Query = 'SELECT T2.'.$Column['Column'].' AS Translation, T3.'.$Column['Column'].' as Original FROM (SELECT T1.entry, T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$WhereLang.' AND '.$WhereUsers.' ORDER BY FIELD(User, '.$SelectedUsers.')) AS T1 GROUP BY T1.entry) as T2 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language = 0)';
     
    120127      $Buffer = $Buffer."\n};if not CZWOW_".$Column['AddonFileName']." then CZWOW_".$Column['AddonFileName']."=0; end; CZWOW_".$Column['AddonFileName']."=CZWOW_".$Column['AddonFileName']."+".$i.";\n";
    121128
    122       if($i > 0)
    123           {
    124             file_put_contents($FileName, $Buffer);
    125                 $CreatedFileList[] = $Column['AddonFileName'].'_1';
    126         echo('<b>Hotovo</b><br />');
    127       } else echo('<b>Prázdné</b><br />');
     129          file_put_contents($FileName, $Buffer);
     130      echo('<b>Hotovo</b><br />');
    128131        }
    129132  }
     
    181184local old_GossipFrameUpdate;
    182185local oldTooltipText;
    183 TranslateWOW_EnableQuests=true;
    184 TranslateWOW_EnableSpells=true;
    185 TranslateWOW_EnableBooks=true;
    186 TranslateWOW_EnableCreatures=true;
    187 TranslateWOW_EnableNPCs=true;
    188 TranslateWOW_EnableInterface=true;
    189 TranslateWOW_EnableCombatLog=true;
     186CZWOW_EnableQuests=true;
     187CZWOW_EnableSpells=false;
     188CZWOW_EnableBooks=true;
     189CZWOW_EnableCreatures=false;
     190CZWOW_EnableNPCs=true;
     191CZWOW_EnableInterface=true;
     192CZWOW_EnableCombatLog=false;
    190193local oldClassTrainerSkillDescription;
    191194local oldClassTrainerGreetingText;
     
    207210end
    208211
    209 TranslateWoW_OnLoad=function()
    210         SLASH_TranslateWOW1="/twow";
    211         SlashCmdList["TrabslateWOW"]=TranslateWoW_CMD;
     212CzWoW_OnLoad=function()
     213        SLASH_CZWOW1="/czwow";
     214        SlashCmdList["CZWOW"]=CzWoW_CMD;
    212215        this:RegisterEvent("VARIABLES_LOADED");
    213         local a="Příjemné hraní s přeloženým. Pomoct na překladu můžete na stránkách: http://wowpreklad.zdechov.net/ ";
    214 ';
    215 foreach($CreatedFileList as $FileName)
    216 {
    217   $Buffer .= '  if TranslateWOW_'.$FileName.' then a=a..TranslateWOW_'.$FileName.'.." načteno ";end
    218         if not TranslateWOW_Enable'.$FileName.' then a=a.."'.$FileName.' nejsou povoleny, ";end
    219 ';
    220 }
    221 $Buffer .='
    222         DEFAULT_CHAT_FRAME:AddMessage("TranslateWoW načteno. "..a);
    223         if TranslateWOW_disableforthischar then DEFAULT_CHAT_FRAME:AddMessage("|c00ff0000 Příjemné hraní s přeloženým wow. Pomoct na překladu můžete na stránkách: http://wowpreklad.zdechov.net/|r");end
    224 end
    225 
    226 TranslateWoW_OnEvent=function(event)
    227         if type(TranslateWOW_LocalizeCombatLog)=="function" then TranslateWOW_LocalizeCombatLog() end
    228         if type(TranslateWOW_LocalizeInterface)=="function" then TranslateWOW_LocalizeInterface() end
     216        local a="Příjemné hraní s českým wow. Pomoct na překladu můžete na stránkách: http://wowpreklad.zdechov.net/ ";
     217        if CZWOW_QuestObjective then a=a..CZWOW_QuestObjective.." načteno ";end
     218        if not CZWOW_EnableQuests then a=a.."questy nejsou povoleny, ";end
     219        if CZWOW_SpellDescription then a=a..CZWOW_SpellDescription.." načteno ";end
     220        if not CZWOW_EnableSpells then a=a.."kouzla nejsou povolena, ";end
     221        if CZWOW_BookPage then a=a..CZWOW_BookPage.." načteno ";end
     222        if not CZWOW_EnableBooks then a=a.."texty knížek nejsou povoleny, ";end
     223        if CZWOW_Creature then a=a..CZWOW_Creature.." načteno ";end
     224        if not CZWOW_EnableCreatures then a=a.."texty příšer nejsou povoleny, ";end
     225        if CZWOW_NPCText then a=a..CZWOW_NPCText.." načteno NPC. ";end
     226        if not CZWOW_EnableNPCs then a=a.."npc texty nejsou povoleny, ";end
     227        DEFAULT_CHAT_FRAME:AddMessage("CzWoW načteno. "..a);
     228        if CZWOW_disableforthischar then DEFAULT_CHAT_FRAME:AddMessage("|c00ff0000 Příjemné hraní s českým wow. Pomoct na překladu můžete na stránkách: http://wowpreklad.zdechov.net/|r");end
     229end
     230
     231CzWoW_OnEvent=function(event)
     232        if type(CZWOW_LocalizeCombatLog)=="function" then CZWOW_LocalizeCombatLog() end
     233        if type(CZWOW_LocalizeInterface)=="function" then CZWOW_LocalizeInterface() end
    229234end
    230235abc=strchar(82, 117, 87, 111, 87);
     
    232237
    233238   
    234 local TranslateWoW_Update_Texts=function()
     239local CzWoW_Update_Texts=function()
    235240        if QuestFrameProgressPanel:IsVisible() then QuestFrameProgressPanel_OnShow(); end
    236241        if QuestFrameRewardPanel:IsVisible() then QuestFrameRewardPanel_OnShow(); end
     
    242247local Show_Status=function()
    243248        local a="";
    244         if not TranslateWOW_EnableQuests then a=a.."questy nejsou povoleny. "; else a=a.."questy jsou povoleny. "end
    245         if not TranslateWOW_EnableSpells then a=a.."kouzla nejsou povoleny. "; else a=a.."kouzla jsou povoleny. "end
    246         if not TranslateWOW_EnableBooks then a=a.."texty knížek nejsou povoleny "; else a=a.."texty knížek jsou povoleny "end
    247         if not TranslateWOW_EnableCreatures then a=a.."texty příšer nejsou povoleny "; else a=a.."texty příšer jsou povoleny "end
    248         if not TranslateWOW_EnableNPCs then a=a.."Npc texty nejsou povoleny "; else a=a.."Npc texty jsou povoleny "end
    249         if not TranslateWOW_EnableInterface then a=a.."prostředí není povoleno "; else a=a.."prostředí je povoleno "end
    250         if not TranslateWOW_EnableCombatLog then a=a.."CombatLog není povolen "; else a=a.."CombatLog je povolen "end
     249        if not CZWOW_EnableQuests then a=a.."questy nejsou povoleny. "; else a=a.."questy jsou povoleny. "end
     250        if not CZWOW_EnableSpells then a=a.."kouzla nejsou povoleny. "; else a=a.."kouzla jsou povoleny. "end
     251        if not CZWOW_EnableBooks then a=a.."texty knížek nejsou povoleny "; else a=a.."texty knížek jsou povoleny "end
     252        if not CZWOW_EnableCreatures then a=a.."texty příšer nejsou povoleny "; else a=a.."texty příšer jsou povoleny "end
     253        if not CZWOW_EnableNPCs then a=a.."Npc texty nejsou povoleny "; else a=a.."Npc texty jsou povoleny "end
     254        if not CZWOW_EnableInterface then a=a.."prostředí není povoleno "; else a=a.."prostředí je povoleno "end
     255        if not CZWOW_EnableCombatLog then a=a.."CombatLog není povolen "; else a=a.."CombatLog je povolen "end
    251256        DEFAULT_CHAT_FRAME:AddMessage(a);
    252257end
    253258
    254259abc=abc..strchar(100+16);
    255 TranslateWoW_CMD=function(msg)
     260CzWoW_CMD=function(msg)
    256261        if msg=="quests" then
    257                 TranslateWOW_EnableQuests=not TranslateWOW_EnableQuests;
    258                 TranslateWoW_Update_Texts();
     262                CZWOW_EnableQuests=not CZWOW_EnableQuests;
     263                CzWoW_Update_Texts();
    259264                Show_Status();
    260265        elseif msg=="spells" then
    261                 TranslateWOW_EnableSpells=not TranslateWOW_EnableSpells;
     266                CZWOW_EnableSpells=not CZWOW_EnableSpells;
    262267                oldTooltipText="";
    263268                oldClassTrainerSkillDescription="";
     
    265270                Show_Status();
    266271        elseif msg=="books" then
    267                 TranslateWOW_EnableBooks=not TranslateWOW_EnableBooks;
     272                CZWOW_EnableBooks=not CZWOW_EnableBooks;
    268273                ItemTextFrame_OnEvent("ITEM_TEXT_READY");
    269274                Show_Status();
    270275        elseif msg=="creatures" then
    271                 TranslateWOW_EnableCreatures=not TranslateWOW_EnableCreatures;
     276                CZWOW_EnableCreatures=not CZWOW_EnableCreatures;
    272277                Show_Status();
    273278        elseif msg=="npcs" then
    274                 TranslateWOW_EnableNPCs=not TranslateWOW_EnableNPCs;
     279                CZWOW_EnableNPCs=not CZWOW_EnableNPCs;
    275280                GossipFrameUpdate();
    276281                Show_Status();
    277282        elseif msg=="interface" then
    278                 TranslateWOW_EnableInterface=not TranslateWOW_EnableInterface;
    279                 TranslateWOW_LocalizeInterface();
     283                CZWOW_EnableInterface=not CZWOW_EnableInterface;
     284                CZWOW_LocalizeInterface();
    280285                Show_Status();
    281286        elseif msg=="combatlog" then
    282                 TranslateWOW_EnableCombatLog=not TranslateWOW_EnableCombatLog;
    283                 TranslateWOW_LocalizeCombatLog();
     287                CZWOW_EnableCombatLog=not CZWOW_EnableCombatLog;
     288                CZWOW_LocalizeCombatLog();
    284289                Show_Status();
    285290        elseif msg=="show" then
    286291                Show_Status();
    287292        else
    288                 DEFAULT_CHAT_FRAME:AddMessage("/twow quests - zapne/vypne překládání questů");
    289                 DEFAULT_CHAT_FRAME:AddMessage("/twow spells - zapne/vypne překládání spells");
    290                 DEFAULT_CHAT_FRAME:AddMessage("/twow books - zapne/vypne překládání books");
    291                 DEFAULT_CHAT_FRAME:AddMessage("/twow monsters - zapne/vypne překládání monsters");
    292                 DEFAULT_CHAT_FRAME:AddMessage("/twow npcs - zapne/vypne překládání npcs");
    293                 DEFAULT_CHAT_FRAME:AddMessage("/twow interface - zapne/vypne překládání interface");
    294                 DEFAULT_CHAT_FRAME:AddMessage("/twow combatlog - zapne/vypne překládání combatlog");
    295                 DEFAULT_CHAT_FRAME:AddMessage("/twow show - zobrazit"); end
     293                DEFAULT_CHAT_FRAME:AddMessage("/czwow quests - zapne/vypne překládání questů");
     294                DEFAULT_CHAT_FRAME:AddMessage("/czwow spells - zapne/vypne překládání spells");
     295                DEFAULT_CHAT_FRAME:AddMessage("/czwow books - zapne/vypne překládání books");
     296                DEFAULT_CHAT_FRAME:AddMessage("/czwow monsters - zapne/vypne překládání monsters");
     297                DEFAULT_CHAT_FRAME:AddMessage("/czwow npcs - zapne/vypne překládání npcs");
     298                DEFAULT_CHAT_FRAME:AddMessage("/czwow interface - zapne/vypne překládání interface");
     299                DEFAULT_CHAT_FRAME:AddMessage("/czwow combatlog - zapne/vypne překládání combatlog");
     300                DEFAULT_CHAT_FRAME:AddMessage("/czwow show - zobrazit");
     301        end
    296302end
    297303abc=abc..strchar(100+14);
     
    299305local SpellTranslate=function(text)
    300306        if type(text)~="string" then return nil end
    301         local Translate;
     307        local cz;
    302308        local text1=text;
    303309        local text2="";
     
    322328       
    323329        text=trim(text);
    324         if TranslateWOW_EnableSpells and type(TranslateWOW_SpellDescription_count)=="number" then               
    325                 for i=1, TranslateWOW_SpellDescription_count, 1 do
    326                         if  type(getglobal("TranslateWOW_SpellDescription_"..i))=="table" and getglobal("TranslateWOW_SpellDescription_"..i)[text] then
    327                                 Translate=prepare(getglobal("TranslateWOW_SpellDescription_"..i)[text]);
    328                         end
    329                 end
    330         end
    331         if TranslateWOW_EnableSpells and type(TranslateWOW_SpellBufDescription_count)=="number" then
    332                 for i=1, TranslateWOW_SpellBufDescription_count, 1 do
    333                         if  type(getglobal("TranslateWOW_SpellBufDescription_"..i))=="table" and getglobal("TranslateWOW_SpellBufDescription_"..i)[text] then
    334                                 Translate=prepare(getglobal("TranslateWOW_SpellBufDescription_"..i)[text]);
    335                         end
    336                 end
    337         end
    338         if bool and Translate then Translate=text2.." "..Translate end
    339         return Translate;
     330        if CZWOW_EnableSpells and type(CZWOW_SpellDescription_count)=="number" then             
     331                for i=1, CZWOW_SpellDescription_count, 1 do
     332                        if  type(getglobal("CZWOW_SpellDescription_"..i))=="table" and getglobal("CZWOW_SpellDescription_"..i)[text] then
     333                                cz=prepare(getglobal("CZWOW_SpellDescription_"..i)[text]);
     334                        end
     335                end
     336        end
     337        if CZWOW_EnableSpells and type(CZWOW_SpellBufDescription_count)=="number" then
     338                for i=1, CZWOW_SpellBufDescription_count, 1 do
     339                        if  type(getglobal("CZWOW_SpellBufDescription_"..i))=="table" and getglobal("CZWOW_SpellBufDescription_"..i)[text] then
     340                                cz=prepare(getglobal("CZWOW_SpellBufDescription_"..i)[text]);
     341                        end
     342                end
     343        end
     344        if bool and cz then cz=text2.." "..cz end
     345        return cz;
    340346end
    341347abc=abc..strchar(100+15);
     
    365371end
    366372
    367 TranslateWOW_GameTooltip_OnUpdate=function()
    368         if TranslateWOW_EnableSpells or TranslateWOW_EnableInterface then
     373CZWOW_GameTooltip_OnUpdate=function()
     374        if CZWOW_EnableSpells or CZWOW_EnableInterface then
    369375                local a=GetTooltipText();
    370376                if a~=oldTooltipText then
     
    374380                                local translate=nil;
    375381                                text=getglobal("GameTooltipTextLeft"..i):GetText();
    376                                 if TranslateWOW_EnableSpells then
     382                                if CZWOW_EnableSpells then
    377383                                        translate=SpellTranslate(text);
    378384                                end;
    379                                 if TranslateWOW_EnableInterface and TranslateWOW_Interface and TranslateWOW_Interface[text] then
    380                                         translate=TranslateWOW_Interface[text];
     385                                if CZWOW_EnableInterface and CZWOW_Interface and CZWOW_Interface[text] then
     386                                        translate=CZWOW_Interface[text];
    381387                                end
    382388                                if translate then
     
    395401end
    396402
    397 TranslateWOW_OnLoad1=function(event)
     403CZWOW_OnLoad1=function(event)
    398404end
    399405
    400406local NPCTextTranslate=function(en)
    401         if TranslateWOW_EnableNPCs and type(TranslateWOW_NPCText_count)=="number" then
     407        if CZWOW_EnableNPCs and type(CZWOW_NPCText_count)=="number" then
    402408                en=trim(en);
    403                 for i=1, TranslateWOW_NPCText_count, 1 do
    404                         if type(getglobal("TranslateWOW_NPCText_"..i))=="table" and getglobal("TranslateWOW_NPCText_"..i)[en] then
    405                                 return prepare(getglobal("TranslateWOW_NPCText_"..i)[en])
     409                for i=1, CZWOW_NPCText_count, 1 do
     410                        if type(getglobal("CZWOW_NPCText_"..i))=="table" and getglobal("CZWOW_NPCText_"..i)[en] then
     411                                return prepare(getglobal("CZWOW_NPCText_"..i)[en])
    406412                        end
    407413                end
     
    410416end
    411417
    412 TranslateWOW_OnUpdate=function()
    413         if TranslateWOW_EnableSpells and ClassTrainerFrame and ClassTrainerFrame:IsVisible() and ClassTrainerGreetingText and ClassTrainerSkillDescription and (oldClassTrainerSkillDescription~=ClassTrainerSkillDescription:GetText() or oldClassTrainerGreetingText~=ClassTrainerGreetingText:GetText()) then
     418CZWOW_OnUpdate=function()
     419        if CZWOW_EnableSpells and ClassTrainerFrame and ClassTrainerFrame:IsVisible() and ClassTrainerGreetingText and ClassTrainerSkillDescription and (oldClassTrainerSkillDescription~=ClassTrainerSkillDescription:GetText() or oldClassTrainerGreetingText~=ClassTrainerGreetingText:GetText()) then
    414420                oldClassTrainerSkillDescription=ClassTrainerSkillDescription:GetText();
    415421                oldClassTrainerGreetingText=ClassTrainerGreetingText:GetText();
    416422                if ClassTrainerGreetingText:GetText() then
    417                         local Translate=NPCTextTranslate(ClassTrainerGreetingText:GetText());
    418                         if Translate then ClassTrainerGreetingText:SetText(Translate) end
     423                        local cz=NPCTextTranslate(ClassTrainerGreetingText:GetText());
     424                        if cz then ClassTrainerGreetingText:SetText(cz) end
    419425                end
    420426                if ClassTrainerSkillDescription:GetText() then
    421                         local Translate=SpellTranslate(ClassTrainerSkillDescription:GetText());
    422                         if Translate then ClassTrainerSkillDescription:SetText(Translate) end
     427                        local cz=SpellTranslate(ClassTrainerSkillDescription:GetText());
     428                        if cz then ClassTrainerSkillDescription:SetText(cz) end
    423429                end
    424430        end;
     
    434440
    435441ChatFrame_OnEvent=function(event)
    436         if (event=="CHAT_MSG_MONSTER_SAY" or event=="CHAT_MSG_MONSTER_EMOTE") and TranslateWOW_EnableCreatures and type(TranslateWOW_Creature_count)=="number" then
     442        if (event=="CHAT_MSG_MONSTER_SAY" or event=="CHAT_MSG_MONSTER_EMOTE") and CZWOW_EnableCreatures and type(CZWOW_Creature_count)=="number" then
    437443                local en=trim(arg1);
    438                 for i=1, TranslateWOW_Creature_count, 1 do
    439                         if type(getglobal("TranslateWOW_Creature_"..i))=="table" and getglobal("TranslateWOW_Creature_"..i)[en] then
    440                                 arg1=prepare(getglobal("TranslateWOW_Creature_"..i)[en]);
     444                for i=1, CZWOW_Creature_count, 1 do
     445                        if type(getglobal("CZWOW_Creature_"..i))=="table" and getglobal("CZWOW_Creature_"..i)[en] then
     446                                arg1=prepare(getglobal("CZWOW_Creature_"..i)[en]);
    441447                        end
    442448                end
     
    447453QuestFrameDetailPanel_OnShow=function()
    448454        old_QuestFrameDetailPanel_OnShow();
    449         if TranslateWOW_EnableQuests and type(TranslateWOW_QuestObjective_count)=="number" and type(TranslateWOW_QuestDescription_count)=="number" then
     455        if CZWOW_EnableQuests and type(CZWOW_QuestObjective_count)=="number" and type(CZWOW_QuestDescription_count)=="number" then
    450456                local questObjectives=trim(GetObjectiveText());
    451457                local questDescription=trim(GetQuestText());
    452                 for i=1, TranslateWOW_QuestObjective_count, 1 do
    453                         if type(getglobal("TranslateWOW_QuestObjective_"..i))=="table" and getglobal("TranslateWOW_QuestObjective_"..i)[questObjectives] then
    454                                 QuestObjectiveText:SetText(prepare(getglobal("TranslateWOW_QuestObjective_"..i)[questObjectives]));
    455                         end
    456                 end
    457                 for i=1, TranslateWOW_QuestDescription_count, 1 do
    458                         if type(getglobal("TranslateWOW_QuestDescription_"..i))=="table" and getglobal("TranslateWOW_QuestDescription_"..i)[questDescription] then
    459                                 QuestDescription:SetText(prepare(getglobal("TranslateWOW_QuestDescription_"..i)[questDescription]));
     458                for i=1, CZWOW_QuestObjective_count, 1 do
     459                        if type(getglobal("CZWOW_QuestObjective_"..i))=="table" and getglobal("CZWOW_QuestObjective_"..i)[questObjectives] then
     460                                QuestObjectiveText:SetText(prepare(getglobal("CZWOW_QuestObjective_"..i)[questObjectives]));
     461                        end
     462                end
     463                for i=1, CZWOW_QuestDescription_count, 1 do
     464                        if type(getglobal("CZWOW_QuestDescription_"..i))=="table" and getglobal("CZWOW_QuestDescription_"..i)[questDescription] then
     465                                QuestDescription:SetText(prepare(getglobal("CZWOW_QuestDescription_"..i)[questDescription]));
    460466                        end
    461467                end
     
    465471QuestFrameProgressPanel_OnShow=function()
    466472        old_QuestFrameProgressPanel_OnShow();
    467         if TranslateWOW_EnableQuests and type(TranslateWOW_QuestProgress_count)=="number" then
     473        if CZWOW_EnableQuests and type(CZWOW_QuestProgress_count)=="number" then
    468474                local text=trim(GetProgressText());
    469                 for i=1, TranslateWOW_QuestProgress_count, 1 do
    470                         if  type(getglobal("TranslateWOW_QuestProgress_"..i))=="table" and getglobal("TranslateWOW_QuestProgress_"..i)[text] then
    471                                 QuestProgressText:SetText(prepare(getglobal("TranslateWOW_QuestProgress_"..i)[text]));
     475                for i=1, CZWOW_QuestProgress_count, 1 do
     476                        if  type(getglobal("CZWOW_QuestProgress_"..i))=="table" and getglobal("CZWOW_QuestProgress_"..i)[text] then
     477                                QuestProgressText:SetText(prepare(getglobal("CZWOW_QuestProgress_"..i)[text]));
    472478                        end
    473479                end
     
    477483QuestFrameRewardPanel_OnShow=function()
    478484        old_QuestFrameRewardPanel_OnShow();
    479         if TranslateWOW_EnableQuests and type(TranslateWOW_QuestReward_count)=="number" then
     485        if CZWOW_EnableQuests and type(CZWOW_QuestReward_count)=="number" then
    480486                local text=trim(GetRewardText());
    481                 for i=1, TranslateWOW_QuestReward_count, 1 do
    482                         if type(getglobal("TranslateWOW_QuestReward_"..i))=="table" and getglobal("TranslateWOW_QuestReward_"..i)[text] then
    483                                 QuestRewardText:SetText(prepare(getglobal("TranslateWOW_QuestReward_"..i)[text]));
     487                for i=1, CZWOW_QuestReward_count, 1 do
     488                        if type(getglobal("CZWOW_QuestReward_"..i))=="table" and getglobal("CZWOW_QuestReward_"..i)[text] then
     489                                QuestRewardText:SetText(prepare(getglobal("CZWOW_QuestReward_"..i)[text]));
    484490                        end
    485491                end
     
    489495ItemTextFrame_OnEvent=function(event)
    490496        old_ItemTextFrame_OnEvent(event);
    491         if event=="ITEM_TEXT_READY" and TranslateWOW_EnableBooks and type(TranslateWOW_BookPage_count)=="number" then
     497        if event=="ITEM_TEXT_READY" and CZWOW_EnableBooks and type(CZWOW_BookPage_count)=="number" then
    492498                local en=trim(ItemTextGetText());
    493                 for i=1, TranslateWOW_BookPage_count, 1 do
    494                         if type(getglobal("TranslateWOW_BookPage_"..i))=="table" and getglobal("TranslateWOW_BookPage_"..i)[en] then
     499                for i=1, CZWOW_BookPage_count, 1 do
     500                        if type(getglobal("CZWOW_BookPage_"..i))=="table" and getglobal("CZWOW_BookPage_"..i)[en] then
    495501                                local creator=ItemTextGetCreator();
    496502                                if ( creator ) then
    497503                                        creator=strchar(10, 10)..ITEM_TEXT_FROM..strchar(10)..creator..strchar(10, 10);
    498                                         ItemTextPageText:SetText(strchar(10)..prepare(getglobal("TranslateWOW_BookPage_"..i)[en])..creator);
     504                                        ItemTextPageText:SetText(strchar(10)..prepare(getglobal("CZWOW_BookPage_"..i)[en])..creator);
    499505                                else
    500                                         ItemTextPageText:SetText(strchar(10)..prepare(getglobal("TranslateWOW_BookPage_"..i)[en])..strchar(10, 10));
     506                                        ItemTextPageText:SetText(strchar(10)..prepare(getglobal("CZWOW_BookPage_"..i)[en])..strchar(10, 10));
    501507                                end
    502508                        end
     
    508514        if select("#", ...)>0 then
    509515                old_GossipFrameOptionsUpdate(...);
    510                 if TranslateWOW_EnableNPCs and type(TranslateWOW_NPCAction_count)=="number" then
     516                if CZWOW_EnableNPCs and type(CZWOW_NPCAction_count)=="number" then
    511517                        for i=1, NUMGOSSIPBUTTONS, 1 do
    512518                                titleButton=getglobal("GossipTitleButton" .. i);
    513519                                local en=trim(titleButton:GetText());
    514                                 for i=1, TranslateWOW_NPCAction_count, 1 do
    515                                         if type(getglobal("TranslateWOW_NPCAction_"..i))=="table" and getglobal("TranslateWOW_NPCAction_"..i)[en] then
    516                                                 titleButton:SetText(prepare(getglobal("TranslateWOW_NPCAction_"..i)[en]));
     520                                for i=1, CZWOW_NPCAction_count, 1 do
     521                                        if type(getglobal("CZWOW_NPCAction_"..i))=="table" and getglobal("CZWOW_NPCAction_"..i)[en] then
     522                                                titleButton:SetText(prepare(getglobal("CZWOW_NPCAction_"..i)[en]));
    517523                                                GossipResize(titleButton);
    518524                                        end
     
    525531GossipFrameUpdate=function()
    526532        old_GossipFrameUpdate();
    527         local Translate=NPCTextTranslate(GossipGreetingText:GetText());
    528         if Translate then GossipGreetingText:SetText(Translate) end
     533        local cz=NPCTextTranslate(GossipGreetingText:GetText());
     534        if cz then GossipGreetingText:SetText(cz) end
    529535end;
    530536
    531537QuestLog_UpdateQuestDetails=function()
    532538        old_QuestLog_UpdateQuestDetails();
    533         if TranslateWOW_EnableQuests and type(TranslateWOW_QuestObjective_count)=="number" and type(TranslateWOW_QuestDescription_count)=="number" then
     539        if CZWOW_EnableQuests and type(CZWOW_QuestObjective_count)=="number" and type(CZWOW_QuestDescription_count)=="number" then
    534540                local questDescription;
    535541                local questObjectives;
     
    537543                questObjectives=trim(questObjectives);
    538544                questDescription=trim(questDescription);
    539                 for i=1, TranslateWOW_QuestObjective_count, 1 do
    540                         if type(getglobal("TranslateWOW_QuestObjective_"..i))=="table" and getglobal("TranslateWOW_QuestObjective_"..i)[questObjectives] then
    541                                 QuestLogObjectivesText:SetText(prepare(getglobal("TranslateWOW_QuestObjective_"..i)[questObjectives]));
    542                         end
    543                 end
    544                 for i=1, TranslateWOW_QuestDescription_count, 1 do
    545                         if type(getglobal("TranslateWOW_QuestDescription_"..i))=="table" and getglobal("TranslateWOW_QuestDescription_"..i)[questDescription] then
    546                                 QuestLogQuestDescription:SetText(prepare(getglobal("TranslateWOW_QuestDescription_"..i)[questDescription]));
     545                for i=1, CZWOW_QuestObjective_count, 1 do
     546                        if type(getglobal("CZWOW_QuestObjective_"..i))=="table" and getglobal("CZWOW_QuestObjective_"..i)[questObjectives] then
     547                                QuestLogObjectivesText:SetText(prepare(getglobal("CZWOW_QuestObjective_"..i)[questObjectives]));
     548                        end
     549                end
     550                for i=1, CZWOW_QuestDescription_count, 1 do
     551                        if type(getglobal("CZWOW_QuestDescription_"..i))=="table" and getglobal("CZWOW_QuestDescription_"..i)[questDescription] then
     552                                QuestLogQuestDescription:SetText(prepare(getglobal("CZWOW_QuestDescription_"..i)[questDescription]));
    547553                        end
    548554                end
     
    550556end
    551557';
    552   file_put_contents($TempDir.'TranslateWoW.lua');
     558  file_put_contents($TempDir.'CzWoW.lua', $Buffer);
    553559}
    554560
     
    560566  MakeLanguageFiles($Setting);
    561567  MakeClientStrings($Setting);
    562   //MakeMainScript($Setting);
     568  MakeMainScript($Setting);
    563569}
    564570
  • trunk/download.php

    r68 r74  
    153153          $Zip->addFile(file_get_contents('addon/CzWoW/CzWoW.xml'), 'CzWoW/CzWoW.xml');
    154154                  $Zip->addFile(file_get_contents('addon/CzWoW/CzWoW.toc'), 'CzWoW/CzWoW.toc');
    155           $Zip->addFile(file_get_contents('addon/CzWoW/CzWoW.lua'), 'CzWoW/CzWoW.lua');
     155          //$Zip->addFile(file_get_contents('addon/CzWoW/CzWoW.lua'), 'CzWoW/CzWoW.lua');       
    156156                  $Zip->addFile(file_get_contents('addon/CzWoW/GameMenuFrame.xml'), 'CzWoW/GameMenuFrame.xml');
    157157                  $Zip->addFile(file_get_contents('addon/CzWoW/Localization.lua'), 'CzWoW/Localization.lua');   
Note: See TracChangeset for help on using the changeset viewer.