Difference between revisions of "Module:Template translation"

Jump to navigation Jump to search
m
exclude 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
        ASCII and not a lowercase letter, minus-hyphen, or digit, and any code
        * that is not ASCII and not a lowercase letter, minus-hyphen, or digit,
        that does not start by a letter or does not finish by a letter or digit.
          or does not start by a letter or does not finish by a letter or digit;
         of that has more than 8 characters between hyphens, or has two hyphens.
         * 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
Anonymous user

Navigation menu