Changeset 327 for trunk/export/files/3.3.0/CzWoW/Localization.lua
- Timestamp:
- Feb 20, 2010, 10:34:38 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/files/3.3.0/CzWoW/Localization.lua
r325 r327 1 1 local i=CzWoW_interface; 2 2 local n=CzWoW_interface_entoname; 3 4 local old_TutorialFrame_Update = TutorialFrame_Update; 5 local old_UIErrorsFrame_OnEvent = UIErrorsFrame_OnEvent; 3 local CanTranslate = true; 4 local BadText = {}; 5 local BadPartText = {}; 6 local BadIndex = {}; 7 6 8 7 9 local Translate=function(index) … … 13 15 end 14 16 15 local test_Translate=function(index)16 return("test")17 end18 19 17 local TranslateByText=function(text) 20 18 if i[n[text]] then … … 24 22 end 25 23 end 26 24 25 26 27 BadText["0"] = " "; 28 BadText["1"] = " "; 29 BadText["2"] = " "; 30 BadText["3"] = " "; 31 BadText["-"] = " "; 32 BadText[" - "] = " "; 33 BadText["..."] = " "; 34 35 BadPartText["/"] = " "; 36 BadPartText["\\"] = " "; 37 BadPartText["$"] = " "; 38 BadPartText["|"] = " "; 39 BadPartText["\""] = " "; 40 BadPartText["SPELL_FAILED"] = " "; 41 BadPartText["ERR"] = " "; 42 BadPartText["http"] = " "; 43 BadPartText["%dx%s"] = " "; 44 BadPartText["LOOT"] = " "; 45 46 BadIndex["COPPER_AMOUNT_TEXTURE"] = " "; 47 BadIndex["SPELL_REAGENTS"] = " "; 48 BadIndex["SHOW_CASTABLE_DEBUFFS_TEXT"] = " "; 49 BadIndex["XP_TEXT"] = " "; 50 BadIndex["SPELL_REAGENTS"] = " "; 51 BadIndex["SPELL_RANGE"] = " "; 27 52 28 53 … … 34 59 35 60 --error message in the middle screen 61 local old_UIErrorsFrame_OnEvent = UIErrorsFrame_OnEvent; 36 62 local function onEvent(self, event, ...) 37 63 local arg1, arg2, arg3, arg4 = ... … … 44 70 UIErrorsFrame:SetScript('OnEvent', onEvent) 45 71 46 --tutotial TODO:Opravil 72 --tutotial 73 local old_TutorialFrame_Update = TutorialFrame_Update; 47 74 TutorialFrame_Update=function(currentTutorial) 48 75 old_TutorialFrame_Update(currentTutorial); … … 53 80 TutorialFrameText:SetText(TranslateByText(text)); 54 81 end 55 TutorialFrame:SetHeight(TutorialFrameText:GetHeight() + 62);56 82 end 57 83 … … 59 85 local oldTooltipSetText=GameTooltip["SetText"]; 60 86 GameTooltip["SetText"]=function(object, text, r, g, b, alphaValue, textWrap) 61 62 oldTooltipSetText(object, text, r, g, b, alphaValue, textWrap);87 text=TranslateByText(text); 88 oldTooltipSetText(object, text, r, g, b, alphaValue, textWrap); 63 89 end 64 --hooksecurefunc(GameTooltip, "SetText", print); 65 66 67 90 91 local oldTooltipAddLine=GameTooltip["AddLine"]; 92 GameTooltip["AddLine"]=function(object, text, r, g, b, alphaValue, textWrap) 93 text=TranslateByText(text); 94 oldTooltipAddLine(object, text, r, g, b, alphaValue, textWrap); 95 end 68 96 69 97 --Set global var with CZ texts 70 for index, value in pairs(i) do 71 if (i[index] == "") or (i[index] == getglobal(index)) or (string.find(index,"ERR") == 1) or (string.find(index,"SPELL_FAILED") == 1) or (string.find(i[index],"/") == 1) or (string.find(i[index],"\"") == 1) 72 then 73 else 74 if (i[index]) then 98 -- export: vyexportovávat pouze určenou verzi indexu 99 100 for index, value in pairs(i) do 101 CanTranslate = true; 102 en_text = GetText(index); 103 104 105 if (n[en_text]) then else CanTranslate = false; end 106 if (en_text == i[index]) then CanTranslate = false; end 107 if (BadText[i[index]]) then CanTranslate = false; end 108 if (BadIndex[index]) then CanTranslate = false; end 109 if (i[index] == getglobal(index)) then CanTranslate = false; end 110 if (i[index]) then else CanTranslate = false; end 111 112 for index_BadPartText in pairs(BadPartText) do 113 if (string.find(index,index_BadPartText) == 1) then CanTranslate = false; end 114 if (string.find(i[index],index_BadPartText) == 1) then CanTranslate = false; end 115 end 116 117 if (CanTranslate) then 75 118 setglobal(index,i[index]); 76 119 end 77 end120 78 121 end 122 79 123 80 124 --AlertFrames.xml … … 814 858 end 815 859 816 860 --------------------------------------------------------------------- 861 -------konec hlavní funkce prekladu rozhraní 862 ---------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.