Skip to content

Commit

Permalink
More frFR Cata large number updates
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisSpomer committed Jun 17, 2024
1 parent 413a25f commit 611e3c2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Localization.frFR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -710,9 +710,12 @@ PawnLocal.TooltipParsing = {
if VgerCore.IsClassic or VgerCore.IsBurningCrusade then
PawnLocal.ThousandsSeparator = "NBSP"
PawnLocal.DecimalSeparator = "."
elseif VgerCore.IsWrath or VgerCore.IsCataclysm then
elseif VgerCore.IsWrath then
PawnLocal.ThousandsSeparator = ""
PawnLocal.DecimalSeparator = ","
elseif VgerCore.IsCataclysm then
PawnLocal.ThousandsSeparator = "-"
PawnLocal.DecimalSeparator = "."
end

if VgerCore.IsClassic or VgerCore.IsBurningCrusade or VgerCore.IsWrath or VgerCore.IsCataclysm then
Expand Down
2 changes: 1 addition & 1 deletion Pawn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2592,7 +2592,7 @@ function PawnLookForSingleStat(RegexTable, Stats, ThisString, DebugMessages)
-- in English format only.
ExtractedValue = gsub(ExtractedValue, PawnLocal.DecimalSeparator, ".")
end
if Stat == "Speed" and VgerCore.IsClassic and GetLocale() == "frFR" then
if Stat == "Speed" then
-- In French WoW Classic, the weapon speed value uses a comma for the decimal even though everything else uses a period.
-- UGH BLIZZARD WHY MUST YOU DO THIS TO ME
ExtractedValue = gsub(ExtractedValue, ",", ".")
Expand Down
2 changes: 1 addition & 1 deletion Readme.htm
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ <h3><span style="text-decoration: underline;">In</span>compatible addons</h3>
<h2>Updates</h2>
<h3>Version 2.9.11</h3>
<ul>
<li></li>
<li>Cataclysm Classic: More updates to correctly read numbers larger than 999 on items when playing in French.</li>
</ul>
<h3>Version 2.9.10</h3>
<ul>
Expand Down
8 changes: 7 additions & 1 deletion TooltipParsing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ local L = PawnLocal.TooltipParsing

if PawnLocal.ThousandsSeparator == "NBSP" then PawnLocal.ThousandsSeparator = "\194\160" end
local Key, Value
local NumberExpandedPattern = "(-?[%%d%%., ]+)"
if LARGE_NUMBER_SEPERATOR == "-" then
-- French Cataclysm Classic uses a hyphen as the thousands separator, which is insane. We only include that as a valid component
-- of a number in this specific case to limit the risk to other versions.
NumberExpandedPattern = "(-?[%%d%%., %-]+)"
end
for Key, Value in pairs(L) do
L[Key] = gsub(Value, "#", "(-?[%%d%%., ]+)")
L[Key] = gsub(Value, "#", NumberExpandedPattern)
end

------------------------------------------------------------
Expand Down

0 comments on commit 611e3c2

Please sign in to comment.