mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Overhauled text translations
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user