add zhCN locale

This commit is contained in:
jilinge2
2024-09-27 14:12:07 +08:00
parent 883d3459be
commit 803fccb9f7
12 changed files with 610 additions and 318 deletions
+15 -5
View File
@@ -149,12 +149,22 @@ ui.BarUpdate = function()
-- update caption text
local name = UnitName(this.guid)
local hp = UnitHealth(this.guid)
if GetLocale() == "zhCN" then
if hp then
if hp >= 10000 then
hp = math.floor(hp / 1000) / 10 .. "万"
-- elseif hp >= 1000 then
-- hp = math.floor(hp / 100) / 10 .. "k"
end
end
else
-- convert hp to k if > 1000
if hp then
if hp >= 1000000 then
hp = math.floor(hp / 100000) / 10 .. "m"
elseif hp >= 1000 then
hp = math.floor(hp / 100) / 10 .. "k"
if hp then
if hp >= 1000000 then
hp = math.floor(hp / 100000) / 10 .. "m"
elseif hp >= 1000 then
hp = math.floor(hp / 100) / 10 .. "k"
end
end
end