Module:Convert/text: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(rework categories and messages per Module talk:Convert)
(final tweaking to messages)
Line 68: Line 68:
local all_messages = {
local all_messages = {
-- Message format string, %s parameters: anchor, title, text, category.
-- Message format string, %s parameters: anchor, title, text, category.
-- Each displayed message starts with "Convert:" so can easily locate by searching article.
cvt_format = '<sup class="noprint Inline-Template" style="white-space:nowrap;">&#91;<i>[[Help:Convert#%s|<span title="%s">%s</span>]]</i>&#93;</sup>%s',
cvt_format = '<sup class="noprint Inline-Template" style="white-space:nowrap;">[<i>[[Help:Convert messages#%s|<span title="Convert: %s">Convert: %s</span>]]</i>]</sup>%s',
-- 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', -- link text displayed in 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
-- regex = gsub_regex,
-- regex = gsub_regex,
-- replace = gsub_table,
-- replace = gsub_table,
-- } Mouseover title text Link text CatKey Anchor
-- }
cvt_bad_num = { 'Value "%s" must be a number' , 'Convert: Invalid number.' , 'option', 'invalid_number' },
cvt_bad_num = { 'Value "%s" must be a number' , 'Invalid number' , 'option', 'invalid_number' },
cvt_big_prec = { 'Precision "%s" is too large' , 'Convert: Precision too large.', 'option', 'precision_too_large'},
cvt_big_prec = { 'Precision "%s" is too large' , 'Precision too large' , 'option', 'precision_too_large' },
cvt_invalid_num = { 'Number has overflowed' , 'Convert: Number overflow.' , 'option', 'number_overflow' },
cvt_invalid_num = { 'Number has overflowed' , 'Number overflow' , 'option', 'number_overflow' },
cvt_no_num = { 'Need the number to be converted' , 'Convert: Need a number.' , 'option', 'need_number' },
cvt_no_num = { 'Needs the number to be converted' , 'Needs a number' , 'option', 'needs_number' },
cvt_no_num2 = { 'Need another number for a range' , 'Convert: Need another number.', 'option', 'need_another_number'},
cvt_no_num2 = { 'Needs another number for a range' , 'Needs another number', 'option', 'needs_another_number' },
cvt_bad_prec = { 'Precision "%s" must be an integer' , 'Convert: Invalid precision.' , 'option', 'invalid_precision' },
cvt_bad_prec = { 'Precision "%s" must be an integer' , 'Invalid precision' , 'option', 'invalid_precision' },
cvt_bad_sigfig = { 'sigfig "%s" must be a positive integer' , 'Convert: Invalid sigfig.' , 'option', 'invalid_sigfig' },
cvt_bad_sigfig = { 'sigfig "%s" must be a positive integer' , '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"' , 'Empty option' , 'option', 'empty_option' },
cvt_no_spell = { 'Spelling is not available' , 'Convert: Bug, ask for help.' , 'option', 'ask_for_help' },
cvt_no_spell = { 'Spelling is not available' , 'Bug, ask for help' , 'option', 'ask_for_help' },
cvt_unknown_option = { 'Ignored invalid option "%s"' , 'Convert: Invalid option.' , 'option', 'invalid_option' },
cvt_unknown_option = { 'Ignored invalid option "%s"' , '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_default = { 'Unit "%s" has an invalid default' , '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_bad_unit = { 'Unit "%s" is invalid here' , '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_default = { 'Unit "%s" has no default output unit' , 'Bug, ask for help' , 'unit' , 'ask_for_help' },
cvt_no_unit = { 'Need name of unit' , 'Convert: Need unit name.' , 'unit' , 'need_unit_name' },
cvt_no_unit = { 'Needs name of unit' , 'Needs unit name' , 'unit' , 'needs_unit_name' },
cvt_unknown = { 'Unit name "%s" is not known' , 'Convert: Unknown unit.' , 'unit' , 'unknown_unit' },
cvt_unknown = { 'Unit name "%s" is not known' , 'Unknown unit' , 'unit' , 'unknown_unit' },
cvt_should_be = { '%s' , 'Convert: Ambiguous unit.' , 'unit' , 'ambiguous_unit', regex = unitcode_regex, replace = unitcode_replace },
cvt_should_be = { '%s' , '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_mismatch = { 'Cannot convert "%s" to "%s"' , 'Unit mismatch' , 'unit' , 'unit_mismatch' },
cvt_bug_convert = { 'Bug: Cannot convert between specified units', 'Convert: Bug, ask for help.' , 'unit' , 'ask_for_help' },
cvt_bug_convert = { 'Bug: Cannot convert between specified units', 'Bug, ask for help' , 'unit' , 'ask_for_help' },
cvt_lookup = { 'Unit "%s" is incorrectly defined' , 'Convert: Bug, ask for help.' , 'unit' , 'ask_for_help' },
cvt_lookup = { 'Unit "%s" is incorrectly defined' , 'Bug, ask for help' , 'unit' , 'ask_for_help' },
}
}