Module:Colon: Difference between revisions
From Neodyland Wiki
More actions
No edit summary |
No edit summary |
||
| Line 11: | Line 11: | ||
-- Please keep the ASCII colon returned as HTML-encoded everywhere, as it MUST NOT be parsed as wiki markup. | -- Please keep the ASCII colon returned as HTML-encoded everywhere, as it MUST NOT be parsed as wiki markup. | ||
local colons = { | local colons = { | ||
-- Colon with | -- Colon with no space before and space after | ||
-- ": "" | |||
['ger'] = ': ', | ['ger'] = ': ', | ||
-- Colon with | -- Colon with narrow space before space after | ||
-- " : " | |||
['rom'] = ' : ', | ['rom'] = ' : ', | ||
--[=[ Colon with | --[=[ Colon with non-breaking space before and space after, avoiding confusion with: | ||
several Arabic diacritics, | several Arabic diacritics, | ||
U+0589 Armenian punctuation Full stop, | U+0589 Armenian punctuation Full stop, | ||
| Line 35: | Line 37: | ||
U+2D53 Tifinagh letter Yu (Touareg Yaw) | U+2D53 Tifinagh letter Yu (Touareg Yaw) | ||
]=] | ]=] | ||
-- " : " | |||
['sp'] = ' : ', | ['sp'] = ' : ', | ||
-- Myanmar: do not use the ASCII colon (too much confusable with a Myanmar letter in many fonts, notably at small sizes), use an en-dash instead | -- Myanmar: do not use the ASCII colon (too much confusable with a Myanmar letter in many fonts, notably at small sizes), use an en-dash instead | ||
-- " – " | |||
['my'] = ' – ', | ['my'] = ' – ', | ||
-- Not any spacing | -- Not any spacing | ||
-- ":" | |||
['no'] = ':', | ['no'] = ':', | ||
-- Ethiopic punctuation sign colon | -- Ethiopic punctuation sign colon | ||
-- "፥ " | |||
['eth'] = '፥ ', | ['eth'] = '፥ ', | ||
-- Mongolian/Mandchu punctuation sign colon | -- Mongolian/Mandchu punctuation sign colon | ||
-- "᠄" | |||
['mong'] = '᠄', | ['mong'] = '᠄', | ||
-- CJK punctuation fullwidth colon (rotated if vertical layout) for Indo-Sinitic scripts used along with Chinese | -- CJK punctuation fullwidth colon (rotated if vertical layout) for Indo-Sinitic scripts used along with Chinese | ||
-- ":" | |||
['cjk'] = ':' | ['cjk'] = ':' | ||
} | } | ||
Revision as of 22:36, 30 April 2023
This documentation is transcluded from Module:Colon/doc.
require('strict')
local getArgs = require('Module:Arguments').getArgs
local langSwitch = require('Module:LangSwitch')._langSwitch
local p = {}
function p._colon(args)
local lang = args.lang or mw.getCurrentFrame():preprocess("{{Int:Lang}}")
-- Please keep the ASCII colon returned as HTML-encoded everywhere, as it MUST NOT be parsed as wiki markup.
local colons = {
-- Colon with no space before and space after
-- ": ""
['ger'] = ': ',
-- Colon with narrow space before space after
-- " : "
['rom'] = ' : ',
--[=[ Colon with non-breaking space before and space after, avoiding confusion with:
several Arabic diacritics,
U+0589 Armenian punctuation Full stop,
U+05C3 Hebrew punctuation sign Sof Pasuk,
U+0983 Bengali combining sign Visarga,
U+0903 Devanagari combining sign Visarga,
U+0A03 Gurmukhi combining sign Visarga,
U+0A83 Gujarati combining sign Visarga,
U+0B03 Oryia combining sign Visarga,
U+0B83 Tamil combining sign Visarga,
Telugu combining sign Visarga,
Kannada combining sign Visarga,
U+0D03 Malayalam combining sign Visarga,
U+0D83 Sinhalese combining sign Visarga,
U+0F7F Tibetan combining sign Rnam Bcad (Nam Che),
U+17C7 / U+17C8 Khmer combining signs Reahmuk / Yukaleakpintu,
U+2D53 Tifinagh letter Yu (Touareg Yaw)
]=]
-- " : "
['sp'] = ' : ',
-- Myanmar: do not use the ASCII colon (too much confusable with a Myanmar letter in many fonts, notably at small sizes), use an en-dash instead
-- " – "
['my'] = ' – ',
-- Not any spacing
-- ":"
['no'] = ':',
-- Ethiopic punctuation sign colon
-- "፥ "
['eth'] = '፥ ',
-- Mongolian/Mandchu punctuation sign colon
-- "᠄"
['mong'] = '᠄',
-- CJK punctuation fullwidth colon (rotated if vertical layout) for Indo-Sinitic scripts used along with Chinese
-- ":"
['cjk'] = ':'
}
local text_args = {
['default'] = colons['ger'],
['Zinh-Po-space'] = colons['ger'],
['en'] = colons['ger'],
['vls'] = colons['ger'],
['nds'] = colons['ger'],
['nds-nl'] = colons['ger'],
['nl'] = colons['ger'],
['li'] = colons['ger'],
['lb'] = colons['ger'],
['af'] = colons['ger'],
['de'] = colons['ger'],
['bar'] = colons['ger'],
['pt'] = colons['ger'],
['pt-br'] = colons['ger'],
['ro'] = colons['ger'],
['sl'] = colons['ger'],
['sk'] = colons['ger'],
['cs'] = colons['ger'],
['hu'] = colons['ger'],
['bs'] = colons['ger'],
['hr'] = colons['ger'],
['sr-Latn'] = colons['ger'],
['sr-el'] = colons['ger'],
['Cyrl'] = colons['ger'],
['sr'] = colons['ger'],
['sr-ec'] = colons['ger'],
['bg'] = colons['ger'],
['mk'] = colons['ger'],
['be'] = colons['ger'],
['be-tarask'] = colons['ger'],
['ru'] = colons['ger'],
['Grek'] = colons['ger'],
['el'] = colons['ger'],
['pnt'] = colons['ger'],
['Zinh-nnbsp-Po-space'] = colons['rom'],
['fr'] = colons['rom'],
['fr-be'] = colons['rom'],
['fr-ca'] = colons['rom'],
['fr-ch'] = colons['rom'],
['fr-lb'] = colons['rom'],
['oc'] = colons['rom'],
['ca'] = colons['rom'],
['wa'] = colons['rom'],
['br'] = colons['rom'],
['gsw'] = colons['rom'],
['la'] = colons['rom'],
['it'] = colons['rom'],
['co'] = colons['rom'],
['eml'] = colons['rom'],
['nap'] = colons['rom'],
['rgn'] = colons['rom'],
['scn'] = colons['rom'],
['vec'] = colons['rom'],
['es'] = colons['rom'],
['gl'] = colons['rom'],
['ext'] = colons['rom'],
['rm'] = colons['rom'],
['Zinh-nbsp-Po-space'] = colons['sp'],
['Hebr'] = colons['sp'],
['he'] = colons['sp'],
['yi'] = colons['sp'],
['ydd'] = colons['sp'],
['Arab'] = colons['sp'],
['ar'] = colons['sp'],
['arz'] = colons['sp'],
['fa'] = colons['sp'],
['prd'] = colons['sp'],
['glk'] = colons['sp'],
['ps'] = colons['sp'],
['ur'] = colons['sp'],
['ug'] = colons['sp'],
['Armn'] = colons['sp'],
['hy'] = colons['sp'],
['Beng'] = colons['sp'],
['bn'] = colons['sp'],
['Deva'] = colons['sp'],
['hi'] = colons['sp'],
['ne'] = colons['sp'],
['Guru'] = colons['sp'],
['pa'] = colons['sp'],
['Gujr'] = colons['sp'],
['gu'] = colons['sp'],
['Orya'] = colons['sp'],
['or'] = colons['sp'],
['Taml'] = colons['sp'],
['ta'] = colons['sp'],
['Telu'] = colons['sp'],
['te'] = colons['sp'],
['Knda'] = colons['sp'],
['kn'] = colons['sp'],
['Mlym'] = colons['sp'],
['ml'] = colons['sp'],
['Sinh'] = colons['sp'],
['si'] = colons['sp'],
['Tibt'] = colons['sp'],
['bo'] = colons['sp'],
['Khmr'] = colons['sp'],
['km'] = colons['sp'],
['Tfng'] = colons['sp'],
['ber'] = colons['sp'],
['shy'] = colons['sp'],
['tzm'] = colons['sp'],
['Mymr'] = colons['my'],
['my'] = colons['my'],
['Zinh-Po'] = colons['no'],
['Thai'] = colons['no'],
['th'] = colons['no'],
['Ethi'] = colons['eth'],
['am'] = colons['eth'],
['ti'] = colons['eth'],
['Mong'] = colons['mong'],
['mn-Mong'] = colons['mong'],
['Phpa'] = colons['cjk'],
['Tale'] = colons['cjk'],
['Talu'] = colons['cjk'],
['Yiii'] = colons['cjk'],
['ii'] = colons['cjk'],
['Hang'] = colons['cjk'],
['ko'] = colons['cjk'],
['ko-kp'] = colons['cjk'],
['Jpan'] = colons['cjk'],
['ja'] = colons['cjk'],
['Bpmf'] = colons['cjk'],
['Hani'] = colons['cjk'],
['Hant'] = colons['cjk'],
['zh-Hant'] = colons['cjk'],
['lzh'] = colons['cjk'],
['wuu'] = colons['cjk'],
['yue'] = colons['cjk'],
['Hans'] = colons['cjk'],
['zh'] = colons['cjk'],
['zh-Hans'] = colons['cjk']
}
return langSwitch(text_args, lang)
end
function p.colon(frame)
return p._colon(getArgs(frame))
end
return p