« Module:Multilingual » : différence entre les versions
Contenu supprimé Contenu ajouté
ModuleCentralizer datas.get_item_report(t) better on 20181204 2128.lua |
Module:Centralizer mathroman.roman2int+int2roman OK 201811214 |
||
Ligne 1 :
local p = {} -- The main central module install central libraries and bind the main and its sub-modules
local Central = p -- Save as ModuleCentralizer.lua
--------------------------------------------------|------------------------ typical length --------------------------|
p.NOWNOW = { -- in work subtasks for replace on
{ "
{ "
{ "
{ "
{ "
{ "20181205", "20181205", "NOW", "Rical", "S181205ust", "Module:Centralizer update subtasks list", },
}
p.version = { -- Modules dependencies. Dependencias del módulo. Dépendances du module.
["versionName"] = "
["versionNumber"] = "1.0.0(
["versionDate"] = "2018-12-
["mainDescription"] = "Begin to use",
["functionDescription"] = "first functional support",
["taskDescription"] = "enough advanced to use in CentralSchool OK",
-- p_template_drop_box_name = 'Cuadro desplegable', -- Equivalent templates exist in other wikis
["sought"] = "
["known"] = "
["treebranches"] = { --
{ "
{ "Centralizer/I18N", "Central-s-fr", "Central-
{ "Mathroman22", "Mathroman34" }, -- lower
}
Ligne 185 ⟶ 186 :
mathroman.infos = { -- from 20130312
["libname"] = "mathroman", typ = "Library",
libdesc = "The Library:mathroman converts roman to
versfirst = "130312.12:00", verslast = "171221.07:43",
versions = {
Ligne 942 ⟶ 943 :
activity.report_subtasks_list = { -- List of subtasks to report. See "NOWNOW", update
{ "---", "---", "---", "---", "---", "DUPLICATE NOW, in change", },
-- res = res .. drop_box.new(selector, "versions_antiCrash_tests_title", versions.anti_crash_tests ) -- Tests antiCrash() -- to_debug_on_20170507
{ "
{ "
{ "
{ "20190220", "20190225", "todo", "Rical", "S190220obv", "make object viewers.boxviews.form(cssView) from DropBox guided by tables", },
{ "20190217", "20190220", "todo", "Rical", "S190217TMD", "propose Template.DropBox and Module.DropBox to replace Drop-down box, Caja desplegable,Boîte déroulante", },
{ "20190212", "20190217", "todo", "Rical", "S190212eli", "easy https://en.wikisource.org/wiki/Template:Lorem_ipsum", },
{ "20190210", "20190212", "todo", "Rical", "S190210acr", "debug versions.anti_crash() using pcall in modes(frame) + tests", },
{ "20190208", "20190210", "todo", "Rical", "S190208uPD", "PageData change in datas.update_PageData(t) admin only activity.MW_Versions_report T163923+T168726 IF AVAILABLE", },
-- see 4.2 Paramètre "wikidata" https://fr.wikipedia.org/wiki/Aide:Infobox_en_Lua#Param.C3.A8tre_.22wikidata.22
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "
--
-- Automatic shift of below "todo" subtasks.
Ligne 1 083 ⟶ 1 079 :
ccc = {}, -- To communicate and compute between cases
rowGroup = {},
-- track_on == "details",
}
local function tab_view_rough_shifter(tab_view) -- Monitor and shift tasks.
Ligne 1 389 ⟶ 1 386 :
headers_class = "wikitable alternative center sortable",
rowGroup = {},
}
-- from MediaWiki 1.30.0-wmf.4 (3248a17) 22:41, 7 June 2017
Ligne 1 877 ⟶ 1 874 :
end -- local one_arg = function datas.one_prop(one_arg) -- Get datas from mwwikibase for one property of the page.
function datas.get_item(args_known, QITEM) -- Get datas from mw.wikibase for the page. LVAMQDR
-- from 2016-08-16 ModuleCentral 3a lua_table.to_list.lua
local args_known = args_known or modes.args_known or p.args_known or {} -- optional value from p.args_known = {...}
Ligne 2 007 ⟶ 2 004 :
headers = "key;val",
rowGroup = {},
-- track_on == "details",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 2 482 ⟶ 2 480 :
headers_class = "wikitable alternative center sortable",
rowselect = selector,
rowGroup = {},
-- track_on == "details",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 2 626 ⟶ 2 625 :
return t
end -- function langs.main_i18n_languages_list()
function langs.init_content_page_user_lang(content_lang, page_lang, user_lang)
Ligne 2 685 ⟶ 2 680 :
{ content_lang = "fr", user_lang = "es", sought = "tests", },
},
headers = "langs_selectLang_test_headers",
-- headers = "Wiki language; User language; Sought language; Selected language; Example",
rowGroup = {},
-- track_on == "details",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 2 831 ⟶ 2 828 :
kind = "projects", -- MediaWiki or projects
typ = "err",
rowGroup = {},
-- track_on == "details",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 2 942 ⟶ 2 940 :
kind = "projects", -- MediaWiki or projects
typ = "err",
rowGroup = {},
-- track_on == "details",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 3 027 ⟶ 3 026 :
headers = " lang; isTag; isLang; isBuilt; langname; native ", --
rowGroup = {},
-- track_on == "details",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 3 037 :
-- local isLang = mw.language.isSupportedLanguage(lang)
local isBuilt = mw.language.isValidBuiltInCode(lang)
return { lang, isTag, tostring(isLang), isBuilt, langname, native, }
end
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
Ligne 3 374 ⟶ 3 373 :
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = {
-- { "Simple table", { 123, "abc", ["key"] = "txt" }, },
-- { "All types transmited", { "name", 111, true, false, { 789, "xyz"}, function()end }, },
-- { "10 values in the table", { "a", "b", "c", "d", "e", "f", "g", "h", "i9", "j10" }, },
{ "Any number of values", { "a", "b", "c", "d", "e", "f", "g", "h", }, },
},
title_memo = "luaTable_toList_tests_title", -- "lua_table.to_list() Return a list from a Lua table.",
headers = "luaTable_toList_tests_headers", -- "Tested case; Input table, rough_view; Output list",
headers_class = "wikitable alternative center sortable",
rowGroup = {},
-- track_on == "details",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 3 431 ⟶ 3 430 :
headers = "langs_selectLang_test_headers", -- "stringList; pattern; plain; result"
headers = "stringList; pattern; plain; result",
rowGroup = {},
-- track_on == "details",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 3 647 ⟶ 3 648 :
headers = "luaTables_count_all_types_values_headers", -- "Tested case; Input table, rough_view; Output list",
headers = "Tested table; Function to count; Kind of count; Resulting counts",
rowGroup = {},
-- track_on == "details",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup RIC05900470
Ligne 4 191 ⟶ 4 194 :
return v, errs
end -- v, errs = mathroman.int2roman(int) -- Convert an integer to a roman number
mathroman.int2romanTests = { -- Autotest cases to validate the mathroman library at MediaWiki level.
-- each test_case defines a name, a function, an input, an output. See also viewers.strTestCase. 8 - 1 = 7 + 8 = 15 cases
{ ["int"] = -10, ["expect"] = "X", ["reason"]
{ ["int"] = 0, ["expect"] = "0", ["reason"]
{ ["int"] = 1, ["expect"] = "I", ["reason"]
{ ["int"] = 11, ["expect"] = "XI", ["reason"]
{ ["int"] = 111, ["expect"] = "CXI", ["reason"]
{ ["int"] = 1111, ["expect"] = "MCXI", ["reason"]
{ ["int"] = "19", ["expect"] = "IXX", ["reason"] = "Forbiden string value" }, -- "
{ ["int"] = 4999, ["expect"] = "MMMMCMXCIX"
{ ["int"] = 5000, ["expect"] = "0", ["reason"]
}
Ligne 4 211 ⟶ 4 215 :
function mathroman.int2roman_test(t) -- Unitary tests of mathroman.int2roman
local memo = viewers.save_configs("mathroman.int2roman_test") -- Save global configuration before eventual changes.
local t = t or "\n* <b>mathroman.int2roman(t)</b> Test
local group = {}
for i, one_test in pairs(mathroman.int2romanTests) do -- apply the tests cases
one_test["result"], one_test["errs_rom"] = mathroman.int2roman(one_test
one_test["val_int"], one_test["err_int"] = mathroman.roman2int(one_test["result"]) -- DEBUG : function mathroman.roman2int() can fail without blocking page.
one_test["errors"] = one_test["errs_rom"] .. ", " .. one_test["err_int"]
t = t .. "\n* one_test : " .. viewers.ta("integer input", one_test["int"] ) .. viewers.ta("expected", one_test["expect"] ) .. viewers.ta("roman result", one_test["result"] )
table.insert(group, one_test)
end
local tab_view = { -- Group datas and options for a table view with lines and columns.
title_memo = "mathroman_int2roman_test_title", -- "mathroman.int2roman() Test
test_group = group,
form_one_case = function(case) -- Convert a case from test_group to rowGroup.
return { case["int"], tostring(case["result"]), tostring(case["expect"]), case["errors"], case["reason"], }
end,
headers = "mathroman_int2roman_tests_headers", -- "Digital number; Roman value; Correct; Error(s)"
headers = "roman input; resulting roman; expected; errors; reason", -- to try
headers_class = "wikitable alternative center sortable",
rowGroup = {},
-- track_on == "details",
}
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
Ligne 4 306 ⟶ 4 312 :
mathroman.roman2intTests = { -- Autotest cases to validate the mathroman library at MediaWiki level.
-- each test_case defines a name, a function, an input, an output. See also viewers.strTestCase. 6 cases
{ ["rom"] = "-X", ["expect"] = 10, ["reason"] = "
{ ["rom"] = "0", ["expect"] = 0, ["reason"] = "Forbiden null value" },
{ ["rom"] = "XIA", ["expect"] = 11, ["reason"] = "character A in 3" },
{ ["rom"] = "", ["expect"] = 0, ["reason"] = "empty value" },
{ ["rom"] = "MCXI", ["expect"] = 1111, ["reason"] = "normal integer decreasing" },
{ ["rom"] = "
{ ["rom"] = "
{ ["rom"] = "XJI", ["expect"] = 12, ["reason"] = "
{ ["rom"] = "VLD", ["expect"] = 445, ["reason"] = "normal integer decreasing" },
{ ["rom"] = "IXC", ["expect"] = 89, ["reason"] = "null value" },
{ ["rom"] = "MMMMCMXCIX", ["expect"] = 4999, ["reason"] = "Highter limit of classic roman numbers" },
{ ["rom"] = "MMMMM", ["expect"] = 5000, ["reason"] = "
{ ["rom"] = "MMMMMYJXC", ["expect"] = 5089, ["reason"] = "
}
function mathroman.roman2int_tests(t) -- Tests of main central modules -- S170606rmn
local memo = viewers.save_configs("mathroman.roman2int_tests") -- Save global configuration before eventual changes.
local t = t or "\n* <b>mathroman.roman2int(t)</b> Test roman to
local group = {}
for i, one_test in pairs(mathroman.roman2intTests) do -- apply the tests cases
one_test["result"], one_test["err_int"] = mathroman.roman2int(one_test
one_test["val_rom"], one_test["errs_rom"] = mathroman.int2roman(one_test["result"]) -- DEBUG : function mathroman.roman2int() can fail without blocking page.
one_test["errors"] = one_test["err_int"] .. ", " .. one_test["val_rom"]
t = t .. "\n* one_test : " .. viewers.ta("roman input", one_test["rom"] ) .. viewers.ta("expected", one_test["expect"] ) .. viewers.ta("roman result", one_test["result"] )
table.insert(group, one_test)
end
local tab_view = { -- Group datas and options for a table view with lines and columns.
title_memo = "mathroman_roman2int_tests_title", -- "mathroman.roman2int() Test roman to
test_group = group,
form_one_case = function(case) -- Convert a case from test_group to rowGroup.
return { case["rom"], case["result"], case["expect"], case["errors"], case["reason"], }
end,
headers = "mathroman_roman2int_tests_headers", -- "Roman number; Digital value; Correct; Error(s)"
headers = "roman input; resulting integer; expected; errors; reason", -- to try
headers_class = "wikitable alternative center sortable",
rowGroup = {},
-- track_on == "details",
}
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
Ligne 5 201 ⟶ 5 209 :
-- - - - ------------------ - - - - ---------------------------------
modes.options_for_modes = { -- default options_for_modes LVAMQDR
["read"] = " box1 ",
["edit"] = " box1 docdef docline docsrc docdata catview docview : ",
Ligne 5 262 ⟶ 5 270 :
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = args_known,
form_one_case = function(case) -- Convert a case from test_group to rowGroup.
return { viewers.value(case.key), case.bind, case.typ, case.need, case.keyword, case.prop, case.format, }
Ligne 5 270 ⟶ 5 277 :
headers = "modes_bind_args_known_report_headers",
headers = "key;bind;typ;need;keyword;prop;format",
rowGroup = {},
-- track_on == "details",
}
t = t .. "<br/>" .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
Ligne 5 298 ⟶ 5 307 :
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = args_group, -- tab_view.test_group or
title_memo = "modes.args_known_report(t) Report of main known args. **",
title_memo = "modes_args_known_report_title", -- "modes.args_known_report(t) Rapport des principaux arguments connus.",
Ligne 5 305 ⟶ 5 313 :
return { (case.keyword), (case.val or "-"), case.typ, case.need, case.keyword, case.syn, case.prop, case.format, case.src, }
end,
rowGroup = {},
-- track_on == "details",
}
t = t .. "<br/>" .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
Ligne 5 852 ⟶ 5 862 :
counts.known = counts.known+1 ; tt = tt .. viewers.ta(argmt.src, counts.known)
end
if
argmt.val =
counts[argmt.src] = counts[argmt.src]+1 ; tt = tt .. viewers.ta(argmt.src, counts[argmt.src])
end
Ligne 5 860 ⟶ 5 870 :
counts[argmt.src] = counts[argmt.src]+1 ; tt = tt .. viewers.ta(argmt.src, counts[argmt.src])
end
if
argmt.val =
counts[argmt.src] = counts[argmt.src]+1 ; tt = tt .. viewers.ta(argmt.src, counts[argmt.src])
end
Ligne 6 709 ⟶ 6 719 :
-- { "20181203", "20181204", "todo", "Rical", "S181203mad", "For 'Begin' rename function modes.get_args_datas( to modes.get_mode_args_datas( To simplify Central.init" },
-- function modes.get_mode_args_datas(args_known) -- S181203mad To simplify Central.init S181204SCi
function modes.get_args_datas(args_known) -- Applies the Tatic for (err, wng, cat) S181124Dng LVAMQDR
-- ["QITEM"] = { ["typ"] = "dat
-- datas.entity = mw.wikibase.getEntity(datas.QITEM or datas.default_item or "Q34743" ) -- Rudyard Kipling
-- Tactic : p.args_known redefines arguments from submodules then avoid their tactics.
Ligne 7 259 ⟶ 7 269 :
title_memo = "events_all_kinds_tests_title", -- "events.all_kinds_test() Test: all kinds of events (err, wng, cat)",
headers = "events_all_kinds_tests_headers", -- "typ;key;idargs;result",
rowGroup = {},
-- track_on == "details",
}
function tab_view.form_one_case(evt) -- Convert a case from test_group to rowGroup.
Ligne 7 796 ⟶ 7 808 :
headers = " insub; sub; sought; known; errors ",
headers_class = "wikitable alternative center sortable",
-- track_on == "details",
}
--
Ligne 8 202 ⟶ 8 215 :
end
function versions.setup_central_libraries(bindable_libraries, opt) -- LVAMQDR Install central bindable libraries in package.loaded
-- Record centralisable libraries if they are not included in standard mw.Extension:Scribunto
-- RunOnce : Do not repeat this function to not disturb subsequent processes.
Ligne 8 354 ⟶ 8 367 :
headers = "module; arg; change; results; errors", -- "OK or error/s"
rowGroup = {},
-- track_on == "details",
}
-- Runs tests cases and formats a table view with lines and columns.s
Ligne 8 449 ⟶ 8 462 :
headers = "versions_sort_central_modules_headers", -- "Title; Version; Date; Translations / Languages",
form_elem_detail = "versions_sort_central_modules_counts", -- "this + %2/%3 T/L, "
rowGroup = {},
-- track_on == "details",
}
function tab_view.form_one_case(get) -- Convert a case from test_group to rowGroup.
Ligne 8 481 ⟶ 8 496 :
-- function versions.init(frame, mode_name, args_known, options_for_modes, QITEM)
function versions.init(frame, Central_version, mode_name, args_known, options_for_modes, QITEM) -- LVAMQDR
-- Initializes translations, bind_libraries, bind_sub_modules, get arguments, modes, options.
-- Imports arguments from wikidata, module and template with increasing priorities.
Ligne 8 576 ⟶ 8 591 :
headers = "versions_versions_management_headers", -- "sought; versions; process; comments",
headers_class = "wikitable alternative center sortable",
-- track_on == "details",
}
function tab_view.form_one_case(vers_test) -- Convert a case from test_group to rowGroup.
Ligne 9 821 ⟶ 9 837 :
keys = "name;args;expect;result;errors",
rowGroup = {},
-- track_on == "details",
}
-- Runs tests cases and formats a table view with lines and columns.s
Ligne 10 045 ⟶ 10 061 :
-- headers_class = "wikitable alternative center sortable",
rowGroup = {},
-- track_on == "details",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 10 117 ⟶ 10 134 :
-- headers_class = "wikitable alternative center sortable",
rowGroup = {},
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 10 268 ⟶ 10 285 :
end
local dropbox_title = 'Drop-down box' -- Modèle:Boîte déroulante for drop_box.form
local dropbox_title = viewers.form9content('p_template_drop_box_name')
local dropbox_title = 'Boîte déroulante' -- Modèle:Boîte déroulante for Boîte déroulante
t = t .. mw.getCurrentFrame():expandTemplate{ title = dropbox_title, args = {
["label"] = d.label, ["titre"] = d.title, ["contenu"] = d.content,
Ligne 10 572 ⟶ 10 589 :
--
if not mask_sections then res = res .. viewers.doc_section(selector, "Library:langs", "h3") end
res = res .. drop_box.new(selector, "langs_translations_counts_title", langs.translations_counts) -- S170618ltc
-- res = res .. drop_box.new(selector, "langs_changing_translations_title", langs.changing_translations) -- no tabview
Ligne 10 718 ⟶ 10 735 :
if modes.option("tests") then -- or (modes.args_final.mode == "tests") --
res = res .. viewers.doc_group("allwaysview") -- viewers.doc_group(selector, mask_sections) -- To enforce title of sections
-- res = res .. viewers.doc_page("allwaysview") -- included in viewers.doc_group -- mask for time limit
-- res = res .. viewers.doc_module("allwaysview") -- included in viewers.doc_group -- mask for time limit
-- res = res .. viewers.doc_internal("allwaysview") -- included in viewers.doc_group -- mask for time limit
res = res .. versions.running_times(false, "") -- always wiew in tests
end
viewers.restore_configs(memo, "p.form_result") -- Restore global configurations after eventual changes.
Ligne 11 179 ⟶ 11 196 :
-- - - - ------------------ - - - - ---------------------------------
p.args_known = { -- Table of the definitions of all known arguments at module level. LVAMQDR
-- Arguments in order without names, with their keyword for use as other arguments.
-- Arguments dans l'ordre, non nommés, avec leur keyword pour traitement comme les autres arguments.
-- Tactic to integer i18n translations following a list of sub-modules: modules_guide with their own translations.
-- Tactic to integer default arguments values: defaults values are always from Centralizer.
Ligne 11 192 ⟶ 11 206 :
-- Special arguments to modify the fonctions and outputs of this module.
-- Arguments speciaux pour modifier le fonctionnement et les sorties de ce module.
["itemid"] = { ["typ"] = "config",
-- datas.entity = mw.wikibase.getEntity(datas.QITEM or datas.default_item or "Q34743" ) -- Rudyard Kipling
-- All arguments have a keyword identical to the registration name, except synonyms.
-- Tous les arguments ont un keyword identique au nom d'enregistrement, sauf les synonymes.
["
["
["
["
["
["
["
["
["
["
["
["
["
["
["
["
["
["
["
["itemid"] = { ["typ"] = "dat", ["keyword"] = "itemid", ["prop"] = "itemid", ["prop_default"] = "Q307", }, -- Galilée
-- Galilée (Q307), Victor Hugo (Q535), Aristote (Q868), Albert Einstein (Q937), Mohandas Karamchand Gandhi (Q1001), Christophe Colomb (Q7322),
-- Nelson Mandela (Q8023), Rudyard Kipling (Q34743), Martin Fleischmann (Q899264), Emmanuel Macron (Q3052772)
["sitelink"] = { ["typ"] = "dat
["uri"] = { ["typ"] = "dat
["sex"] = {["keyword"] = "sex", ["typ"] = "dat", ["need"] = "default", ["prop"] = "P21",
["arg_values"] = "sex_values", ["key_values"] = "male;femelle", ["prop_default"] = "male", }, -- wiki_selectors
["region"] = {["keyword"] = "region", ["typ"] = "dat", ["need"] = "default", ["prop_default"] = "England",
["arg_values"] = "region_values", ["key_values"] = "other;china;india;century", ["prop"] = "uri", }, -- wiki_selectors
["rights"] = {["keyword"] = "rights", ["typ"] = "dat", ["need"] = "default",
["arg_values"] = "rights_values", ["key_values"] = "no;none;ONU;none;cn;50;us;70;mpf", ["prop_default"] = "cn",-- wiki_selectors
["delay_values"]= "0;0;0;0;50;50;70;70;95", ["arg_uses"] = "none;none;none;none;cn;cn;us;us;mpf", ["prop_default"] = "cn" }, -- wiki_selectors
["args_known_monument"] = { ["typ"] = "dat", ["need"] = "noevent", ["keyword"] = "args_known_monument", ["prop"] = "P18", ["prop_default"] = "St Paul Cathedral.png", },
["labelbylang"] = { ["typ"] = "dat", ["need"] = "noevent", ["keyword"] = "labelbylang", ["prop"] = "P18", ["prop_default"] = "en", },
-- mw_wikibase_country = "England", -- English
-- mw_wikibase_flag = "England in the UK and Europe.svg", -- English
Ligne 11 475 ⟶ 11 490 :
function Central.init(frame, Central_version, mode_name, args_known, options_for_modes)
-- LVAMQDR for Args = p.args_known = {...}, Datas = function datas.get_item(args_known, QITEM), Libraries = Install central bindable libraries,
-- Modes = modes.options_for_modes = {...}, Versions = function versions.init(frame, ...) Initializes versions
-- p.version.versionNumber = CentralI18N.version.versionNumber
local res = "\n* Central.init(frame, Central_version, mode_name, args_known, options_for_modes)<br>"
local args_known = args_known or modes.args_known or p.args_known or {} -- optional value from p.args_known = {...}
-- ["mode"] = { ["typ"] = "config", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
local mode_name = mode_name or modes.mode_name -- Selected by the ["mode"] argument.
langs.Central_version = Central_version or langs.Central_version or Central.Central_version_name
if type(lang) == "content" then t = viewers.form9content(key_form, subnames, strings_c, tables_c) end
if type(langs.Central_version ~= "string") then langs.Central_version = (p.version["versionName"] .. " " .. p.version["versionNumber"] ) end -- Adapt to actual wiki as default
local options_for_modes = options_for_modes or modes.options_for_modes or p.options_for_modes
res = res .. versions.init(frame, langs.Central_version) -- function versions.init(
versions.memo_i18n = mw.clone(versions.main_i18n or langs.main_i18n)
langs.main_i18n = versions.memo_i18n
res = res .. modes.init_modes_translate_events(frame, langs.Central_version, mode_name, modes.args_known, options_for_modes, QITEM or itemid)
modes.frame = mw.getCurrentFrame()
-- ["mode"] = { ["typ"] = "config", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
modes.init_args_mode_options(mix, mode_name, modes.args_template) -- Import and mix args mode and options from template and invoke
modes.args_final = modes.import_arguments(args_known, args_source, content_translations, args_wikidata) -- function modes.import_arguments()
-- ["itemid"] = { ["typ"] = "config", ["keyword"] = "itemid", ["prop_default"] = "Q307", }, -- Galilée
-- datas.entity = mw.wikibase.getEntity(datas.QITEM or datas.default_item or "Q34743" ) -- Rudyard Kipling
datas.props = datas.get_item(args_known, QITEM) -- Get datas from mw.wikibase for the page.
-- local datas = mw.clone(datas) modes.get_args_datas
-- ["image"] = { ["typ"] = "dat", ["keyword"] = "image", ["prop"] = "P18", },
args_known = modes.get_args_datas(args_known) -- Applies the Tatic for (err, wng, cat) S181124Dng
modes.get_args(args_known) -- Interactions between arguments
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang()
res = res .. (datas.props_trk or "")
res = res .. "</b>"
-- p.version.versionNumber = CentralI18N.version.versionNumber
return res
end -- function Central.init(frame, Central_version, mode_name, args_known, options_for_modes)
-- LVAMQDR = Librairies Versions Args Mode Item Datas Results:
-- function modes.Librairies_Versions_Args_Mode_Item_Datas_Results(args_known) for function Central.init(
function modes.Librairies_Versions_Args_Mode_Item_Datas_Results(frame, mode_name, args_known, options_for_modes, QITEM) -- LVAMQDR replaces function Central.init( code
-- Central.init(frame, mode_name, args_known, options_for_modes, QITEM) -- LVAMQDR Typical call
local res = ""
local bindable_libraries = bindable_libraries or versions.bindable_libraries or {} -- optional value from p.args_known = {...}
versions.setup_central_libraries(bindable_libraries, opt) -- L in LVAMQDR Install central bindable libraries in package.loaded
-- versions.bindable_libraries = { -- New libraries to record in package.loaded[]
-- ["activity"] = "The <b>activity</b> library supports Lua-coders sub-tasks for central modules in international interactions.", }
local args_known = args_known or modes.args_known or p.args_known or {} -- A in LVAMQDR Arguments definitions at module level p.args_known = {...}
versions.init(frame, Central_version, mode_name, args_known, options_for_modes, QITEM) -- V in LVAMQDR
local options_for_modes = options_for_modes or modes.options_for_modes or {} -- M in LVAMQDR or {} -- optional value from p.args_known = {...}
modes.options_for_modes = options_for_modes
versions.memo_i18n = mw.clone(versions.main_i18n or langs.main_i18n)
langs.main_i18n = versions.memo_i18n ; versions.main_i18n = versions.memo_i18n
-- local datas = mw.clone(datas) modes.get_args_datas
res = res .. modes.init_modes_translate_events(frame, Central_version, mode_name, modes.args_known, options_for_modes, QITEM or itemid)
datas.props = datas.get_item(args_known, QITEM) -- Get datas from mw.wikibase for the page.
args_known = modes.get_args_datas(args_known) -- Applies the Tatic for (err, wng, cat) S181124Dng
modes.get_args(args_known) -- Interactions between arguments
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang()
modes.args_final = modes.import_arguments(args_known, args_source, content_translations, args_wikidata) -- function modes.import_arguments()
modes.init_args_mode_options(mix, mode_name, modes.args_template) -- Import and mix args mode and options from template and invoke
langs.Central_version = Central_version or langs.Central_version or Central.Central_version_name
return res
end
function Central.init(frame, Central_version, mode_name, args_known, options_for_modes)
-- LVAMQDR for Args = p.args_known = {...}, Datas = function datas.get_item(args_known, QITEM), Libraries = Install central bindable libraries,
-- Modes = modes.options_for_modes = {...}, Versions = function versions.init(frame, ...) Initializes versions
-- p.version.versionNumber = CentralI18N.version.versionNumber
local options_for_modes = options_for_modes or modes.options_for_modes or p.options_for_modes
local res = "\n* Central.init(frame, Central_version, mode_name, args_known, options_for_modes)<br>"
res = res .. versions.init(frame, Central_version) -- function versions.init(
versions.memo_i18n = mw.clone(versions.main_i18n or langs.main_i18n)
langs.main_i18n = versions.memo_i18n ; versions.main_i18n = versions.memo_i18n
Ligne 11 493 ⟶ 11 567 :
modes.get_args(args_known) -- Interactions between arguments
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang()
res = res .. (datas.props_trk or "")
res = res .. "</b>"
-- p.version.versionNumber = CentralI18N.version.versionNumber
return res
end -- function Central.init(frame, Central_version, mode_name, args_known, options_for_modes)
function Central.init(frame, Central_version, mode_name, args_known, options_for_modes)
-- LVAMQDR for Args = p.args_known = {...}, Datas = function datas.get_item(args_known, QITEM), Libraries = Install central bindable libraries,
-- Modes = modes.options_for_modes = {...}, Versions = function versions.init(frame, ...) Initializes versions
-- p.version.versionNumber = CentralI18N.version.versionNumber
local options_for_modes = options_for_modes or modes.options_for_modes or p.options_for_modes
local res = "\n* Central.init(frame, Central_version, mode_name, args_known, options_for_modes)<br>"
res = res .. modes.Librairies_Versions_Args_Mode_Item_Datas_Results(frame, mode_name, args_known, options_for_modes, QITEM) -- LVAMQDR replaces function Central.init( code
-- local datas = mw.clone(datas) modes.get_args_datas
-- datas.props = datas.get_item(args_known, QITEM) -- Get datas from mw.wikibase for the page.
res = res .. (datas.props_trk or "")
res = res .. "</b>"
Ligne 11 504 ⟶ 11 593 :
local t = Central.init(frame, Central.Central_version_name, "read", p.args_known, p.options_for_modes)
-- res = res .. t
res = res .. p.form_result(modes.args_final)
res = res .. "\n* " .. datas.track_val
Ligne 11 515 ⟶ 11 604 :
local t = Central.init(frame, Central.Central_version_name, "edit", p.args_known, p.options_for_modes)
-- res = res .. t
res = res .. p.form_result(modes.args_final)
return res
Ligne 11 717 ⟶ 11 806 :
local res = ""
res = res .. viewers.doc_section(selector, "Tests of this page", "h2", mask_sections)
-- res = res .. drop_box.new(selector, "activity_report_subtasks_title", activity.central_subtasks_report) -- to try if needed
res = res .. viewers.doc_internal(selector, mask_sections) -- function viewers.doc_internal(selector, mask_sections)
-- res = res .. versions.running_times(false, "")
return res
|