Add support for Left/Right
starcitizen>Astrid (undo stuffs) |
starcitizen>Astrid (Add support for Left/Right) |
||
| Рядок 164: | Рядок 164: | ||
end | end | ||
local lc = id:lower() | local lc = id:lower() | ||
local text = keyText[lc] or keyText[keyAlias[lc]] or | local text = keyText[lc] or keyText[keyAlias[lc]] | ||
result:add(kbdPrefix .. text .. kbdSuffix) | local leftRight = lc:match("^left ") or lc:match("^right ") | ||
if not text and leftRight then | |||
local _lc = lc:gsub("^" .. leftRight, "") | |||
local suffix = keyText[_lc] or keyText[keyAlias[_lc]] | |||
if suffix then | |||
text = leftRight:gsub("^%l", string.upper) .. " " .. suffix | |||
end | |||
end | |||
result:add(kbdPrefix .. (text or id) .. kbdSuffix) | |||
end | end | ||
return mw.getCurrentFrame():extensionTag{ | return mw.getCurrentFrame():extensionTag{ | ||