Advertisement
Shuraken007

Untitled

Apr 25th, 2017
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. function ServTr:CheckColor(text)
  2.     local _, _, color, _text = string.find(text, "(|cff%x%x%x%x%x%x)(.+)|r")
  3.     if color and _text then
  4.         return _text, _color
  5.     else
  6.         return text
  7.     end
  8. end
  9.  
  10. function ServTr:GetText(db,text)
  11.     if not text then return nil end
  12.     local color, trans_text
  13.     text, color = self:CheckColor(text)
  14.     db = _G[self.db.profile.language.."_"..db]
  15.     if type(db)=="table" and db[text] then
  16.         trans_text = db[text]
  17.         if color then
  18.             trans_text = color..trans_text.."|r"
  19.         end
  20.         return self:prepare(trans_text)
  21.     end
  22.     return nil
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement