From 0b2558cdc75067c1698a66432abfcd449b6d3ac0 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Sun, 2 Mar 2025 23:11:44 +0100 Subject: [PATCH] Abyss: More pluralization capabilities for translators --- descriptions/rep/de.lua | 7 +++++-- descriptions/rep/en_us.lua | 7 +++++-- descriptions/rep/ko_kr.lua | 7 +++++-- features/eid_modifiers.lua | 4 +++- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/descriptions/rep/de.lua b/descriptions/rep/de.lua index 00063dc5..3e697767 100644 --- a/descriptions/rep/de.lua +++ b/descriptions/rep/de.lua @@ -691,8 +691,11 @@ EID.descriptions[languageCode].bookOfVirtuesWisps = { ---------- Abyss Locust description parts ---------- EID.descriptions[languageCode].AbyssTexts = { - InfoText = "Eine {size}{speed}Heuschrecke ({dmg})", -- values inside {} brackets will be replaced with text parts below. - InfoTextPlural = "{amount} {size}{speed}Heuschrecken ({dmg})", -- Will be shown when more than 1 locust will spawn + -- values inside {} brackets will be replaced with text parts below + -- As the last step, {pluralize} will be replaced with the "Pluralize" value. + -- The placeholder therefore can be used in all parts that make up the abyss locust descriptions + InfoText = "Eine {size}{speed}Heuschrecke ({dmg})", + InfoTextPlural = "{amount} {size}{speed}Heuschrecken ({dmg})", -- Can be used by translators to provide a pluralized version of the InfoText Chance = " ({1}% Chance)", -- {1} will be replaced with the chance SpeedSlow = "schnelle ", -- Speed < 1 SpeedFast = "langsame ", -- Speed > 1 diff --git a/descriptions/rep/en_us.lua b/descriptions/rep/en_us.lua index 503ca0a2..455effd5 100644 --- a/descriptions/rep/en_us.lua +++ b/descriptions/rep/en_us.lua @@ -650,8 +650,11 @@ EID.descriptions[languageCode].bookOfVirtuesWisps = { ---------- Abyss Locust description parts ---------- EID.descriptions[languageCode].AbyssTexts = { - InfoText = "{amount} {size}{speed}locust ({dmg})", -- values inside {} brackets will be replaced with text parts below - InfoTextPlural = "{amount} {size}{speed}locusts ({dmg})", -- Will be shown when more than 1 locust will spawn + -- values inside {} brackets will be replaced with text parts below + -- As the last step, {pluralize} will be replaced with the "Pluralize" value. + -- The placeholder therefore can be used in all parts that make up the abyss locust descriptions + InfoText = "{amount} {size}{speed}locust{pluralize} ({dmg})", + InfoTextPlural = nil, -- Can be used by translators to provide a pluralized version of the InfoText Chance = " ({1}% Chance)", -- {1} will be replaced with the chance SpeedSlow = "slow ", -- Speed < 1 SpeedFast = "fast ", -- Speed > 1 diff --git a/descriptions/rep/ko_kr.lua b/descriptions/rep/ko_kr.lua index f7e74e03..cd79a975 100644 --- a/descriptions/rep/ko_kr.lua +++ b/descriptions/rep/ko_kr.lua @@ -748,8 +748,11 @@ EID.descriptions[languageCode].bookOfVirtuesWisps = { -- Special Locust effects when Item was eaten by Abyss EID.descriptions[languageCode].AbyssTexts = { - InfoText = "{speed}{size}파리 x{amount} ({dmg})", -- values inside {} brackets will be replaced with text parts below - InfoTextPlural = "{speed}{size}파리 x{amount} ({dmg})", -- Will be shown when more than 1 locust will spawn + -- values inside {} brackets will be replaced with text parts below + -- As the last step, {pluralize} will be replaced with the "Pluralize" value. + -- The placeholder therefore can be used in all parts that make up the abyss locust descriptions + InfoText = "{speed}{size}파리 x{amount} ({dmg})", + InfoTextPlural = nil, -- Can be used by translators to provide a pluralized version of the InfoText Chance = " ({1}% 확률)", -- {1} will be replaced with the chance SpeedSlow = "느린 ", -- Speed < 1 SpeedFast = "빠른 ", -- Speed > 1 diff --git a/features/eid_modifiers.lua b/features/eid_modifiers.lua index c7980fb6..08d96356 100644 --- a/features/eid_modifiers.lua +++ b/features/eid_modifiers.lua @@ -1059,7 +1059,7 @@ if EID.isRepentance then elseif speed > 1 then speedText = EID:getDescriptionEntry("AbyssTexts", "SpeedFast") end -- overview / headline - local infoText = EID:getDescriptionEntry("AbyssTexts", amount > 1 and "InfoTextPlural" or "InfoText") + local infoText = amount > 1 and EID:getDescriptionEntry("AbyssTexts", "InfoTextPlural") or EID:getDescriptionEntry("AbyssTexts", "InfoText") descriptionText = "#{{Collectible706}} " .. textColor .. infoText descriptionText = EID:ReplaceVariableStr(descriptionText, "amount", amount) descriptionText = EID:ReplaceVariableStr(descriptionText, "size", scaleText) @@ -1081,6 +1081,8 @@ if EID.isRepentance then descriptionText = descriptionText .. GetFlagString(2, "TearFlagNames", tearFlags2, procChance1, procChance2, procChance3) descriptionText = descriptionText .. GetFlagString(3, "TearFlagNames", tearFlags3, procChance1, procChance2, procChance3) + local plural = amount > 1 and EID:getDescriptionEntry("Pluralize") or "" + descriptionText = EID:ReplaceVariableStr(descriptionText, "pluralize", plural) -- Put everything together EID:appendToDescription(descObj, descriptionText)