Content deleted Content added
m function for that |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 6:
language = function (subtags, key)
if not subtags[key] then return nil end
return ("%s: <code>%s</code>"):format(key, subtags[key] or '')
end,
variant = function (subtags, key)
if not subtags[key] then return nil end
return ("%s: <code>%s</code>"):format(
key,
type(subtags[key]) == "table" and table.concat(subtags[key], ", ")
Line 20:
end
return ("error: %s at
:format(subtags.error, subtags.invalid or "???")
end,
Line 44:
return result:concat("; ")
end
Line 64 ⟶ 50:
{ "ru", { language = "ru" } },
{ "ru-Latn", { language = "ru", script = "Latn" } },
{ "
{ "ru
{ "zh-Latn-pinyin", { language = "zh", script = "Latn", variant = "pinyin" } },
{ "sl-rozaj-biske", { language = "sl", variant = { "rozaj", "biske" } } },
Line 105 ⟶ 90:
function (self, IETF_code, expected)
self:equals(
('<code style="white-space: nowrap;">%s</code>'):format(IETF_code),
show_parsed_subtags(parse_IETF(IETF_code)),
show_parsed_subtags(expected))
Line 112 ⟶ 97:
-- Change function names into more readable headers for the testcases tables.
for k, v in require "Module:
if type(k) == "string" then
local new_k = k:gsub("^test_(.+)$", "testcases for <code>%1</code>")
|