Init
This commit is contained in:
29
Core/Functions.lua
Normal file
29
Core/Functions.lua
Normal file
@ -0,0 +1,29 @@
|
||||
local addon, ns = ...
|
||||
local T = {}
|
||||
ns.T = T
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- # CORE > FUNCTIONS
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
T.ShortValue = function(value)
|
||||
if value >= 1e11 then
|
||||
return ('%.0fb'):format(value / 1e9)
|
||||
elseif value >= 1e10 then
|
||||
return ('%.1fb'):format(value / 1e9):gsub('%.?0+([km])$', '%1')
|
||||
elseif value >= 1e9 then
|
||||
return ('%.2fb'):format(value / 1e9):gsub('%.?0+([km])$', '%1')
|
||||
elseif value >= 1e8 then
|
||||
return ('%.0fm'):format(value / 1e6)
|
||||
elseif value >= 1e7 then
|
||||
return ('%.1fm'):format(value / 1e6):gsub('%.?0+([km])$', '%1')
|
||||
elseif value >= 1e6 then
|
||||
return ('%.2fm'):format(value / 1e6):gsub('%.?0+([km])$', '%1')
|
||||
elseif value >= 1e5 then
|
||||
return ('%.0fk'):format(value / 1e3)
|
||||
elseif value >= 1e3 then
|
||||
return ('%.1fk'):format(value / 1e3):gsub('%.?0+([km])$', '%1')
|
||||
else
|
||||
return value
|
||||
end
|
||||
end
|
32
Core/Localization.lua
Normal file
32
Core/Localization.lua
Normal file
@ -0,0 +1,32 @@
|
||||
local addon, ns = ...
|
||||
local L = {}
|
||||
ns.L = L
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- # CORE > LOCALIZATION
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
-- ## ENGLISH
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
L['STATUS_AFK'] = 'AFK'
|
||||
L['STATUS_DND'] = 'DND'
|
||||
L['SPELL_ID'] = 'Spell ID:'
|
||||
L['ITEM_ID'] = 'Item ID:'
|
||||
|
||||
local locale = GetLocale()
|
||||
if locale == 'en_GB' or locale == 'en_US' then return end -- ENGLISH
|
||||
|
||||
-- ## OTHER
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
-- if locale == 'esMX' then return end -- SPANISH (MEXICO)
|
||||
-- if locale == 'pt_BR' then return end -- PORTUGEUSE
|
||||
-- if locale == 'de_DE' then return end -- GERMAN
|
||||
-- if locale == 'es_ES' then return end -- SPANISH (SPAIN)
|
||||
-- if locale == 'fr_FR' then return end -- FRENCH
|
||||
-- if locale == 'it_IT' then return end -- ITALIAN
|
||||
-- if locale == 'ru_RU' then return end -- RUSSIAN
|
||||
-- if locale == 'ko_KR' then return end -- KOREAN
|
||||
-- if locale == 'zh_TW' then return end -- CHINESE (TRADITIONAL)
|
||||
-- if locale == 'zh_CN' then return end -- CHINESE (SIMPLIFIED)
|
Reference in New Issue
Block a user