Module:Util/config

From Sea of Thieves Wiki
Jump to navigation Jump to search

Documentation for this module may be created at Module:Util/config/doc

-------------------------------------------------------------------------------
-- 
--                        Configuration for Module:Util
-- 
-------------------------------------------------------------------------------

local cfg = {}

-- ----------------------------------------------------------------------------
-- i18n
-- ----------------------------------------------------------------------------

cfg.i18n = {}

-- String values that should cast to boolean false
cfg.i18n.bool_false = {'false', '0', 'disabled', 'off', 'no', '', 'deactivated'}

cfg.i18n.range = '(%s-%s)'

cfg.i18n.args = {
    -- util.args.stat
    stat_infix = 'stat',
    stat_id = 'id',
    stat_min = 'min',
    stat_max = 'max',
    stat_value = 'value',

    -- util.args.weight_list
    spawn_weight_prefix = 'spawn_weight',
    generation_weight_prefix = 'generation_weight',
}

cfg.i18n.na = 'N/A'

cfg.i18n.errors = {
    -- util.validate.factory.number_in_range
    number_out_of_range = 'The number %s is out of range. It must be between %s and %s',

    -- util.validate.factory.string_length
    string_length_incorrect = 'The string %s is not the correct length. It must have between %s and %s characters',

    -- util.validate.factory.in_table
    value_not_in_table = 'Table does not contain the value "%s"',

    -- util.validate.factory.in_table
    value_not_in_table_keys = 'Table does not have the value "%s" as one of its keys',

    -- util.cast.factory.*
    missing_element = 'Element "%s" not found',

    -- util.cast.factory.percentage
    invalid_argument = 'Argument "%s" is invalid. Please check the documentation for acceptable values.',
    not_a_percentage = '%s must be a percentage (in range 0 to 100).',

    -- 
    not_a_string = 'value "%s" of type "%s" is not a string',

    -- util.cast.boolean
    not_a_boolean = 'value "%s" of type "%s" is not a boolean',

    -- util.cast.number
    not_a_number = 'value "%s" of type "%s" is not a number',
    number_too_small = '"%i" is too small. Minimum: "%i"',
    number_too_large = '"%i" is too large. Maximum: "%i"',

    -- util.cast.version
    malformed_version_string = 'Malformed version string "%s"',
    non_number_version_component = '"%s" has an non-number component',
    unrecognized_version_number = '"%s" is not a recognized version number',

    -- util.args.stats
    improper_stat = '%sstat%s is improperly set; id and either value or min/max must be specified.',

    -- util.args.weight_list
    invalid_weight = 'Both %s and %s must be specified',

    -- util.args.version
    too_many_versions = 'The number of results (%s) does not match the number version arguments (%s)',

    -- util.args.from_cargo_map
    missing_key_in_fields = 'Key "%s" not found in the fields mapping of table "%s"',
    table_object_as_default = 'Warning: table object as default value on key "%s" in mapping of table "%s"',
    missing_key_in_order = 'Fields mapping of table "%s" has the following extra keys that are not handled by order:\n%s',
    handler_returned_nil = 'Handler for "%s.fields.%s" returned nil for argument "%s". Check whether the value is correct for the given field type "%s".',
    argument_required = 'Argument "%s" is required',

    -- util.html.error
    module_error = 'Module Error: ',

    -- util.misc.raise_error_or_return
    invalid_raise_error_or_return_usage = 'Invalid usage of raise_error_or_return.',

    -- util.smw.array_query
    duplicate_ids_found = 'Found multiple pages for id property "%s" with value "%s": %s, %s',
    missing_ids_found = 'No results were found for id property "%s" with the following values: %s',

    -- util.string.split_args
    number_of_arguments_too_large = 'Number of arguments near = is too large (%s).',
}

-- ----------------------------------------------------------------------------
-- Constants
-- ----------------------------------------------------------------------------

cfg.misc = {}

cfg.misc.category_blacklist = {}

cfg.misc.category_blacklist.sub_pages = {
    doc = true,
    sandbox = true,
    sandbox2 = true,
    testcases = true,
}

cfg.misc.category_blacklist.namespaces = {
    Template = true,
    Template_talk = true,
    Module = true,
    Module_talk = true,
    User = true,
    User_talk = true,
}

return cfg