Module:Convert/text: Difference between revisions

define en_option_name so can check for unknown options; can translate all options
(simplify language handler)
(define en_option_name so can check for unknown options; can translate all options)
Line 6:
* Module:Convert/data (unit definitions)
* Module:Convert/text (parameter and message definitions)
 
In addition to the parameters defined here, Module:Convert accepts built-in
parameters shown in the following examples:
debug=yes Can be used with sortable=on.
sigfig=3 To set number of output significant figures.
]]
 
Line 147 ⟶ 142:
 
-- Valid option names.
local local_option_nameen_option_name = {
-- ["enlocal nametext usedfor in thisoption modulename"] = "localen textname forused optionin namethis module"
["abbr"] = "abbr",
["adj"] = "adj",
["debug"] = "debug",
["disp"] = "disp",
["comma"] = "comma",
["lang"] = "lang",
["lk"] = "lk",
["singsigfig"] = "singsigfig",
["sing"] = "adj", -- "sing" is an old alias for "adj"
["sortable"] = "sortable",
["sp"] = "sp",
Line 227 ⟶ 224:
["gaps"] = "opt_gaps", -- use gaps, not numsep, to separate groups of digits
["gaps5"] = "opt_gaps, opt_comma5", -- opt_gaps + opt_comma5
},
["debug"] = {
["yes"] = "opt_sortable_debug", -- make the normally hidden sort key visible
},
["lang"] = {
Line 237:
["out"] = "out", -- link RHS unit name or symbol
},
-- sigfig=x is handled as a special case: x must be an integer (possibly in local language) = 1 or more
["sortable"] = {
["off"] = "", -- ignored (off is the default)
Line 256 ⟶ 257:
customary_units = customary_units,
disp_joins = disp_joins,
en_option_name = en_option_name,
en_option_value = en_option_value,
eng_scales = eng_scales,
local_option_name = local_option_name,
range_aliases = range_aliases,
range_types = range_types,
Anonymous user