Module:Convert/text: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(large refactor of messages: less visible, link to help)
(rework categories and messages per Module talk:Convert)
Line 56: Line 56:
-- One of the following categories is included in the text of each message.
-- One of the following categories is included in the text of each message.
local all_categories = {
local all_categories = {
general = "[[Category:Convert error]]",
unit = "[[Category:Convert invalid units]]",
mismatch = "[[Category:Convert dimension mismatch]]",
option = "[[Category:Convert invalid options]]",
option = "[[Category:Convert invalid option]]",
unknown = "[[Category:Convert unknown unit]]",
}
}


Line 73: Line 71:
-- Each of following messages is a table:
-- Each of following messages is a table:
-- { [1] = 'title', -- mouseover title text
-- { [1] = 'title', -- mouseover title text
-- [2] = 'text', -- display text (each starts with "convert:" so can easily locate by searching article)
-- [2] = 'text', -- display text (each starts with "Convert:" so can easily locate by searching article)
-- [3] = 'category key', -- key to lookup category in all_categories
-- [3] = 'category key', -- key to lookup category in all_categories
-- [4] = 'anchor', -- anchor for link to relevant section on help page
-- [4] = 'anchor', -- anchor for link to relevant section on help page
Line 79: Line 77:
-- replace = gsub_table,
-- replace = gsub_table,
-- }
-- }
cvt_bad_default = { 'Unit "%s" has an invalid default' , 'convert: bug' , 'unknown' , 'should_not_occur' },
cvt_bad_num = { 'Value "%s" must be a number' , 'Convert: Invalid number.' , 'option', 'invalid_number' },
cvt_bad_num = { 'Value "%s" must be a number' , 'convert: invalid number' , 'general' , 'must_be_number' },
cvt_big_prec = { 'Precision "%s" is too large' , 'Convert: Precision too large.', 'option', 'precision_too_large'},
cvt_bad_prec = { 'Precision "%s" must be an integer' , 'convert: invalid precision' , 'option' , 'precision_must_be' },
cvt_invalid_num = { 'Number has overflowed' , 'Convert: Number overflow.' , 'option', 'number_overflow' },
cvt_bad_sigfig = { 'sigfig "%s" must be a positive integer' , 'convert: invalid sigfig' , 'option' , 'sigfig_must_be' },
cvt_no_num = { 'Need the number to be converted' , 'Convert: Need a number.' , 'option', 'need_number' },
cvt_bad_unit = { 'Unit "%s" is invalid here' , 'convert: invalid unit' , 'unknown' , 'unit_invalid_here' },
cvt_no_num2 = { 'Need another number for a range' , 'Convert: Need another number.', 'option', 'need_another_number'},
cvt_big_prec = { 'Precision "%s" is too large' , 'convert: precision too large', 'general' , 'precision_too_large'},
cvt_bad_prec = { 'Precision "%s" must be an integer' , 'Convert: Invalid precision.' , 'option', 'invalid_precision' },
cvt_bug_convert = { 'Bug: Cannot convert between specified units', 'convert: bug' , 'general' , 'should_not_occur' },
cvt_bad_sigfig = { 'sigfig "%s" must be a positive integer' , 'Convert: Invalid sigfig.' , 'option', 'invalid_sigfig' },
cvt_empty_option = { 'Ignored empty option "%s"' , 'convert: empty option' , 'option' , 'empty_option' },
cvt_empty_option = { 'Ignored empty option "%s"' , 'Convert: Empty option.' , 'option', 'empty_option' },
cvt_invalid_num = { 'Number is too large or too small' , 'convert: too large' , 'general' , 'too_large' },
cvt_no_spell = { 'Spelling is not available' , 'Convert: Bug, ask for help.' , 'option', 'ask_for_help' },
cvt_lookup = { 'Unit "%s" is incorrectly defined' , 'convert: bug' , 'general' , 'should_not_occur' },
cvt_unknown_option = { 'Ignored invalid option "%s"' , 'Convert: Invalid option.' , 'option', 'invalid_option' },
cvt_mismatch = { 'Cannot convert "%s" to "%s"' , 'convert: dimension mismatch' , 'mismatch', 'dimension_mismatch' },
cvt_bad_default = { 'Unit "%s" has an invalid default' , 'Convert: Bug, ask for help.' , 'unit' , 'ask_for_help' },
cvt_no_default = { 'Unit "%s" has no default output unit' , 'convert: bug' , 'unknown' , 'should_not_occur' },
cvt_bad_unit = { 'Unit "%s" is invalid here' , 'Convert: Unit invalid here.' , 'unit' , 'unit_invalid_here' },
cvt_no_num = { 'Need value' , 'convert: need value' , 'general' , 'need_value' },
cvt_no_default = { 'Unit "%s" has no default output unit' , 'Convert: Bug, ask for help.' , 'unit' , 'ask_for_help' },
cvt_no_num2 = { 'Need another value' , 'convert: need another value' , 'general' , 'need_another_value' },
cvt_no_unit = { 'Need name of unit' , 'Convert: Need unit name.' , 'unit' , 'need_unit_name' },
cvt_no_unit = { 'Need name of unit' , 'convert: need unit' , 'unknown' , 'need_unit' },
cvt_unknown = { 'Unit name "%s" is not known' , 'Convert: Unknown unit.' , 'unit' , 'unknown_unit' },
cvt_should_be = { '%s' , 'convert: ambiguous unit' , 'general' , 'x_should_be_y', regex = unitcode_regex, replace = unitcode_replace },
cvt_should_be = { '%s' , 'Convert: Ambiguous unit.' , 'unit' , 'ambiguous_unit', regex = unitcode_regex, replace = unitcode_replace },
cvt_no_spell = { 'Spelling is not available' , 'convert: bug' , 'option' , 'should_not_occur' },
cvt_mismatch = { 'Cannot convert "%s" to "%s"' , 'Convert: Unit mismatch.' , 'unit' , 'unit_mismatch' },
cvt_unknown = { 'Unit "%s" is not known' , 'convert: unknown unit' , 'unknown' , 'unit_not_known' },
cvt_bug_convert = { 'Bug: Cannot convert between specified units', 'Convert: Bug, ask for help.' , 'unit' , 'ask_for_help' },
cvt_unknown_option = { 'Ignored invalid option "%s"' , 'convert: invalid option' , 'option' , 'invalid_option' },
cvt_lookup = { 'Unit "%s" is incorrectly defined' , 'Convert: Bug, ask for help.' , 'unit' , 'ask_for_help' },
}
}