Difference between revisions of "Module:Template translation"
Jump to navigation
Jump to search
m
Module:Template translation (view source)
Revision as of 14:15, 27 April 2014
, 14:15, 27 April 2014exclude some invalid codes used as subpages in template pages
>Verdy p m |
>Verdy p m (exclude some invalid codes used as subpages in template pages) |
||
Line 22: | Line 22: | ||
case-insensitive; they are not "SupportedLanguages" for MediaWiki, so | case-insensitive; they are not "SupportedLanguages" for MediaWiki, so | ||
they are not "KnownLanguageTags" for MediaWiki). | they are not "KnownLanguageTags" for MediaWiki). | ||
To be more restrictive, we exclude any character that is not | To be more restrictive, we exclude any character | ||
* that is not ASCII and not a lowercase letter, minus-hyphen, or digit, | |||
or does not start by a letter or does not finish by a letter or digit; | |||
* or that has more than 8 characters between 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 | 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, "[%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 string.find(subpage, "%-%-") == nil | ||
and subpage ~= "doc" | |||
and subpage ~= "layout" | |||
and subpage ~= "sandbox" | |||
and subpage ~= "testcases" | |||
then | then | ||
return subpage | return subpage |