Content deleted Content added
Julialturner (talk | contribs) added checks for additional orthologs doesn't assume mouse |
Artoria2e5 (talk | contribs) m mark more *lclz* spots from zhwiki experience; value_error info |
||
Line 5:
local infoboxImage = require('Module:InfoboxImage').InfoboxImage
-- wrapaped "protected call", return "value error" with error info on error
local function check_values(f,args)
--local u= table.upack(args)
local exist, val = pcall(f, unpack(args))
-- Leaking some debugging info won't hurt....
end
--texts relevant to localization are tagged with --**lclz**
Line 231 ⟶ 232:
root = mw.html.create('table')
root
-- *lclz*: Some projects, like zhwiki (again), use inline styles on
-- infobox modules in addition to the class. Be sure to check them out.
:addClass('infobox')
:css('width', '26.4em')
Line 402 ⟶ 405:
end
-- *lclz*: see getAliases. You can, say, use another punctuation for your language.
aliases = string.gsub(aliases, ', '..gene_symbol..'$', '') --get rid of gene name if last in alias list
aliases = string.gsub(aliases, gene_symbol..', ', '') --get rid of gene name if first in aliases list
Line 551 ⟶ 555:
disease_name = value
else
disease_name = disease_name..", "..value -- *lclz*: punctuation
end
ref_flag_all = true
Line 978 ⟶ 982:
local ncbi_link = "https://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?val="
local refseq_mRNATitle = "RefSeq (mRNA)" -- *lclz*: sometimes
--create list of links for refSeq mRNA
Line 1,058 ⟶ 1,062:
end
-- *lclz*: sometimes
local refseq_protTitle = "RefSeq (protein)"
--create list of links for human refseq protein
Line 1,141:
local locTitle = "Location (UCSC)" -- *lclz*
local gstart_mb = p.locToMb(gstart, 2)
local gend_mb = p.locToMb(gend, 2)
Line 1,159:
end
local pubmedTitle = "[[PubMed|PubMed]] search" -- *lclz*
local pubmed_link = entrez_gene
if string.match(entrez_gene, '%w+') and entrez_gene ~= "n/a" then
Line 1,742:
--get random value that is preferred ranked
-- *lclz*: Sometimes Wikibase returns punctuations other than "," depending on
-- your site's language. Consider adding a gsub here.
p.getRefseq_mRNA = function(entity, propertyID, return_val)
if return_val == nil then return_val = "" end
Line 1,796 ⟶ 1,798:
end
-- *lclz*: same as getRefseq_mRNA
p.getRefseq_protein = function(protein_entities, propertyID, return_val)
local sep = ","
Line 1,904 ⟶ 1,907:
end
end
results = table.concat(out, ", ") -- *lclz*: punctuation (CJK comma, etc.)
else
results = entity:formatPropertyValues(propertyID, mw.wikibase.entity.claimRanks).value
Line 1,917 ⟶ 1,920:
a = ''
if entity['aliases'] ~= nil then
-- *lclz*: You will need a different language here.
-- If you are aiming for an "en" fallback, consider a set data structure.
-- zhwp went a bit further here: they moved this call after "gene_symbol",
-- so that this function can perform the deduplication here instead of
-- in renderIdentifiers. That way they skip messing with commas and spaces.
local test = entity['aliases']['en']
if test then
|