Module:Convert/text: Difference between revisions

rework categories and messages per Module talk:Convert
(large refactor of messages: less visible, link to help)
(rework categories and messages per Module talk:Convert)
Line 56:
-- One of the following categories is included in the text of each message.
local all_categories = {
generalunit = "[[Category:Convert errorinvalid units]]",
mismatchoption = "[[Category:Convert dimensioninvalid mismatchoptions]]",
option = "[[Category:Convert invalid option]]",
unknown = "[[Category:Convert unknown unit]]",
}
 
Line 73 ⟶ 71:
-- Each of following messages is a table:
-- { [1] = 'title', -- mouseover title text
-- [2] = 'text', -- display text (each starts with "convertConvert:" so can easily locate by searching article)
-- [3] = 'category key', -- key to lookup category in all_categories
-- [4] = 'anchor', -- anchor for link to relevant section on help page
Line 79 ⟶ 77:
-- replace = gsub_table,
-- }
cvt_bad_defaultcvt_bad_num = { 'UnitValue "%s" hasmust anbe invalida defaultnumber' , 'convert: bug' , 'Convert: Invalid number.' , 'unknownoption' , 'should_not_occurinvalid_number' },
cvt_bad_num cvt_big_prec = { 'ValuePrecision "%s" mustis betoo a numberlarge' , 'convertConvert: invalidPrecision numbertoo large.' , 'generaloption' , 'must_be_numberprecision_too_large' },
cvt_bad_prec cvt_invalid_num = { 'PrecisionNumber has overflowed' "%s" must be an integer' , 'convertConvert: invalidNumber precisionoverflow.' , 'option' , 'precision_must_benumber_overflow' },
cvt_bad_sigfigcvt_no_num = { 'sigfigNeed "%s"the mustnumber to be aconverted' positive integer' , 'convertConvert: invalidNeed sigfiga number.' , 'option' , 'sigfig_must_beneed_number' },
cvt_bad_unitcvt_no_num2 = { 'UnitNeed "%s"another isnumber invalidfor herea range' , 'convertConvert: invalidNeed unitanother number.' , 'unknownoption' , 'unit_invalid_hereneed_another_number' },
cvt_big_preccvt_bad_prec = { 'Precision "%s" ismust toobe largean integer' , 'convertConvert: Invalid precision.' too large', 'generaloption' , 'precision_too_largeinvalid_precision' },
cvt_bug_convertcvt_bad_sigfig = { 'Bug:sigfig Cannot"%s" convertmust betweenbe specifieda units',positive integer'convert: bug' , 'Convert: Invalid sigfig.' , 'generaloption' , 'should_not_occurinvalid_sigfig' },
cvt_empty_option = { 'Ignored empty option "%s"' , 'convertConvert: emptyEmpty option.' , 'option' , 'empty_option' },
cvt_invalid_numcvt_no_spell = { 'NumberSpelling is toonot largeavailable' or too small' , 'convert: too large' , 'Convert: Bug, ask for help.' , 'generaloption' , 'too_largeask_for_help' },
cvt_lookup cvt_unknown_option = { 'UnitIgnored invalid option "%s"' is incorrectly defined' , 'convertConvert: bugInvalid option.' , 'generaloption' , 'should_not_occurinvalid_option' },
cvt_mismatch cvt_bad_default = { 'Cannot convertUnit "%s" to "%s"' has an invalid default' , 'convertConvert: dimensionBug, mismatchask for help.' , 'mismatchunit' , 'dimension_mismatchask_for_help' },
cvt_no_defaultcvt_bad_unit = { 'Unit "%s" hasis noinvalid default output unithere' , 'convert: bug' , 'Convert: Unit invalid here.' , 'unknownunit' , 'should_not_occurunit_invalid_here' },
cvt_no_num cvt_no_default = { 'Need value' Unit "%s" has no default output unit' , 'convertConvert: need value' Bug, ask for help.' , 'generalunit' , 'need_valueask_for_help' },
cvt_no_num2cvt_no_unit = { 'Need anothername valueof unit' , 'convertConvert: needNeed anotherunit valuename.' , 'generalunit' , 'need_another_valueneed_unit_name' },
cvt_no_unitcvt_unknown = { 'NeedUnit name of unit' "%s" is not known' , 'convertConvert: needUnknown unit.' , 'unknownunit' , 'need_unitunknown_unit' },
cvt_should_be = { '%s' , 'convertConvert: ambiguousAmbiguous unit.' , 'generalunit' , 'x_should_be_yambiguous_unit', regex = unitcode_regex, replace = unitcode_replace },
cvt_no_spellcvt_mismatch = { 'SpellingCannot isconvert "%s" notto available"%s"' , 'convertConvert: bugUnit mismatch.' , 'optionunit' , 'should_not_occurunit_mismatch' },
cvt_unknown cvt_bug_convert = { 'UnitBug: "%s"Cannot isconvert notbetween knownspecified units', 'Convert: Bug, ask for help.' , 'convert: unknown unit' , , 'unknownask_for_help' , 'unit_not_known' },
cvt_unknown_optioncvt_lookup = { 'Ignored invalid optionUnit "%s"' is incorrectly defined' , 'convertConvert: invalid option'Bug, ask for help.' , 'optionunit' , 'invalid_optionask_for_help' },
}
 
Anonymous user