diff --git a/module_citeq.lua b/module_citeq.lua index e08d61e..3d8f765 100644 --- a/module_citeq.lua +++ b/module_citeq.lua @@ -862,44 +862,39 @@ local function _cite_q (citeq_args) for i, author in pairs(names.authors or {}) do -- mw.logObject(author) if not author.last and i <= (tonumber(citeq_args['display-authors']) or author_count) then - if author.qid then + if author.qid then -- checks for author (P50) vs. author name string (P2093) -- ignore anonymous or non-humans if author.human then table.insert(missing_names, string.format (cfg.i18n_t.errors.missing_name, author.label, 'author', author.qid)); + tableset_add(opt_cat, cfg.i18n_t.trackingcats['missing-author-first-last-names']) end else + tableset_add(opt_cat, cfg.i18n_t.trackingcats['missing-authorstring-first-last-names']) table.insert(missing_names, author.label) end end end for i, editor in pairs(names.editors or {}) do if not editor.last and i <= (tonumber(citeq_args['display-editors']) or editor_count) then - if editor.qid then - -- ignore anonymous or non-humans - if editor.human then - table.insert(missing_names, string.format (cfg.i18n_t.errors.missing_name, editor.label, 'editor', editor.qid)); - end - else - table.insert(missing_names, editor.label) + -- ignore anonymous or non-humans + if editor.human then + table.insert(missing_names, string.format (cfg.i18n_t.errors.missing_name, editor.label, 'editor', editor.qid)); + tableset_add(opt_cat, cfg.i18n_t.trackingcats['missing-author-first-last-names']) end end end for i, translator in pairs(names.translators or {}) do if not translator.last then - if translator.qid then - -- ignore anonymous or non-humans - if translator.human then - table.insert(missing_names, string.format (cfg.i18n_t.errors.missing_name, translator.label, 'translator', translator.qid)); - end - else - table.insert(missing_names, translator.label) + -- ignore anonymous or non-humans + if translator.human then + table.insert(missing_names, string.format (cfg.i18n_t.errors.missing_name, translator.label, 'translator', translator.qid)); + tableset_add(opt_cat, cfg.i18n_t.trackingcats['missing-author-first-last-names']) end end end - -- add category and display error if name errors found + -- add display error if name errors found if #missing_names > 0 and not in_array('missing-author-first-last-names', opt_cat) then - tableset_add(opt_cat, cfg.i18n_t.trackingcats['missing-author-first-last-names']) -- TODO: format and i18n this string cq_errors = cq_errors .. ' {{[[Template:Cite Q|Cite Q]]}}: Missing first/last names in Wikidata for ' .. table.concat(missing_names, ', ') .. ' ([[Template:Cite Q#Error messages|help]]) ' end diff --git a/module_citeq_config.lua b/module_citeq_config.lua index 65c4512..d9d936a 100644 --- a/module_citeq_config.lua +++ b/module_citeq_config.lua @@ -34,6 +34,7 @@ local i18n_t = { ["unknown-author"] = "", -- [[Category:Cite Q - author unknown]] removed as misplaced; someone is welcome to restore it if it is placed outside of the template parameter value ["unknown-template"] = "[[Category:Cite Q - template unknown]]", ["missing-author-first-last-names"] = "[[Category:Cite Q - authors with missing given and family names]]", + ["missing-authorstring-first-last-names"] = "[[Category:Cite Q - author name strings with missing given and family names]]", ["supplied-ref"] = "[[Category:Cite Q - supplied citeref does not match]]", }, }