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 = { |
||
unit = "[[Category:Convert invalid units]]", |
|||
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 " |
-- [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_num = { 'Value "%s" must be a number' , 'Convert: Invalid number.' , 'option', 'invalid_number' }, |
|||
cvt_big_prec = { 'Precision "%s" is too large' , 'Convert: Precision too large.', 'option', 'precision_too_large'}, |
|||
cvt_invalid_num = { 'Number has overflowed' , 'Convert: Number overflow.' , 'option', 'number_overflow' }, |
|||
cvt_no_num = { 'Need the number to be converted' , 'Convert: Need a number.' , 'option', 'need_number' }, |
|||
cvt_no_num2 = { 'Need another number for a range' , 'Convert: Need another number.', 'option', 'need_another_number'}, |
|||
cvt_bad_prec = { 'Precision "%s" must be an integer' , 'Convert: Invalid precision.' , 'option', 'invalid_precision' }, |
|||
cvt_bad_sigfig = { 'sigfig "%s" must be a positive integer' , 'Convert: Invalid sigfig.' , 'option', 'invalid_sigfig' }, |
|||
cvt_empty_option = { 'Ignored empty option "%s"' , ' |
cvt_empty_option = { 'Ignored empty option "%s"' , 'Convert: Empty option.' , 'option', 'empty_option' }, |
||
cvt_no_spell = { 'Spelling is not available' , 'Convert: Bug, ask for help.' , 'option', 'ask_for_help' }, |
|||
cvt_unknown_option = { 'Ignored invalid option "%s"' , 'Convert: Invalid option.' , 'option', 'invalid_option' }, |
|||
cvt_bad_default = { 'Unit "%s" has an invalid default' , 'Convert: Bug, ask for help.' , 'unit' , 'ask_for_help' }, |
|||
cvt_bad_unit = { 'Unit "%s" is invalid here' , 'Convert: Unit invalid here.' , 'unit' , 'unit_invalid_here' }, |
|||
cvt_no_default = { 'Unit "%s" has no default output unit' , 'Convert: Bug, ask for help.' , 'unit' , 'ask_for_help' }, |
|||
cvt_no_unit = { 'Need name of unit' , 'Convert: Need unit name.' , 'unit' , 'need_unit_name' }, |
|||
cvt_unknown = { 'Unit name "%s" is not known' , 'Convert: Unknown unit.' , 'unit' , 'unknown_unit' }, |
|||
cvt_should_be = { '%s' , ' |
cvt_should_be = { '%s' , 'Convert: Ambiguous unit.' , 'unit' , 'ambiguous_unit', regex = unitcode_regex, replace = unitcode_replace }, |
||
cvt_mismatch = { 'Cannot convert "%s" to "%s"' , 'Convert: Unit mismatch.' , 'unit' , 'unit_mismatch' }, |
|||
cvt_bug_convert = { 'Bug: Cannot convert between specified units', 'Convert: Bug, ask for help.' , 'unit' , 'ask_for_help' }, |
|||
cvt_lookup = { 'Unit "%s" is incorrectly defined' , 'Convert: Bug, ask for help.' , 'unit' , 'ask_for_help' }, |
|||
} |
} |
||