Module:languages: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 572: Line 572:
local codes = self._bestScriptCodes
local codes = self._bestScriptCodes
if codes == nil then
if codes == nil then
codes = table.concat(self._rawData["scripts"],", ")
codes = self._rawData["scripts"] or {"None"}
codes = codes and split(codes, ",", true, true) or {"None"}
self._bestScriptCodes = codes
--self._bestScriptCodes = codes
end
end


Line 586: Line 585:


if not (forceDetect or first_sc == "Hants" or codes_len > 1) then
if not (forceDetect or first_sc == "Hants" or codes_len > 1) then
first_sc = require("Module:scripts").getByCode(first_sc)
first_sc = get_script(first_sc)
local charset = first_sc.characters
local charset = first_sc.characters
return charset and umatch(text, "[" .. charset .. "]") and first_sc or get_script("None")
return charset and umatch(text, "[" .. charset .. "]") and first_sc or get_script("None")