Module:Lang: Difference between revisionsGive feedback
Added support for lang codes longer than 2 characters |
Tag: Undo |
||
| Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
-- Overrides applied to searches by key. Designed to handle edge cases where | -- Overrides applied to searches by key. Designed to handle edge cases where | ||
| Line 167: | Line 160: | ||
local lang_code = title.fullText:match(".*/(.*)$") | local lang_code = title.fullText:match(".*/(.*)$") | ||
if (lang_code == nil or | -- if the last part the url is not two letters, then its not a lang code, | ||
-- so default to english | |||
if (lang_code == nil or string.len(lang_code) ~= 2) then | |||
return 'en' | return 'en' | ||
end | end | ||