Module:languages៖ ភាពខុសគ្នារវាងកំណែនានា

ខ្លឹមសារដែលបានលុបចោល ខ្លឹមសារដែលបានសរសេរបន្ថែម
No edit summary
No edit summary
បន្ទាត់ទី១០៖
 
function Language:getCanonicalName()
return self._rawData.canonicalNamenames[1]
end
 
 
--function Language:getAllNames()
-- Commented out; I don't think anything uses this, the presence/absence of script errors should confirm
-- return self._rawData.names
--function Language:getAllNames()
end
-- return self._rawData.names
--end
 
 
function Language:getOtherNames()
if not self._otherNames then
return self._rawData.otherNames or {}
self._otherNames = {}
for _i, ancestorval in ipairs(ancestorsself._rawData.names) do
if i > 1 then
table.insert(self._otherNames, val)
end
-- end
end
return self._otherNames
end
 
Line ៤២ ⟶ ៥១:
return self._wikimediaLanguageObjects
end
 
 
function Language:getWikipediaArticle()
return self._rawData.wikipedia_article or self:getCategoryName()
end
 
Line ៩៨ ⟶ ១០២:
return self._ancestorChain
end
 
 
function Language:hasAncestor(otherlang)
local ancestors = self:getAncestorChain()
for _, ancestor in ipairs(ancestors) do
if ancestor:getCode() == otherlang:getCode() then
return true
end
end
return false
end
 
 
function Language:getCategoryName()
local name = self._rawData.canonicalNamenames[1]
-- If the name already has "language" in it, don't add it.
Line ១២៨ ⟶ ១១៩:
function Language:makeEntryName(text)
text = mw.ustring.gsub(text, "^[¿¡]", "")
text = mw.ustring.gsub(text, "(.)[؟?!;՛՜ ՞ ՟?!।॥။၊་།]$", "%1")
if self._rawData.entry_name then
Line ១៤៧ ⟶ ១៣៨:
name = mw.ustring.gsub(name, "^[-־ـ*]+(.)",
"%1")
-- Remove anything in parentheses, as long as they are either preceded or followed by something
name = mw.ustring.gsub(name, "(.)%([^()]+%)", "%1")
name = mw.ustring.gsub(name, "%([^()]+%)(.)", "%1")
-- If there are language-specific rules to generate the key, use those