Module:Template translation: Difference between revisions

m
exclude some invalid codes used as subpages in template pages
mNo edit summary
m (exclude some invalid codes used as subpages in template pages)
Line 22:
case-insensitive; they are not "SupportedLanguages" for MediaWiki, so
they are not "KnownLanguageTags" for MediaWiki).
To be more restrictive, we exclude any character that is not
* that is not ASCII and not a lowercase letter, minus-hyphen, or digit, and any code
that or does not start by a letter or does not finish by a letter or digit.;
of* or that has more than 8 characters between hyphens, or has two hyphens.;
* or that has two hyphens;
* or with specific uses in template subpages and unusable as languages.
--]]
or string.find(subpage, "^[%l][%-%d%l]*[%d%l]$") ~= nil
and string.find(subpage, "[%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l]") == nil
and string.find(subpage, "%-%-") == nil
and subpage ~= "doc"
and subpage ~= "layout"
and subpage ~= "sandbox"
and subpage ~= "testcases"
then
return subpage
Anonymous user