Module:Convert/text: Difference between revisions

(update from sandbox per Template talk:Convert#Module v2 soon)
(update from sandbox per Template talk:Convert:Module version 3)
Line 1:
-- Text used by Module:Convert, for en.wikipedia.org (English).
-- This is a separate module to simplify translation for use on another wiki.
-- See [[:en:Template:Convert/Transwiki guide]] if copying to another wiki.
 
-- Some units accept an SI prefix before the unit code, such as "kg" for kilogram.
Line 111 ⟶ 112:
-- Specifying a table requires "off" and "on" values (for "abbr=off" and "abbr=on");
-- other fields are optional.
-- Normally,When "adj=on|abbr=off" usesapplies, hyphensspaces within unabbreviatedrange unitstext (names,are notreplaced symbols)with hyphens.
-- However,With "exception = true", means hyphens arethat also usedoccurs with "adj=on|abbr=on".
-- If "adj" is defined here, that text (unchanged) is used with "adj=on" (without hyphens).
["+"] = " + ",
[","] = ", ",
Line 122 ⟶ 123:
["to about"] = " to about ",
["and"] = { off = " and ", on = " and ", exception = true },
["and(-)"] = { off = " and ", on = "–" },
["or"] = { off = " or " , on = " or " , exception = true },
["to"] = { off = " to " , on = " to " , exception = true },
Line 133 ⟶ 135:
local range_aliases = {
-- ["alternative name for a range"] = "standard range name"
["and(-)"] = "and",
["&"] = "and",
["–"] = "-",
Line 146 ⟶ 147:
-- The following "words" are accepted to make a simple range, for example, {{convert|1-2|ft}}.
-- Words must be in correct order for searching, for example, '-' after '+/-' and 'x' after 'xx'.
-- Put '-' last so can have a simple range with negative values as in {{convert|-5 to -1|C}}.
local range_words = { '+/-', 'to(-)', '-xx', 'xxx', 'x*', '*to', 'or', 'by', 'to' , 'or-' }
 
local ranges = {
Line 205 ⟶ 207:
["flip"] = "opt_flip", -- reverse order of input/output
["j"] = "opt_use_nbsp", -- "join": use " " instead of " " between value and unit name
["mid"] = "opt_adjectival, opt_adj_mid", -- adj=on with user-specified text beforeafter input unit (between input and output)
["nocomma"] = "opt_nocomma", -- no numsep in input or output numbers
["off"] = "", -- ignored (off is the default)
Anonymous user