Overhauled text translations

This commit is contained in:
Maruno17
2023-01-08 17:11:38 +00:00
parent ae0d193bba
commit 632b0f8b4b
23 changed files with 757 additions and 710 deletions

View File

@@ -134,12 +134,13 @@ def getID(mod, constant)
return constant
end
def getConstantName(mod, value)
def getConstantName(mod, value, raise_if_none = true)
mod = Object.const_get(mod) if mod.is_a?(Symbol)
mod.constants.each do |c|
return c.to_s if mod.const_get(c.to_sym) == value
end
raise _INTL("Value {1} not defined by a constant in {2}", value, mod.name)
raise _INTL("Value {1} not defined by a constant in {2}", value, mod.name) if raise_if_none
return nil
end
def getConstantNameOrValue(mod, value)