« Module:Multilingual » : différence entre les versions

Contenu supprimé Contenu ajouté
ModuleCentralizer langs.list_MediaWiki_languages() OK 20181225 0200.lua
MdCentral lua_table.to_list_tests(t) hard bug table structure 190108 1000.lua
Ligne 1 :
local p = {}
local p = {} -- The main central module install central libraries and bind the main and its sub-modules
-- The main central module is mainly an installer of central libraries and a small demonstrator.
local Central = p -- Save as ModuleCentralizer.lua ModuleCentralizer replace template's display to their names 20181224 0227.lua
-- The main central module installs central libraries and bind the main and its sub-modules
--------------------------------------------------|------------------------ typical length --------------------------|-------max|
local Central = p -- Save as MdCentral.lua MdCentral lua_table.to_list_tests(t) hard bug table structure 190107 2250.lua
------------------------------------------|------------------------ typical length --------------------------|----------max| DODO
-- update DONE+todo list at 190107 2150
 
-- DONE+todo mean : DODO is to do soon, this sub-task is already done MUMU = CentralManual.xml MWMW = report in versions.MediaWiki_Versions = {}
-- only for ModuleCentralizer : restart from an OK version and changes by small steps !
-- DONE+todo : referal version : ModuleCentralizer function modes.levenshtein_similar_tests OK.lua to complete. DODO
-- use : ModuleCentralizer S181222SCi=Simplify use init_central_module 20181221 OK.lua
-- DONE : events.events_group of one_event, new to add, build to results, events.formats() to list
-- DONE : normal table function p.Init_central_module_report
--
-- DONE+todo : in function p.Init_central_module() group only all sub-functions in the original order then delete duplicated one's
-- DONE+todo : alternate sub-functions and known_arguments changes,
-- DONE+todo : function modes.activate_known_arguments(known_arguments, phase) -- Update one_arg.val and one_arg.src in p.known_arguments{} DODO
-- todo : after tests or good report use function p.Init_central_module() to replace function Central.init()
-- todo : update "Module:Centralizer update subtasks list" OK on 20190106
-- todo : update activity.report_subtasks_list in Begin phase OK on 20190106
--
-- todo : to debug at 190107 2150
-- todo : function lua_table.to_list_tests(t) -- Return a list from a Lua table. unable debug table structure
-- todo : res = res .. drop_box.new(selector, "luaTable_toList_tests_title", lua_table.to_list_tests, { ["dropit"] = "dropit", arggg = "dropit" } ) unable debug table structure
-- todo : modes.activate_known_arguments() Valeurs des argument dans p.known_arguments{}. empty table well viewed
-- todo : res = res .. drop_box.new(selector, "modes_get_args_report_title", modes.activate_known_arguments_report) empty table well viewed
-- todo : only these 2 bugs at 190107 2126
 
-- DONE : no other bug
 
p.NOWNOW = { -- in work subtasks for replace on 20181205
{ "2018122520190120", "2018122620190101", "todo", "Rical", "S181227trbS190101cTD", "treebranchesAsk --a Forcentral eachTemplate:Dropbox sought.for Replaceall known.mediawikis Laterusers you and me. on 20181120720190101", },
{ "2018122420190120", "2018122420190120", "NOWdone", "Rical", "S181224rtnS181227trb", "ModuleCentralizertreebranches replace-- template'sFor displayeach tosought. theirReplace namesknown. inLater fr.wikipedia.orgon and fr.wikisouce.org201811207", },
{ "20190115", "20190120", "NOW", "Rical", "S181224rtn", "ModuleCentralizer replace template's display to their names in fr.wikipedia.org and fr.wikisouce.org", },
-- S181224rtn : a similar comportment suggest a change in MW"
-- S181224rtn : do not happened before the MediaWiki version "1.33.0-wmf.9 (02196d2)"
{ "2018122420190110", "2018122420190115", "NOWtodo", "Rical", "S181224ustS181222CrC", "Module:CentralizerCentralSchool: updatefinish subtasksreciprocal listadaptation with Module:Centralizer", },
{ "2018122220190109", "2018122520190109", "tododone", "Rical", "S181222CrCS181222SCi", "Module:CentralSchool:For finish'Begin' reciprocalSimplify adaptationfunction withCentral.init(frame, Module:Centralizer...) using function p.Init_central_module()", },
{ "20190108", "20190109", "todo", "Rical", "S181221oTc", 'others: ["Tactic"] = "canbenil;nevererror" ', },
{ "20181222", "20181222", "done", "Rical", "S181222SCi", "For 'Begin' Simplify function Central.init(frame, ...) using function p.init_central_module()" },
{ "2018122120190107", "2018122220190108", "todoNOW", "Rical", "S181221oTcS181220oso", 'others: ["Tactic"]select =only "canbenil;nevererror"sub-functions 'in the right order in function p.Init_central_module()", },
{ "2018122020190106", "2018122120190107", "NOWdone", "Rical", "S181220osoS181205mgT", "selectfunction onlymodes.get_args_datas_tests(t) sub-functionsTactic all in theone rightfor ordermodes inargs functiondatas p.init_central_module()no known_arguments no origins old", },
{ "2018122020190106", "2018122020190106", "NOW", "Rical", "S181220ust", "Module:Centralizer update subtasks list", }, -- search abnormal tests
-- DONE : drop_box.new(selector, "luaTable_toTable_tests_title", lua_table.to_table_test) OK
{ "20181205", "20181206", "done", "Rical", "S181205mgT", "function modes.get_args_datas_tests(t) Tactic all in one for modes args datas no known_arguments no origins old" },
} -- CCicalese_WMF removed a subtask: : Introduce a ContentStore service to allow certain types of content to not be stored as serialized blobs..
}
-- Authored By daniel, Jul 31 2015
-- ? a similar comportment suggest a change in MW, do not happened before the version ?
-- modif Nov 21 2018, 17:16
p.teststests = "not FAMLTVQDR"
 
-- function lua_table.to_list_tests(t)
-- Save as ModuleCentralizer.lua ModuleCentralizer events.all_kinds_test view all OK, use in properties.lua
-- ModuleCentralizer datas.available_props_report(t) Reports properties OK.lua 25 septembre 18 STOP TO SEARCH
 
p.teststests = "FAMLTVQDR"
 
p.version = { -- Modules dependencies. Dependencias del módulo. Dépendances du module.
["versionName"] = "Centralizer",
["versionNumber"] = "1.0.0(181224T02190106T16:0208)",
["versionDate"] = "20182019-1201-24T0206T16:0208:00", -- UTC version structure MWMW
["mainDescription"] = "Begin to use",
["functionDescription"] = "first functional support",
Ligne 77 ⟶ 105 :
activity = {} -- Library:activity from 20170611 Search story in Central modules.txt
-- args = {} -- Object:args from 20180106 form known arguments to import, complete from datas and finalize
boxviews = {} -- Object:boxviews from 20170723 in draft state
datas = {} -- Library:datas from ?
drop_box = {} -- Object:drop_box from 20170615 rename viewers.drop_box.form() in viewers.drop_box on 20170615
Ligne 92 ⟶ 119 :
viewers = {} -- Library:viewers from 20170209
-- versions.args = args -- Object:args from 20180106 todo
viewers.boxviews = boxviews -- Object:boxviews from 20170723 ok on
-- Records are in function versions.setup_central_libraries(bindable_libraries, opt) -- Install central bindable libraries in package.loaded
 
Ligne 193 ⟶ 219 :
mathroman.infos = { -- from 20130312
["libname"] = "mathroman", typ = "Library",
libdesc = "The Library:mathroman converts roman to integerdigital numbers and reverse. It also detects errors.",
versfirst = "130312.12:00", verslast = "171221.07:43",
versions = {
Ligne 258 ⟶ 284 :
{ "viewers", "The Library:viewer translates and formats strings to document texts and table views.", },
-- Objects have a function object.new() to form several objects.
-- { "boxviews", "The Object:boxviews, in the Library:viewers, formats boxes, their styles and structures.", },
{ "drop_box", "The Object:drop_box, in the Library:viewers, formats drop-boxes. It needs a local template installed with Centralizer.", },
{ "central_library","The Object:central_library, in the Library:versions, formats the basis of libraries and their properties.", },
Ligne 385 ⟶ 410 :
-- Pour traduire, ne traduisez pas des parties comme celles-ci : <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["docitem"] = "docitem",
["dockey"] = "dockey",
activity_description = "La Library:activity soutient la gestion des tâches de phabricator, des sous-tâches inter Lua-codeurs et des modules centraux interwikis.",
Ligne 401 ⟶ 427 :
activity_phabricator_tasks_headers = "Importance, modifiée le; Tâche; Etat; Titre",
activity_central_functions_report_title = "activity.central_functions_report(t) Lister les fonctions actuelles.",
activity_check_html_bold_tags_title = "activity.check_html_bold_tags() Signaler les déséquilibres des débuts et des fins de gras dans le code.",
activity_space_name_module = "Modulenn", -- br
activity_space_name_template = "Patrom",
Ligne 410 ⟶ 435 :
-- Modul:Central-s-de/Doku {{#invoke:Central-s-de|read}} de = German = Deutsch
["docfunc"] = "docfunc",
["docitem"] = "docitem",
["dockey"] = "dockey",
activity_description = "Das Library:activity Das Ding unterstützt das Management von phaborator-Aufgaben, von inter-Lua-Coder-Unteraufgaben und von interwikis-Zentralmodulen.",
Ligne 425 ⟶ 451 :
activity_phabricator_tasks_headers = "Wichtigkeit; modifiziert die; Aufgabe; Status; Titel",
activity_central_functions_report_title = "activity.central_functions_report(t) Listen Sie die aktuellen Funktionen auf.",
activity_check_html_bold_tags_title = "activity.check_html_bold_tags() Melden Sie Ungleichgewichte von Anfang und Ende von Fett im Code.",
activity_space_name_module = "Modul", -- de
activity_space_name_template = "Vorlage",
Ligne 435 ⟶ 460 :
-- To translate, do not translate parts like these: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["docitem"] = "docitem",
["dockey"] = "dockey",
activity_description = "The Library:activity supports the management of phabricator tasks, of inter Lua-coders sub-tasks, and of interwikis central modules.",
Ligne 451 ⟶ 477 :
activity_phabricator_tasks_headers = "Importance; modified on; Task; Status; Title",
activity_central_functions_report_title = "activity.central_functions_report(t) List actual functions.",
activity_check_html_bold_tags_title = "activity.check_html_bold_tags() Report imbalances of beginnings and ends of bold in code.",
activity_space_name_module = "Module", -- en
activity_space_name_template = "Template",
Ligne 461 ⟶ 486 :
-- To translate, do not translate parts like these: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["docitem"] = "docitem",
["dockey"] = "dockey",
activity_description = "La Library:activity soporta la gestión de tareas de phabricator, de sub-tareas inter Lua-coders, y de módulos interwikis centrales.",
Ligne 477 ⟶ 503 :
activity_phabricator_tasks_headers = "Importancia; modificado; Tarea; Estado; Título",
activity_central_functions_report_title = "activity.central_functions_report(t) Listar funciones actuales.",
activity_check_html_bold_tags_title = "activity.check_html_bold_tags() Informe los desequilibrios de los comienzos y los extremos de negrita en el código.",
activity_space_name_module = "Módulo", -- es
activity_space_name_template = "Modelo",
Ligne 487 ⟶ 512 :
-- Pour traduire, ne traduisez pas des parties comme celles-ci : <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["docitem"] = "docitem",
["dockey"] = "dockey",
activity_description = "La Library:activity soutient la gestion des tâches de phabricator, des sous-tâches inter Lua-codeurs et des modules centraux interwikis.",
Ligne 503 ⟶ 529 :
activity_phabricator_tasks_headers = "Importance, modifiée le; Tâche; Etat; Titre",
activity_central_functions_report_title = "activity.central_functions_report(t) Lister les fonctions actuelles.",
activity_check_html_bold_tags_title = "activity.check_html_bold_tags() Signaler les déséquilibres des débuts et des fins de gras dans le code.",
activity_space_name_module = "Module", -- fr
activity_space_name_template = "Modèle",
Ligne 513 ⟶ 538 :
-- To translate, do not translate parts like these: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["docitem"] = "docitem",
["dockey"] = "dockey",
activity_description = "A Library:activity a phabricator feladatok kezelését, az inter Lua-kódoló al-feladatok és az interwikis központi modulok kezelését.",
Ligne 529 ⟶ 555 :
activity_phabricator_tasks_headers = "Fontosság; módosította; a Feladat; Állapot; Cím",
activity_central_functions_report_title = "activity.central_functions_report(t) Listázza az aktuális funkciókat.",
activity_check_html_bold_tags_title = "activity.check_html_bold_tags() Jelentés a merész kódok kezdetének és végének egyenlőtlenségeiről.",
activity_space_name_module = "Modul", -- hu
activity_space_name_template = "Sablon",
Ligne 538 ⟶ 563 :
-- To translate, do not translate parts like these: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["docitem"] = "docitem",
["dockey"] = "dockey",
activity_central_library_description = "Điều này Library:activity hỗ trợ việc quản lý các công việc để nhà phân tích, các nhiệm vụ phụ liên Lua-coders, và các mô-đun trung tâm liên thông.",
Ligne 553 ⟶ 579 :
activity_phabricator_tasks_headers = "Tầm quan trọng; sửa đổi; nhiệm vụ; tình trạng; tiêu đề",
activity_central_functions_report_title = "activity.central_functions_report(t) Liệt kê các chức năng hiện tại.",
activity_check_html_bold_tags_title = "activity.check_html_bold_tags() Báo cáo sự mất cân đối của các khởi đầu và kết thúc bằng chữ in đậm.",
activity_space_name_module = "Mô-đun", -- vi
activity_space_name_template = "Mẫu",
Ligne 804 ⟶ 829 :
ftd = ftd .. "events.add_cat;events.add_cat_group;events.add_err;events.add_wng;events.all_kinds_test;"
ftd = ftd .. "events.categories_lister;events.errors_lister;events.gener_categories;"
ftd = ftd .. "langs.dummy_languages;langs.init_content_page_user_lang;langs.list_MediaWiki_languages;langs.list_MediaWiki_languagesmain_i18n_languages_list;"
ftd = ftd .. "langs.missing_translations;langs.translations_counts;"
ftd = ftd .. "lua_table.count_all;lua_table.count_tests;lua_table.count_types;lua_table.count_values;"
Ligne 812 ⟶ 837 :
ftd = ftd .. "lua_table.to_list;lua_table.to_list_tests;lua_table.to_table;lua_table.to_table_test;"
ftd = ftd .. "mathroman.int2roman;mathroman.int2roman_test;mathroman.roman2int;mathroman.roman2int_tests;"
ftd = ftd .. "modes.all_categories_list;modes.all_errors_list;modes.get_argsactivate_known_arguments;modes.get_args_reportactivate_known_arguments_report;modes.get_default_args;modes.levenshtein;"
ftd = ftd .. "modes.multiple_selection_tests;modes.options_from_args_tests;modes.recursive_normal;modes.recursive_normal_tests;modes.similar_args_list;"
ftd = ftd .. "tableview.form_one_case;tableview.new;"
Ligne 821 ⟶ 846 :
ftd = ftd .. "viewers.form_image;viewers.is_in;viewers.is_in_sp;viewers.main_view;viewers.restore_configs;lua_table.rough_view;"
ftd = ftd .. "lua_table.rough_view_test;viewers.save_configs;viewers.save_restore_balance_report;viewers.simple_list;"
ftd = ftd .. "viewers.simple_list_test;viewers.styles_small_caps;viewers.ta;viewers.tam;viewers.table_col;viewers.table_dat;"
ftd = ftd .. "viewers.table_end;viewers.table_head;viewers.table_row;viewers.styles_color_add;viewers.styles_color_colargs;"
ftd = ftd .. "viewers.styles_color_delete;viewers.styles_color_discreet;viewers.styles_color_error;viewers.styles_color_mask;"
Ligne 937 ⟶ 962 :
end -- function activity.central_libraries_autodoc(t, sorted_functions)
 
activity.report_subtasks_list = { -- List of subtasks to report. See "NOWNOWNOW", update
-- Begin later below
--loadData
-- DUPLICATE NOWNOW, in change. toDoc
{ "---", "---", "---", "---", "---", "DUPLICATE NOW, in change", },
{ "20190203", "20190204", "NOW", "Rical", "S190102DDr", "Duplicate present dropboxes in a unic Template:Dropbox with redirection from previews one's like for pages", },
-- res = res .. drop_box.new(selector, "versions_antiCrash_tests_title", versions.anti_crash_tests ) -- Tests antiCrash() -- to_debug_on_20170507
{ "2018122020190203", "2018122120190204", "NOW", "Rical", "S181220osoS181101tgl", "selectBegin: onlytranslate sub-functionsby ingroups theof rightlanguages order: inlike functionfor p.init_central_module()viet, laos, cambodgia, allways with en, es, fr 1 days", },
{ "2018122020190203", "2018122020190204", "NOW", "Rical", "S181220ustS181101aip", "ModuleBegin:Centralizer updatewhen subtasks10 listused cases, announce that in the phabtask, then when 20, then for xmas 1 days", },
{ "20190126", "20190202", "NOW", "Rical", "S181023s7P", "Begin: search 7 Projects : MediaWikis wikidata wikipedia wikisource wikiquote ? 3 days", },
{ "20190126", "20190202", "NOW", "Rical", "S181023iLC", "Begin: Rical invite 7 Lua-coders : Tpt, Zolo, Od1n, Julien1978, Daehan, VIGNERON ? 3 days", },
{ "20190124", "20190126", "NOW", "Rical", "S181020umf", "update MediaWiki:Scribunto/Central manual for ;activity.phabricator_tasks_report;activity.rough_date_days;...", },
{ "20190122", "20190124", "NOW", "Rical", "S181018CrC", "Module:CentralSchool: finish reciprocal adaptation with Module:Centralizer", },
{ "20190121", "20190122", "NOW", "Rical", "S181016vap", "restore versions.anti_crash(frame) if not pcall() recursive in versions.tree_branch='v1;v2;v3' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_arg has a arg_default in p.known_args and a .delete = 'delete' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_data has a data_default in datas.known_datas and a .delete = 'delete' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_mode has a mode_default in modes.known_modes and a .delete = 'delete' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_version has a version_default in versions.version_args and a .delete = 'delete' ", },
-- function versioning.antiCrash(options, content_or_func, ...) -- Form the display of a running error. in ModuleCentral 20170902.ModuleCentral 2e no antiCrash ok.lua
{ "20190120", "20190120", "NOW", "Rical", "S190120mst", "update function tab_view.form_one_case + translate from multiple_selection_test1(...", },
{ "20190120", "20190120", "NOW", "Rical", "S190120rnt", "update function tab_view.form_one_case + translate from recursive_normal_test1(...", },
{ "20190120", "20190120", "NOW", "Rical", "S190120upt", "update activity.phabricator_tasks_report", },
{ "20190120", "20190120", "NOW", "Rical", "S190120ust", "Module:Centralizer update subtasks list", },
{ "20190115", "20190120", "NOW", "Rical", "S190115rtn", "ModuleCentralizer replace template's display to their names in fr.wikipedia.org and fr.wikisouce.org", },
-- S181224rtn : a similar comportment suggest a change in MW"
-- S181224rtn : do not happened before the MediaWiki version "1.33.0-wmf.9 (02196d2)"
{ "20190107", "20190108", "NOW", "Rical", "S181220oso", "select only sub-functions in the right order in function p.Init_central_module()", },
{ "20190106", "20190106", "NOW", "Rical", "S181220ust", "Module:Centralizer update subtasks list", }, -- search abnormal tests
--
-- Automatic shift of below "todo" subtasks.
{ "---", "---", "---", "---", "---", "Automatic shift of below todo subtasks", },
{ "2019022720190120", "2019022920190101", "todo", "Rical", "S190227imeS190101cTD", "includeAsk Luaa modulescentral inTemplate:Dropbox Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.lua,for seeall phabtaskmediawikis T41610users you and me. on 20190101", },
{ "2019022520190110", "2019022720190115", "todo", "Rical", "S190225vtgS181222CrC", "tryModule:CentralSchool: graphicsfinish inreciprocal viewers.try_graph()adaptation --with see MacronModule:Centralizer", },
{ "2019022020190108", "2019022520190109", "todo", "Rical", "S190220obvS181221oTc", 'others: ["makeTactic"] object= viewers.boxviews.form(cssView)"canbenil;nevererror" from DropBox guided by tables"', },
{ "2019021720180108", "2019022020180109", "todo", "Rical", "S190217TMDS180108wtd", "proposeRestore Template.DropBoxold andfunction Moduledatas.DropBox to replace Drop-down box, Caja desplegable,Boîte déroulantewikidata_time_details()", },
{ "2019021220180108", "2019021720180109", "todo", "Rical", "S190212eliS180108blg", "easyFor https://en.wikisource.org/wiki/Template:Lorem_ipsumeach wikidata search the better lang in userlang, userlang2, pagelang, contentlang", },
{ "2019021020180106", "2019021220180108", "todo", "Rical", "S190210acrS180106arg", "debugnew versions.anti_crash()Object:args usingform pcallknown inarguments modes(frame)to +import, complete from datas and testsfinalize", },
{ "2019020820171019", "2019021020171022", "todo", "Rical", "S190208uPDS171019ime", "PageDatainclude changeLua modules in datas.update_PageData(t)extensions adminlike only activityWikibase/client/includes/DataAccess/Scribunto/mw.MW_Versions_reportwikibase.lua, T163923+T168726see IFphabtask AVAILABLET41610.", },
{ "20171015", "20171018", "todo", "Rical", "S171015trk", "add a method tracker:trk(self, ...) from tracker.add(opt, ...). see Lua_reference_manual#Function_declaration_statements", }, --
-- see 4.2 Paramètre "wikidata" https://fr.wikipedia.org/wiki/Aide:Infobox_en_Lua#Param.C3.A8tre_.22wikidata.22
{ "2019020620171001", "2019020820171002", "todo", "Rical", "S190206actS170801cvG", "langs.abnormal_char_in_text()put failsMW toversions debugand Central versions in _G and CentralData", },
{ "2019020320171001", "2019020620171002", "todo", "Rical", "S190203cssS170801cCD", "useCreate ConventionalSpecial:PageData/CentralData css(change parametersfrom cssview in edit, content, drop_box, infobox, tableview ...MW only)", },
{ "2019020120171001", "2019020320171002", "todo", "Rical", "S190201uMDS170801cCD", "AfterCreate 'Begin'MediaWiki:Scribunto/CentralData fully(change usefrom Module:drop_boxadmin from es.wikipedia.org/wiki/Módulo:Lista_plegableonly)", },
{ "2019013120171001", "2019020120171002", "todo", "Rical", "S190131ilpS170801cCD", "After 'Begin' T20180621 Enough informCreate Central/PageData/CentralData modules for jumps(change tofrom lang.projectany URI.user)", },
{ "2019012920170915", "2019013120170917", "tododone", "Rical", "S190129alpS170915ajb", "Afterphabtask 'Begin'extend T20180621tests_groups.subdiffs() Automaticto adapt Central modules for langlua_table.project URItrees.all_jobs", },
{ "2019012820170910", "2019012920170914", "todo", "Rical", "S190128rlvS170910wpw", "AfterUse: 'Begin'wikidata Fully= update{ CentralManual.xmlproperty Tactic, func names= 'P84',... syntax like {{Wikidata}} for wikidata", },
{ "20190126", "20190127", "todo", "Rical", "S190126vdf", "debug function versions.deprecated_function() nil table : mask it on 20180306", },
{ "20190123", "20190126", "todo", "Rical", "S190123icc", "Begin: begin to integrate changes from other coders", },
{ "20190122", "20190123", "todo", "Rical", "S190122icc", "Begin: update important Phabricator tasks to activate their availability", },
{ "20190121", "20190122", "todo", "Rical", "S190121cJP", "Begin: informs public Lua-coders Utilisateur:JackPotte [[:fr:Utilisateur:JackPotte|JackPotte fr de es en]]", },
{ "20190120", "20190121", "todo", "Rical", "S190120iTN", "Begin: inform [https://meta.wikimedia.org/wiki/Tech/News#contribute Tech News] about central modules begin phase", },
{ "20190119", "20190120", "todo", "Rical", "S190119tgl", "Begin: translate by groups of languages : like for viet, laos, cambodgia, allways with en, es, fr 1 days", },
{ "20190118", "20190119", "todo", "Rical", "S190118atr", "Begin: Ask translations in meta [https://meta.wikimedia.org/wiki/Translation_requests Translation_requests]", },
{ "20190129", "20190205", "todo", "Rical", "S190129aip", "Begin: when 20 used cases, announce that in the phabtask", },
{ "20190122", "20190129", "todo", "Rical", "S190122aip", "Begin: when 10 used cases, announce that in the phabtask", },
{ "20190115", "20190122", "todo", "Rical", "S190115s7P", "Begin: search 7 Projects : MediaWikis wikidata wikipedia wikisource wikiquote ? 3 days", },
{ "20190108", "20190115", "todo", "Rical", "S190108iLC", "Begin: Rical invite 7 Lua-coders : Tpt, Zolo, Od1n, Julien1978, Daehan, VIGNERON ? 3 days", },
{ "20190106", "20190108", "todo", "Rical", "S190106uCM", "For 'Begin' update CentralManual.xml Tactic, func names ..." },
{ "20190104", "20190106", "todo", "Rical", "S190104tmm", "For 'Begin' check all args, datas, functions, modes, tests", },
{ "20190104", "20190104", "todo", "Rical", "S190104trb", "treebranches -- For each sought. Replace known. Later on 201811207", },
{ "20190101", "20190104", "todo", "Rical", "S190101CrC", "Module:CentralSchool: finish reciprocal adaptation with Module:Centralizer", },
{ "20181230", "20190101", "todo", "Rical", "S181230SCi", "For 'Begin' Simplify function Central.init(frame, Central_version, mode_name, ...)" },
{ "20181229", "20181230", "todo", "Rical", "S181229tdp", "if langs.select_lang() mises of translation try in deaceasing priority en=50%, es=7%, de=6%, fr=4% see Wivivi" },
{ "20181228", "20181229", "todo", "Rical", "S181228oTc", 'others: ["Tactic"] = "canbenil;nevererror" ', },
{ "20181227", "20181228", "todo", "Rical", "S181227sad", "split modes.get_mode_args_datas in 2 phases modes.get_args then modes.get_mode_datas" },
{ "20181226", "20181227", "todo", "Rical", "S181226mgT", "function modes.get_args_datas_tests(t) Tactic all in one for modes args datas no known_arguments no origins old" },
{ "20181225", "20181226", "todo", "Rical", "S181225trb", "treebranches -- For each sought. Replace known. Later on 201811207", },
{ "20181222", "20181225", "todo", "Rical", "S181222CrC", "Module:CentralSchool: finish reciprocal adaptation with Module:Centralizer", },
{ "20181222", "20181222", "todo", "Rical", "S181222SCi", "For 'Begin' Simplify function Central.init(frame, ...) using function p.init_central_module()" },
{ "20181221", "20181222", "todo", "Rical", "S181221oTc", 'others: ["Tactic"] = "canbenil;nevererror" ', },
{ "20181205", "20181206", "done", "Rical", "S181205mgT", "function modes.get_args_datas_tests(t) Tactic all in one for modes args datas no known_arguments no origins old" },
{ "20171015", "20171018", "done", "Rical", "S171015trk", "add a method tracker:trk(self, ...) from tracker.add(opt, ...). see Lua_reference_manual#Function_declaration_statements", }, --
{ "20171001", "20171002", "done", "Rical", "S170801cvG", "put MW versions and Central versions in _G and CentralData", },
{ "20171001", "20171002", "done", "Rical", "S170801cCD", "Create Special:PageData/CentralData (change from MW only)", },
{ "20171001", "20171002", "done", "Rical", "S170801cCD", "Create MediaWiki:Scribunto/CentralData (change from admin only)", },
{ "20171001", "20171002", "done", "Rical", "S170801cCD", "Create Central/PageData/CentralData (change from any user)", },
{ "20170910", "20170914", "done", "Rical", "S170910wpw", "Use: wikidata = { property = 'P84',... syntax like {{Wikidata}} for wikidata", },
-- see 4.2 Paramètre "wikidata" https://fr.wikipedia.org/wiki/Aide:Infobox_en_Lua#Param.C3.A8tre_.22wikidata.22
{ "20170910", "20170914", "done", "Rical", "S170910bob", "Create a button object for boxes, like drop_box with: n, states, shapes, keywords, colors", },
{ "2017091020170828", "2017091420170905", "donetodo", "Rical", "S170910ssbS170828dut", "Restructuredelete forunused atracker softin structure_G in: ARGS, IAMO, viewers.boxviews.form()MAMO", },
{ "2017090620170828", "2017090920170905", "donetodo", "Rical", "S170906tbeS170820vtg", "restructuretry for a Table of Box Elementsgraphics in viewers.boxviews.formtry_graph() -- see Macron", },
{ "2017082820170816", "2017090520170823", "donetodo", "Rical", "S170820vtgS170901adl", "tryautomatize graphics in viewerslangs.try_graphdummy_languages() --using see MacronisSupportedLanguage(xx)", },
{ "2017082820170816", "2017090520170823", "donetodo", "Rical", "S170723obvS170901sas", "makedebug object viewersmodes.boxviews.formsimilar_args_search(cssView) Test des mots proches similaires", },
{ "20170816", "20170823", "donetodo", "Rical", "S170901adlS170901mMW", "automatizeuse langs.dummy_languages()Special:PageData usingCentralData isSupportedLanguageT163923+T168726 in activity.MW_Versions_report(xx)", },
{ "20170816", "20170823", "donetodo", "Rical", "S170901sasS170729eli", "debugeasy modeshttps://en.similar_args_search() Test des mots proches similaireswikisource.org/wiki/Template:Lorem_ipsum", },
{ "20170816", "20170823", "donetodo", "Rical", "S170901mMWS170728acr", "usedebug Special:PageDataversions.anti_crash() CentralData T163923+T168726 in activity.MW_Versions_report()tests", },
{ "20170816", "20170823", "donetodo", "Rical", "S170729eliS170801uPD", "easyautomatize https://enPageData change in datas.wikisourceupdate_PageData(t) for activity.org/wiki/Template:Lorem_ipsumMW_Versions_report()", },
{ "2017081620170811", "2017082320170815", "donetodo", "Rical", "S170728acrS170716tac", "debug versionslangs.anti_crashabnormal_char_in_text() + testsfails", },
{ "2017081620170811", "2017082320170815", "donetodo", "Rical", "S170801uPDS170615css", "automatizeuse PageDataConventional changecss parameters cssview in datas.update_PageData(t)edit, forcontent, drop_box, infobox, tableview activity.MW_Versions_report().. ", },
{ "20170811", "20170815", "donetodo", "Rical", "S170716tacS170720diw", "langsEnhance datas.abnormal_char_in_textget_item() failsfrom 20170403 ModuleCentral 6a clean display.lua", },
{ "20170811", "20170815", "donetodo", "Rical", "S170615cssS170718FLI", "usePropose ConventionalFirstname, cssLastname parametersand cssviewInitial in edit, content, drop_box, infobox, tableview ... wikidata", },
{ "20170811", "20170815", "donetodo", "Rical", "S170720diwS170718FLI", "Enhance dataslua_table.get_item4_diffs(A, B) fromDetect 201704034 ModuleCentralfirst 6adiffs cleanof display.luatables A/B and B/A, in-deep/in-next with limits", },
{ "20170811", "20170815", "donetodo", "Rical", "S170718FLIS170811uMD", "ProposeAfter Firstname,'Begin' Lastnamefully anduse InitialModule:drop_box infrom wikidataes.wikipedia.org/wiki/Módulo:Lista_plegable", },
-- S170718FLI : in https://www.wikidata.org/wiki/Wikidata:Property_proposal/Person#Noms().", },
{ "20170811", "20170815", "done", "Rical", "S170718FLI", "lua_table.4_diffs(A, B) Detect 4 first diffs of tables A/B and B/A, in-deep/in-next with limits", },
-- S170718FLI : T53657 is Close : Firstname and Lastname properties
{ "20170811", "20170815", "done", "Rical", "S170811uMD", "After 'Begin' fully use Module:drop_box from es.wikipedia.org/wiki/Módulo:Lista_plegable", },
-- S170718FLI : T53657 to re Open : Firstname and Lastname properties. Follow Aklapper comment on Jul 19 2013, 12:51
{ "20180410", "20180414", "done", "Rical", "S180410ilp", "After 'Begin' T20180621 Enough inform Central modules for jumps to lang.project URI.", },
{ "2018041020170810", "2018041420170811", "donetodo", "Rical", "S180410alpS180311a2c", "Afterif 'Begin'_i_cat T20180621or Automatic_u_cat adaptadd Central2 modulescategories: fordetailed lang.projectand URI.( internal or usage )", },
-- if viewers.is_in("_i_cat", key) then key = "versions_with_internal_error" -- = "Module with internal error",
{ "20180407", "20180410", "done", "Rical", "S180407rlv", "After 'Begin' Fully report modules and libraries versions.", },
-- elseif viewers.is_in("_u_cat", key) then key = "versions_with_usage_error" -- = "Module with usage error",
{ "20180407", "20180409", "done", "Rical", "S180407ruc", "After 'Begin' report all viewers.usual_color(t)", },
{ "20170810", "20170811", "donetodo", "Rical", "S180306vdfS180810lts", "debugcontinue function versionslua_table.deprecated_functionto_sort(tab, ...) nilTo convert any table :in masksequence, itand onsort 20180306it.", },
{ "2017081020180410", "2017081120180414", "donetodo", "Rical", "S170617rpdS180410ilp", "debugAfter modes'Begin' T20180621 Enough inform Central modules for jumps to lang.recursive_normal()project testURI.", },
{ "2017081020180410", "2017081120180414", "donetodo", "Rical", "S170614tvaS180410alp", "UseAfter tableview.new()'Begin' forT20180621 allAutomatic tables,adapt searchCentral modules for lang.project URI.table_end()", }, --
{ "2017081020180407", "2017081120180410", "donetodo", "Rical", "S170813lllS180407rlv", "debugAfter lua_table.level_list(mw)'Begin' forFully allreport usesmodules and libraries versions.", }, --
{ "2017080820180407", "2017081020180409", "donetodo", "Rical", "S170707iccS180407ruc", "After 'Begin: begin to integrate changes' fromreport otherall codersviewers.usual_color(t)", },
{ "2017080820170810", "2017081020170811", "donetodo", "Rical", "S170707iccS180306vdf", "Begin:debug updatefunction importantversions.deprecated_function() Phabricatornil taskstable : tomask activateit theiron availability20180306", },
{ "20170810", "20170811", "todo", "Rical", "S170617rpd", "debug modes.recursive_normal() test", },
{ "20181209", "20181209", "done", "Rical", "S170702cJP", "Begin: informs public Lua-coders Utilisateur:JackPotte [[:fr:Utilisateur:JackPotte|JackPotte fr de es en]]", },
{ "2018120920170810", "2018120920170811", "donetodo", "Rical", "S170702atrS170614tva", "Begin:Use Asktableview.new() translationsfor inall metatables, [https://meta.wikimedia.org/wiki/Translation_requestssearch Translation_requests].table_end()", }, --
{ "2018120920170810", "2018120920170811", "donetodo", "Rical", "S181209iTNS170813lll", "Begin:debug inform [https://meta.wikimedialua_table.org/wiki/Tech/News#contributelevel_list(mw) Techfor News]all about central modules begin phaseuses", }, --
{ "20170808", "20170810", "todo", "Rical", "S170707icc", "Begin: begin to integrate changes from other coders", },
{ "20170808", "20170810", "todo", "Rical", "S170707icc", "Begin: update important Phabricator tasks to activate their availability", },
-- Inform after 'Create Begin'
{ "20170805", "20170807", "todo", "Rical", "S170702cJP", "Begin: Lua-coders Utilisateur:JackPotte [[:fr:Utilisateur:JackPotte|JackPotte fr de es en]]", },
{ "20170805", "20170807", "todo", "Rical", "S170702wvm", "Begin: announce Meet coders throught Wikis video meeting France SWEL-fr https://meet.jit.si/swel-fr", },
{ "20170805", "20170807", "todo", "Rical", "S170702atr", "Begin: Ask translations in meta [https://meta.wikimedia.org/wiki/Translation_requests Translation_requests]", },
{ "20170805", "20170807", "todo", "Rical", "S170604iTN", "Begin: inform [https://meta.wikimedia.org/wiki/Tech/News#contribute Tech News] about central modules begin phase", },
-- S170604iTN : Tech/News#contribute : central, begin to use, efficiency, ask lua coders ?
-- Debug to support Create Begin's group
Ligne 1 026 ⟶ 1 049 :
-- Begin later behind
--
-- NOWNOW DP, NOW, in change
{ "---", "---", "---", "---", "---", "NOW, in change", },
{ "20190203", "20190204", "NOW", "Rical", "S190102DDr", "Duplicate present dropboxes in a unic Template:Dropbox with redirection from previews one's like for pages", },
{ "20190203", "20190204", "NOW", "Rical", "S181101tgl", "Begin: translate by groups of languages : like for viet, laos, cambodgia, allways with en, es, fr 1 days", },
{ "20190203", "20190204", "NOW", "Rical", "S181101aip", "Begin: when 10 used cases, announce that in the phabtask, then when 20, then for xmas 1 days", },
{ "20190126", "20190202", "NOW", "Rical", "S181023s7P", "Begin: search 7 Projects : MediaWikis wikidata wikipedia wikisource wikiquote ? 3 days", },
{ "20190126", "20190202", "NOW", "Rical", "S181023iLC", "Begin: Rical invite 7 Lua-coders : Tpt, Zolo, Od1n, Julien1978, Daehan, VIGNERON ? 3 days", },
{ "20190124", "20190126", "NOW", "Rical", "S181020umf", "update MediaWiki:Scribunto/Central manual for ;activity.phabricator_tasks_report;activity.rough_date_days;...", },
{ "20190122", "20190124", "NOW", "Rical", "S181018CrC", "Module:CentralSchool: finish reciprocal adaptation with Module:Centralizer", },
{ "20190121", "20190122", "NOW", "Rical", "S181016vap", "restore versions.anti_crash(frame) if not pcall() recursive in versions.tree_branch='v1;v2;v3' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_arg has a arg_default in p.known_args and a .delete = 'delete' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_data has a data_default in datas.known_datas and a .delete = 'delete' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_mode has a mode_default in modes.known_modes and a .delete = 'delete' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_version has a version_default in versions.version_args and a .delete = 'delete' ", },
-- function versioning.antiCrash(options, content_or_func, ...) -- Form the display of a running error. in ModuleCentral 20170902.ModuleCentral 2e no antiCrash ok.lua
{ "20190120", "20190120", "NOW", "Rical", "S190120mst", "update function tab_view.form_one_case + translate from multiple_selection_test1(...", },
{ "20190120", "20190120", "NOW", "Rical", "S190120rnt", "update function tab_view.form_one_case + translate from recursive_normal_test1(...", },
{ "20190120", "20190120", "NOW", "Rical", "S190120upt", "update activity.phabricator_tasks_report", },
{ "20190120", "20190120", "NOW", "Rical", "S190120ust", "Module:Centralizer update subtasks list", },
{ "20190115", "20190120", "NOW", "Rical", "S190115rtn", "ModuleCentralizer replace template's display to their names in fr.wikipedia.org and fr.wikisouce.org", },
-- S181224rtn : a similar comportment suggest a change in MW"
-- S181224rtn : do not happened before the MediaWiki version "1.33.0-wmf.9 (02196d2)"
{ "20190107", "20190108", "NOW", "Rical", "S181220oso", "select only sub-functions in the right order in function p.Init_central_module()", },
{ "20190106", "20190106", "NOW", "Rical", "S181220ust", "Module:Centralizer update subtasks list", }, -- search abnormal tests
-- Already done
{ "---", "-~sort-~", "---", "---", "---", "Already done", },
{ "2017081020190120", "2017081120190120", "done", "Rical", "S180311a2cS181227trb", "iftreebranches _i_cat-- orFor _u_cateach addsought. 2Replace categories:known. detailedLater andon ( internal or usage )201811207", },
{ "2018101420190109", "2018101420190109", "done", "Rical", "S181014uftS181222SCi", "updateFor 'Begin' Simplify function tab_viewCentral.form_one_caseinit(frame, +...) translateusing fromfunction multiple_selection_test1(..p.Init_central_module()", },
{ "20190106", "20190107", "done", "Rical", "S181205mgT", "function modes.get_args_datas_tests(t) Tactic all in one for modes args datas no known_arguments no origins old" },
{ "20180824", "20180825", "done", "Rical", "S180824iCD", "in activity.begin_central_modules_support() header namespace and local links.", },
{ "20180730", "20180730", "done", "Rical", "S180730ust", "Module:Centralizer update subtasks list", },
Ligne 1 052 ⟶ 1 100 :
{ "20180604", "20180604", "done", "Rical", "S180604crm", "For 'Begin' T20180604 Update Central modules reference manual. DONE", },
{ "20180518", "20180518", "done", "Rical", "S180518ust", "Module:Centralizer update subtasks list", },
{ "20180421", "20180421", "done", "Rical", "S180421CGL", "For 'Begin' renew Central TacticCentralGuideline from CentralModules and CentralManual", },
{ "20180419", "20180420", "done", "Rical", "S180419aCv", "add Central version in running_times", },
{ "20180414", "20180414", "done", "Rical", "S180414ust", "Module:Centralizer update subtasks list", },
{ "20180413", "20180416", "done", "Rical", "S180413uia", "Update modes.get_argsactivate_known_arguments()=known_arguments +source +template +import +... with priorities", },
{ "---", "---", "---", "---", "---", "STOP the display of this table", },
{ "20170729", "20170729", "done", "STOP", STOP = "STOP", }, -- STOP the display of this table
Ligne 1 077 ⟶ 1 125 :
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 149 ⟶ 1 196 :
activity.phabricator_tasks_Group = { -- toDoc
-- Importance: Important
-- { 102000, "Importantimportance", "20180412updateday", "T185557TASKNBR", 0, "OpenState", "CreateSynthetic thedescription easyof functionthe mw.wikibase.property('P21',phabricator 'Q8023', 'en')task", }, -- Last update headers
{ 100, "Important", "20181121", "T107595", 0, "Open", "[RFC] Multi-Content Revisions", },
-- CCicalese_WMF removed a subtask: : Introduce a ContentStore service to allow certain types of content to not be stored as serialized blobs..
{ 102, "Important", "20181005", "T173207", 0, "Open", "Implement Lua alternative to {{int:Lang}} / wgUserLanguage", },
{ 104, "Important", "20180817", "T168726", 0, "Open", "Create syntax documentation page for Special:PageData.", },
{ 106, "Important", "20180806", "T4085", 0, "Open", "Add a {{USERLANGUAGE}}/{{USERLANG}} magic word", },
{ 108, "Important", "20180710", "T107119", 0, "Open", "Provide a Lua method mw.loadTemplateData()", }, -- See PageData
{ 110, "Important", "20180626", "T135845", 0, "Assigned", "Convert any module as central or centralisable", },
-- T135845 : Central modules must be really multi wikis.
-- T135845 : For this goal they need to join a standard template with the central module.
-- T135845 : But the MediaWiki security prohibit them in Lua modules. Then the deployment must do these.
{ 112, "Important", "20180603", "T85461", 0, "Resolved", "Lua error: too many language codes requested", },
-- T85461 https://meta.wikimedia.org/wiki/Module:Assemble_multilingual_message
-- T85461 https://meta.wikimedia.org/w/index.php?title=Module:Assemble_multilingual_message&action=edit#mw-ce-l46
-- : Authored By daniel, Jul 31 2015. modif Nov 21 2018, 17:16
{ 114, "Important", "20180412", "T185557", 0, "Open", "Create the easy function mw.wikibase.property('P21', 'Q8023', 'en')", },
{ 116, "Important", "20180413", "T142093", 0, "Open", "Decide how to do usage tracking for strings_c used to lookup entities (page titles, external ids, …)", },
{ 118, "Important", "20170921", "T176362", 0, "Declined", "Implement ClassNameTests in Scribunto to enhance central modules stability", },
{ 126, "Important", "20170907", "T68051", 1, "Open", "Central modules need the user language to display errors and category names", },
{ 122, "Important", "20170727", "T149532", 0, "Resolved", "Why Multi-Content-Revisions? Use cases and requirements.", },
{ 120, "Important", "20170713", "T163923", 0, "Resolved", "Create Special:PageData as a canonical entry point for machine readable page data.", },
{ 106, "Important", "20170703", "T20170703", 0, "ToCreate", "Standardize content, page and user langages availability", },
-- T20170703 : Rename T68051 : "Central modules need the user language to display errors and category names"
Ligne 1 157 ⟶ 1 224 :
{ 110, "Important", "20170325", "T20170325", 0, "ToCreate", "Centralize and share central datas about central modules", },
-- T20170325 : Centralize datas as MediaWiki versions installations in each lang-project, uses of central modules (helpers, projects, languages ...).
{ 114, "Important", "20180626", "T135845", 0, "Assigned", "Convert any module as central or centralisable", },
-- T135845 : Central modules must be really multi wikis.
-- T135845 : For this goal they need to join a standard template with the central module.
-- T135845 : But the MediaWiki security prohibit them in Lua modules. Then the deployment must do these.
{ 114, "Important", "20181101", "T208437", 0, "Open", "Consolidate and migrate Module namespace to Commons", },
{ 116, "Important", "20160822", "T53660", 0, "Open", "Detect the edit state for modules which help users and helpers", },
{ 118, "Important", "20180806", "T4085", 0, "Open", "Add a {{USERLANGUAGE}}/{{USERLANG}} magic word", },
{ 118, "Important", "20181005", "T173207", 0, "Open", "Implement Lua alternative to {{int:Lang}} / wgUserLanguage", },
{ 119, "Important", "20180710", "T107119", 0, "Open", "Provide a Lua method mw.loadTemplateData()", }, -- See PageData
{ 120, "Important", "20170713", "T163923", 0, "Resolved", "Create Special:PageData as a canonical entry point for machine readable page data.", },
-- T163923: Permit at modules to change PageData (for stat, modules versions, mw versions...).
{ 122, "Important", "20170727", "T149532", 0, "Resolved", "Why Multi-Content-Revisions? Use cases and requirements.", },
{ 124, "Important", "20180817", "T168726", 0, "Open", "Create syntax documentation page for Special:PageData.", },
{ 126, "Important", "20170907", "T68051", 1, "Open", "Central modules need the user language to display errors and category names", },
{ 132, "Important", "20180603", "T85461", 0, "Resolved", "Lua error: too many language codes requested", },
-- T85461 https://meta.wikimedia.org/wiki/Module:Assemble_multilingual_message
-- T85461 https://meta.wikimedia.org/w/index.php?title=Module:Assemble_multilingual_message&action=edit#mw-ce-l46
{ 134, "Important", "20170309", "T159322", 0, "Open", "Central categories and alerts for central modules", },
-- T159322 : Does the community agree to implement central categories and alerts for central modules?
-- T159322 : This enhances the efficiency of the detection and the correction of errors, in some ways:
{ 140, "Important", "20170211", "T20170211", 1, "ToCreate", "In mw.language.fetchLanguageNames( 'fr' ) some languages names are not in French", },
-- T20161220 : ToDo: test: local getContentLanguage = mw.language.getContentLanguage().code -- default content_lang
{ 116, "Important", "20160822", "T53660", 0, "Open", "Detect the edit state for modules which help users and helpers", },
-- T163923: Permit at modules to change PageData (for stat, modules versions, mw versions...).
{ 136, "Important", "20160522", "T85419", 0, "Open", "User groups should be exposed to Scribunto", },
-- T85419: to adapt errors and warning for administrators or modules coders
{ 138, "Important", "20180413", "T142093", 0, "Open", "Decide how to do usage tracking for strings_c used to lookup entities (page titles, external ids, …)", },
{ 140, "Important", "20170211", "T20170211", 1, "ToCreate", "In mw.language.fetchLanguageNames( 'fr' ) some languages names are not in French", },
-- T20161220 : ToDo: test: local getContentLanguage = mw.language.getContentLanguage().code -- default content_lang
{ 146, "Important", "20170921", "T176362", 0, "Declined", "Implement ClassNameTests in Scribunto to enhance central modules stability", },
-- T176362 : phabtask : Implement getTestProvider in Scribunto to enhance central modules stability
-- T176362 : phabtask : proposed functions in MediaWiki:
-- T176362 : phabtask : mw.getTestProvider(mw_tests, nmaxi) -- To initialise, to limit all tests in time and to limit cases to nmaxi.
-- T176362 : phabtask : mw.ClassNameCase(case, n), used inside mw.getTestProvider() to run each test case of number 1 to nmaxi.
-- T176362 : phabtask : The case object contains fields: count, OK="OK"..., n, name, type, args{}, expect{}, NameTest{}, func(), provide(), run()
{ 148, "Important", "20170121", "T122752", 1, "Open", "#invoke do not record the main module in package.loaded", },
-- T122752: 20161202 18:25 See example https://fr.wikisource.org/wiki/Module:Phab.TestpackG : detect "in " "_G" or package.loaded
Ligne 1 268 ⟶ 1 313 :
local t = t or "\n* <b>activity.phabricator_tasks_report()</b> Monitor states of known phabricator tasks,"
t = t .. "\n* How to well report a task like in <b><big>viewers.phab_task('T149532#2878699', 'that task')</big></b> :"
t = t .. "\n* 1): <b>What happens in brief</b> 2): <b>Type of activity</b> 3): <b>What is the problem</b>"
t = t .. "\n* 4): <b>Dedicated test case without ambiguity.</b> "
t = t .. "\n* 5): <b>Expected outcome</b> 6): <b>Proposed solution</b>"
t = t .. "\n* 7): <b>Where and when to use the proposed solution</b>"
t = t .. "\n* 8): <b>Who would benefit + your name.</b> 9): <b>Current status of the discussion</b>"
t = t .. "\n* 10): <b>Links</b> 11) <b>Your name linked to your MediaWiki URL, or profile elsewhere on the internet</b>"
local mwtitle = mw.title.getCurrentTitle()
local tasks_Group = activity.phabricator_tasks_Group
Ligne 1 304 ⟶ 1 349 :
}
function tab_view.form_one_case(task) -- Convert a task from test_group to rowGroup.
task.phab = viewers.phab_task(task.phab, task.phab) -- function viewers.phab_task
local usual = "discreet"
if viewers.is_in(task.status, "ToCreate, Declined, Invalid, ") then usual = "discreet"
Ligne 1 382 ⟶ 1 427 :
headers_class = "wikitable alternative center sortable",
rowGroup = {},
-- track_on == "details"true,
}
-- from MediaWiki 1.30.0-wmf.4 (3248a17) 22:41, 7 June 2017
Ligne 1 507 ⟶ 1 552 :
-- datas = {} -- already declared by Scribunto, see central_library.new() -- Record a library in package.loaded
 
datas.default_item = datas.default_item or "Q34743Q307" -- RudyardKeep KiplingGalilée (Q307)
 
datas.i18n = {} -- Translations for datas library
Ligne 1 513 ⟶ 1 558 :
-- Pour traduire, les langues de référence sont l'anglais et le français.
-- Pour traduire, ne traduisez pas des parties comme celles-ci : <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Wikidata
datas_Wikidata_header = "Données : ",
Ligne 1 536 ⟶ 1 579 :
datas_update_Special_PageData_header = "site; temps de version; identificateur de version; heure de vue",
datas_get_item_report_title = "datas.get_item_report() Rapporte les données de mw.wikibase pour la page ou tout autre élément.",
datas_get_item_report_headers = "mot-clé; type; propriété; défaut; valeur"; -- br
-- Messages et erreurs divers
datas_no_args_Wikidata_err = "Erreur interne : Module sans table d'arguments Wikidata.",
Ligne 1 544 ⟶ 1 586 :
-- Zum Übersetzen sind die Referenzsprachen Englisch und Französisch.
-- Übersetze keine Teile wie diese: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["dockey"] = "dockey",
datas_Wikidata_header = "Daten: ",
datas_known_Datas_header = "Bekannte Daten: ",
Ligne 1 566 ⟶ 1 606 :
datas_update_Special_PageData_header = "Ort; Versionszeit; Versionskennung; Stunde der Sicht",
datas_get_item_report_title = "datas.get_item_report() Gibt mw.wikibase-Daten für die Seite oder einen anderen Artikel aus.",
datas_get_item_report_headers = "Stichwort; Art; Eigentum; Standard; Wert"; -- de
-- Verschiedene Nachrichten und Fehler
datas_no_args_Wikidata_err = "Interner Fehler: Modul ohne Wikidata-Argumenttabelle.",
Ligne 1 574 ⟶ 1 613 :
-- To translate, referral languages are English and French.
-- To translate, do not translate parts like these: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] known_arguments_country = "docfuncEngland", -- English
["dockey"] known_arguments_flag = "dockeyFlag_of_England.svg", -- English
mw_wikibase_countryknown_arguments_monument = "EnglandSt_Pauls_aerial_%28cropped%29.jpg", -- English St Paul's Cathedral
mw_wikibase_flagknown_arguments_town = "England in the UK and Europe.svgLondon", -- English
mw_wikibase_monument = "St Paul Cathedral.png", -- English St Paul's Cathedral
mw_wikibase_town = "London", -- English
datas_Wikidata_header = "Datas: ",
datas_known_Datas_header = "Known datas: ",
Ligne 1 600 ⟶ 1 637 :
datas_update_Special_PageData_header = "site; version time; version identifier; seen hour",
datas_get_item_report_title = "datas.get_item_report() Reports datas from mw.wikibase for the page or any other item.",
datas_get_item_report_headers = "keyword; type; property; default; value"; -- en
-- Miscellaneous warnings and errors
datas_no_args_Wikidata_err = "Error: Module without Wikidata arguments table.",
Ligne 1 608 ⟶ 1 644 :
-- Para traducir, los idiomas de referencia son inglés y francés.
-- Para traducir, no traduzca partes como estas: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Wikidata
mw_wikibase_countryknown_arguments_country = "España", -- Spanish
mw_wikibase_flagknown_arguments_flag = "Flag_of_Spain.svg", -- SpanishFlag of Spain
known_arguments_monument = "MADRID_100206_UDCI_023.jpg", -- Puerta del Sol
mw_wikibase_monument = "Panorama_Madrid_Ayuntamiento_20090417.jpg", -- Spanish
mw_wikibase_townknown_arguments_town = "Madrid", -- SpanishCapital city
datas_Wikidata_header = "Datos: ",
datas_known_Datas_header = "Datos conocidas: ",
Ligne 1 634 ⟶ 1 668 :
datas_update_Special_PageData_header = "sitio; tiempo de versión; identificador de versión; tiempo visto",
datas_get_item_report_title = "datas.get_item_report() Informes de datos de mw.wikibase para la página o cualquier otro elemento.",
datas_get_item_report_headers = "palabra clave; tipo; propiedad; defecto; valor"; -- es
-- Diversos mensajes y errores
datas_no_args_Wikidata_err = "Error: Módulo sin argumentos Wikidata tabla.",
Ligne 1 642 ⟶ 1 675 :
-- Pour traduire, les langues de référence sont l'anglais et le français.
-- Pour traduire, ne traduisez pas des parties comme celles-ci : <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Wikidata
mw_wikibase_countryknown_arguments_country = "France", -- French
mw_wikibase_flagknown_arguments_flag = "flag of FranceFlag_of_France.svg.png", -- French
mw_wikibase_monumentknown_arguments_monument = "Tour Eiffel", -- French
mw_wikibase_townknown_arguments_town = "Paris", -- French
datas_Wikidata_header = "Données : ",
datas_known_Datas_header = "Données connues : ",
Ligne 1 669 ⟶ 1 700 :
datas_update_Special_PageData_header = "site; temps de version; identificateur de version; heure de vue",
datas_get_item_report_title = "datas.get_item_report() Rapporte les données de mw.wikibase pour la page ou tout autre élément.",
datas_get_item_report_headers = "mot-clé; type; propriété; défaut; valeur"; -- fr
-- Messages et erreurs divers
datas_no_args_Wikidata_err = "Erreur interne : Module sans table d'arguments Wikidata.",
Ligne 1 677 ⟶ 1 707 :
-- Zum Übersetzen sind die Referenzsprachen Englisch und Französisch.
-- Übersetzen Sie keine Teile wie diese: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["dockey"] = "dockey",
datas_Wikidata_header = "Adat: ",
datas_known_Datas_header = "Ismert adatok: ",
Ligne 1 699 ⟶ 1 727 :
 
datas_get_item_report_title = "datas.get_item_report() Rapporte les données de mw.wikibase pour la page ou tout autre élément.",
datas_get_item_report_headers = "kulcsszó; típus; ingatlan; alapértelmezett; érték"; -- hu
-- Messages et erreurs divers
datas_no_args_Wikidata_err = "Erreur interne : Module sans table d'arguments Wikidata.",
Ligne 1 707 ⟶ 1 734 :
-- Để dịch, các ngôn ngữ giới thiệu là tiếng Anh và tiếng Pháp.
-- Để dịch, không dịch các phần như thế này: <b>%1</b> ; <b>%2</b> = <b>%3</b> (<b>%4</b>) ; <code>Q535</code> ; <br/> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["dockey"] = "dockey",
datas_Wikidata_header = "Dữ liệu: ",
datas_known_Datas_header = "Dữ liệu nổi tiếng: ",
Ligne 1 729 ⟶ 1 754 :
datas_update_Special_PageData_header = "địa điểm; thời gian phiên bản; định danh phiên bản; thấy giờ",
datas_get_item_report_title = "datas.get_item_report() Báo cáo dữ liệu mw.wikibase cho trang hoặc bất kỳ mục nào khác.",
datas_get_item_report_headers = "từ khóa; kiểu; bất động sản; mặc định; giá trị"; -- vi
-- Các thông báo và lỗi khác nhau
datas_no_args_Wikidata_err = "Lỗi nội bộ: Mô-đun không có bảng đối số Wikidata.",
Ligne 1 739 ⟶ 1 763 :
local t = t or "\n* <b>datas.available_props_report(t)</b> Reports availables datas properties.\n* "
local i = 0
-- t = t .. "\n* TacticGuideline for this stat : Count lists of translations by languages and libraries, then convert in a 2D table, then format and report them."
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments - = {...}
for key, argmtone_arg in pairs(known_arguments) do -- For all known parameters
if type(argmtone_arg.prop) == "string" then
i = i + 1 ; t = t .. viewers.ta(argmtone_arg.keyword, argmtone_arg.prop)
end
end
Ligne 1 843 ⟶ 1 867 :
end
 
function datas.property(one_arg) -- Get datas from mwwikibase for one property of the page.
datas.default_item = datas.default_item or "Q34743" -- Rudyard Kipling
one_arg = mw.clone(one_arg) -- avoid any interaction with other properties.
 
-- And ["prop_default"] depends of need in function modes.one_arg_check_need()
 
function datas.one_prop(one_arg) -- Get datas from mwwikibase for one property of the page.
local one_arg = mw.clone(one_arg or {}) -- avoid any interaction with other properties.
local claimRanks = { 1, 2, 3, 4, }
datas.QITEM = mw.wikibase.getEntityIdForCurrentPage() -- use props.QITEM Returns the Item id as string, like "Q42"
datas.local QITEM = datas.QITEM or datas.default_item or "Q34743" -- Rudyard Kipling
datas.entityitem = mw.wikibase.getEntity(datas.QITEM or datas.default_item or "Q34743" ) -- Rudyard Kipling
local valloc = nil ; one_arg["val"] = val{}
local label = nil
datas.item = mw.wikibase.getEntity(datas.QITEM or datas.default_item or "Q34743" ) -- Rudyard Kipling
local val = nil
-- Sub-task "S181027n13", "For 'Begin' "NOW",CentralManual need=0=noevent need=1=depend keyword+default event need=2=permit default need=3=enforce default", },
if one_arg.prop then -- Admit any type of keyword and prop.
-- and ["prop_default"] depends of need in function datas.one_prop(
one_arg.keyword = one_arg.keyword or one_arg.key or one_arg.prop
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments - = {...}
one_arg.prop = one_arg.prop -- Get datas from mwwikibase for one property of the page.
local local_need = 0 -- to select
if one_arg.prop == "QITEM" then val = mw.wikibase.getEntityIdForCurrentPage() -- use props.QITEM Returns the Item id as string, like "Q42"
if known_arguments["keyword"] and known_arguments["keyword"]["need"] then local_need = known_arguments["keyword"]["need"] end -- need=0=noevent
elseif one_arg.prop == "label" then val = datas.item:getLabel(QITEM) ; label = label or val -- use props.label Returns a string, like "Berlin" with 'de'
if not known_arguments["keyword"] then one_arg["val"] = nil end -- need=0=noevent
elseif one_arg.prop == "sitelink" then val = datas.item:getSitelink() -- use props.sitelink like Author:Aristotel
if (known_arguments["keyword"] == one_arg["keyword"]) and (local_need == 3 ) then -- need=3=enforce default
elseif one_arg.prop == "labelwithlang" then val = mw.wikibase.entity:getLabelWithLang() -- use props.labelwithlang -- Returns a string like "Berlin" and a language like
one_arg["val"] = known_arguments["keyword"]["prop_default"] -- Wanted even if nil.
elseif one_arg.prop == "description" then val = mw.wikibase.description(QITEM) -- use props.description -- ric : Description of the QITEM page
else -- need=others : 2, 1, 0.
if elseif one_arg[".prop"] == "labellabelcontent" then one_arg["val"] = datasmw.wikibase.item:getLabelgetLabelByLang(datas.QITEM, langs.content_lang) --; uselabel = props.label or val -- Returns athe string,content_lang likelabel "Berlin"of withthe 'de'item
elseif one_arg[".prop"] == "sitelinklabelpage" then one_arg["val"] = datasmw.item:getSitelinkwikibase.getLabelByLang(QITEM, langs.page_lang) ; label = label or val -- useReturns props.sitelinkthe likepage_lang Author:Aristotellabel of the item
elseif one_arg[".prop"] == "labelwithlanglabeluser" then one_arg["val"] = mw.wikibase.entity:getLabelWithLanggetLabelByLang(QITEM, langs.user_lang or "en") --; uselabel props.labelwithlang = label or val -- Returns athe string like "Berlin"user_lang andlabel aof languagethe likeitem
else -- ric (p.box_read)
elseif one_arg["prop"] == "description" then one_arg["val"] = mw.wikibase.description(datas.QITEM) -- use props.description -- ric : Description of the QITEM page
loc.formatPropertyValues = datas.item:formatPropertyValues( one_arg.prop ) -- like "P123"
elseif one_arg["prop"] == "labelcontent" then one_arg["val"] = mw.wikibase.getLabelByLang(datas.QITEM, langs.content_lang) -- Returns the content_lang label of the item
-- Returns a table like: { value = "Formatted claim value", label = "Label of the Property" }
elseif one_arg["prop"] == "labelpage" then one_arg["val"] = mw.wikibase.getLabelByLang(datas.QITEM, langs.page_lang) -- Returns the page_lang label of the item
if loc.wd_RANK_TRUTH then
elseif one_arg["prop"] == "labeluser" then one_arg["val"] = mw.wikibase.getLabelByLang(datas.QITEM, langs.user_lang ) -- Rudyard Kipling
loc.formatPropertyValues = datas.item:formatPropertyValues( one_arg, { loc.wd_RANK_TRUTH } )
else
end
if claimRanks["RANK_TRUTH"] then one_arg["prop"] = one_arg["prop"] or datas.item:formatPropertyValues(claimRanks["RANK_TRUTH"]) end
if loc.wd_claimRanks then
if claimRanks["RANK_PREFERRED"] then one_arg["prop"] = one_arg["prop"] or datas.item:formatPropertyValues(claimRanks["RANK_PREFERRED"]) end
if claimRanks["RANK_NORMAL"] then one_arg["prop"]loc.formatPropertyValues = one_arg["prop"] or datas.item:formatPropertyValues(claimRanks["RANK_NORMAL"]) endone_arg, { loc.wd_claimRanks } )
end
if claimRanks["RANK_DEPRECATED"]then one_arg["prop"] = one_arg["prop"] or datas.item:formatPropertyValues(claimRanks["RANK_DEPRECATED"]) end
val = loc.formatPropertyValues.value
end
val = tostring(val)
end
if (not if one_arg["prop"]).format and== one_arg["prop_defaultyear"] then one_arg["prop"]val = one_arg["prop_default"]mw.ustring.sub( val, end-4, -1 need=2=permit) defaultend
val = tostring(val)
if (one_arg["format"] == "year") and tonumber(one_arg["val"]) then one_arg["val"] = mw.ustring.sub( tostring(one_arg["val"]), -4, -1 ) end
one_arg.val = val
end --function modes.activate_known_arguments(
one_arg.label = label or one_arg.label or one_arg.labeluser or one_arg.labelcontent or one_arg.labelpage or one_arg.labelbylang
one_arg = mw.clone(one_arg) -- avoid any interaction with other properties.
return one_arg
end -- local one_arg = function datas.one_propproperty(one_arg) -- Get datas from mwwikibase for one property of the page.
 
function datas.get_item(known_arguments, QITEM) -- Get datas from mw.wikibase for the page. FAMLTVQDR
-- from 2016-08-16 ModuleCentral 3a lua_table.to_list.lua
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments - = {...}
local t = "\n* <b>datas.get_item(known_arguments, QITEM)</b>: Get datas from mw.wikibase for the page."
local Title, Label, prop, lang, description, val, label, adr, proplabel
local QITEM = QITEM or mw.wikibase.getEntityIdForCurrentPage() or datas.default_item or "Q34743" -- Rudyard Kiplingkipling
datas.QITEM = QITEM
datas.item = mw.wikibase.getEntity(datas.QITEM or "Q34743") -- Rudyard Kipling
local props = {} -- All properties form known_arguments with argmtone_arg.prop.
local prop = {} -- to collect properties
local loc = {} -- local values
Ligne 1 899 ⟶ 1 922 :
one_arg.key = key
one_arg.syn = one_arg.syn or 0
one_arg = datas.one_propproperty(one_arg) -- Get datas from mwwikibase for one property of the page. function datas.one_propproperty(
if one_arg.keyword == "QITEM" then one_arg.val = QITEM end
if one_arg.prop then -- Admit any type of keyword and prop.
props[one_arg.keyword] = mw.clone(one_arg)
prop[one_arg.keyword] = one_arg.val -- ric (p.box_read)
end
end
Ligne 1 914 ⟶ 1 937 :
end -- local prop, props = datas.get_item(known_arguments, QITEM) -- Get datas from mw.wikibase for the page.
 
-- datas_get_item_report_title =function "datas.get_item_report(t) Rapporte-- lesdatas.get_item() donnéesReport dedatas from mw.wikibase pourfor lathe page ou tout autre élément.",**
function datas.get_item_report(t) -- datas.get_item() Report datas from mw.wikibase datas_get_item_report
local memo = viewers.save_configs("datas.get_item_report") -- Save global configuration before eventual changes.
local t = t or "\n* <b>datas.get_item_report(t)</b>: Report datas from mw.wikibase for the page **"
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- modes.known_arguments = { -- p.known_arguments - = { -- }
local prop, props = datas.get_item(known_arguments, QITEM) -- Get datas from mw.wikibase for the page. ric
local countprops = tostring( lua_table.level_count(props) ) -- do not follow one_prop structure
local countallprops = tostring( lua_table.level_count(props) ) -- do not follow one_prop structure
Ligne 1 925 ⟶ 1 947 :
local sortprops = {} -- to sort properties in alphabetic order
for key, val in pairs(props) do -- from list all fond datas
-- t = t .. "\n* get_item: " .. viewers.ta("key", key) .. viewers.ta("val", val)
table.insert(sortprops, props[key])
end
Ligne 1 931 ⟶ 1 954 :
test_group = sortprops, -- Use default cases.
rowGroup = {},
title_memo = "datas_get_item_report_title", -- Report datas from mw.wikibase",
headers = "datas_get_item_report_headers", -- "keyword; type; property; default; value"
headers = "keyword; value; type; property; default; format",
headers_class = "wikitable alternative center sortable",
form_one_case = function(case) -- Convert a case from test_group to rowGroup.
return { case.keywordkey, case.val, case.typ, case.propneed, case.prop_defaultkeyword, case.syn, case.prop, case.format, } end,
headers = "key; val; typ; need; keyword; syn; prop; format",
}
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
Ligne 1 944 ⟶ 1 965 :
viewers.restore_configs(memo, "datas.get_item_report") -- Restore global configurations after eventual changes.
return t
end -- local t = datas.get_item_report(t) -- datas.get_item() Report datas from mw.wikibase for the page **
 
function datas.prot(prop) -- form a string to show a prop value
Ligne 2 014 ⟶ 2 035 :
headers = "key;val",
rowGroup = {},
-- track_on == "details",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 2 043 ⟶ 2 063 :
end
end -- function datas.load_data(t, datext) -- Pass data between #invoke's
 
-- cut_libraries
 
-- - - - ------------------ - - - - ------------------ - - - - -----------------------------
-- - - - ------------------ - - - - ------------------ - - - - -----------------------------
-- The Library:events supports events of types erros, warnings and categories.
-- viewers.save_configs("events.save_configs" memo, tab_view, group ) -- Init a new events group
-- events.add_err(key, ... ) -- Add an error in the actual table of events.
-- events.add_cat_group(groupCat, groupList) -- Add some categories in the actual table of events.
-- events.formats(one_event) -- Format events types
-- events.all_categories_test(t) -- test categories
-- - - - ------------------ - - - - ---------------------------------
-- - - - ------------------ - - - - ---------------------------------
 
-- events = {} -- already declared by Scribunto, see central_library.new() -- Record a library in package.loadedS
 
events.i18n = {} -- Translations for Library:events
events.i18n.br = {
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "Tester categ_Test : catégories dans quelques langues",
events_all_kinds_tests_title = "events.all_kinds_test() Test: toutes les sortes d'événements (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_add_cat_deprecated = "Fonction obsolète dans le module principal.",
events_close_without_memo_err = "viewers.restore_configs(memo, where) sans <b>memo</b> dans le module <b>%1</b>.",
events_antiCrash_protect_err = "La fonction antiCrash() protège cette page contre un effondrement complet dû à une erreur interne : %1.",
} -- events.i18n.br
events.i18n.en = {
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "categ_Test test : classes in some languages",
events_all_kinds_tests_title = "events.all_kinds_test() Test: all kinds of events (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_close_without_memo_err = "viewers.restore_configs(memo, where) without <b>memo</b> in module <b>%1</b>.",
events_antiCrash_protect_err = "The antiCrash() function protects this page against a complete crash due to an internal error: %1.",
} -- events.i18n.en
events.i18n.es = {
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "Prueba categ_Test: clases en algunos lenguajes",
events_all_kinds_tests_title = "events.all_kinds_test() Prueba: todo tipo de eventos (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_add_cat_deprecated = "Función obsoleto en módulo principal.",
events_close_without_memo_err = "viewers.restore_configs(memo, where) sin <b>memo</b> en el módulo <b>%1</b>.",
events_antiCrash_protect_err = "La función antiCrash() protege esta página contra un colapso completo debido a un error interna: %1.",
} -- events.i18n.es
events.i18n.fr = {
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "Tester categ_Test : catégories dans quelques langues",
events_all_kinds_tests_title = "events.all_kinds_test() Test: toutes les sortes d'événements (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_add_cat_deprecated = "Fonction obsolète dans le module principal.",
events_close_without_memo_err = "viewers.restore_configs(memo, where) sans <b>memo</b> dans le module <b>%1</b>.",
events_antiCrash_protect_err = "La fonction antiCrash() protège cette page contre un effondrement complet dû à une erreur interne : %1.",
} -- events.i18n.fr
events.i18n.hu = {
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "Tester categ_Test : catégories dans quelques langues",
events_all_kinds_tests_title = "events.all_kinds_test() Test: toutes les sortes d'événements (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_add_cat_deprecated = "Fonction obsolète dans le module principal.",
events_close_without_memo_err = "viewers.restore_configs(memo, where) sans <b>memo</b> dans le module <b>%1</b>.",
events_antiCrash_protect_err = "La fonction antiCrash() protège cette page contre un effondrement complet dû à une erreur interne : %1.",
} -- events.i18n.hu
events.i18n.vi = {
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "Tester categ_Test : catégories dans quelques langues",
events_all_kinds_tests_title = "events.all_kinds_test() Test: toutes les sortes d'événements (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_add_cat_deprecated = "Fonction obsolète dans le module principal.",
events_close_without_memo_err = "viewers.restore_configs(memo, where) sans <b>memo</b> dans le module <b>%1</b>.",
events_antiCrash_protect_err = "La fonction antiCrash() protège cette page contre un effondrement complet dû à une erreur interne : %1.",
} -- events.i18n.vi
 
events.test_group = {}
events.rowGroup = {}
events.tab_view = {}
events.tab_view.test_group = {}
events.tab_view.rowGroup = {}
 
function events.add_cat(key, ... ) -- Add a category in the actual table of events.
return events.add_record("cat", key, ...) -- Add a error, warning or category in the lists. S170626rev
end
 
function events.add_err(key, ... ) -- Add an error in the actual table of events.
return events.add_record("err", key, ...) -- Add a error, warning or category in the lists. S170626rev
end
 
function events.add_wng(key, ... ) -- Add a warning in the actual table of events.
return events.add_record("wng", key, ...) -- Add a error, warning or category in the lists. S170626rev
end
 
function events.formats_cat(one_event, txt, lnk, c, space)
local space = space or (mw.site.namespaces.Category.name .. ":")
local c = c or one_event.ccc or ":"
if one_event.typ == "cat" then -- Format a category to display or activate
one_event.content_wkt = viewers.form9content(one_event.key, lua_table.to_list( one_event.vals ) )
one_event.page_wkt = viewers.form9page(one_event.key, lua_table.to_list( one_event.vals ) )
one_event.user_wkt = viewers.form9user(one_event.key, lua_table.to_list( one_event.vals ) )
return " [[" .. c .. space .. (one_event.content_wkt or lnk) .. "|" .. (one_event.user_wkt or txt) .. "]] "
else
return ""
end
end
 
events.all_events_group = {} -- Table to collect all events types "err", "wng" and "cat".
 
function events.new(typ, key, ...) -- Initialize and finalize a new event.
local one_event = {} -- default event
if type(typ) == "table" then
one_event = typ -- Use a predefined event
else -- To finalize an existing event.
one_event.typ = typ
one_event.key = key
end -- Finalize all events
one_event.typ = one_event.typ or typ -- Type of event: err, wng, cat
one_event.key = one_event.key or key -- Translation key, simple or extended by name
if type(typ) ~= "string" then typ = "notyp" end -- To debug abnormal type of event
if type(key) ~= "string" then key = "nokey" end -- To debug abnormal translation key
one_event.name = one_event.typ or one_event.key or "name" -- Translation key, simple or extended by name
one_event.vals = one_event.vals or { ... } -- table of arguments values
one_event.catview = one_event.catview or ":" -- Default value for eventual use
-- Check, yes or no, to form an event, in special cases
if (one_event.typ == "cat") then
one_event.res, one_event = events.formats( one_event ) -- Formats the resulting wikitext, can be re-form later
elseif (one_event.typ == "err") then
one_event.res, one_event = events.formats( one_event ) -- Formats the resulting wikitext, can be re-form later
elseif (one_event.typ == "wng") then
one_event.res, one_event = events.formats( one_event ) -- Formats the resulting wikitext, can be re-form later
end
return one_event
end -- function events.new(typ, key, ...)
 
function events.add_new(one_event) -- Add a error, warning or category in the lists. S170626rev
-- Select only new events
if type(one_event) ~= "table" then one_event = {} end
local new_one_event = viewers.form9tests( tostring(one_event.key), lua_table.to_list( one_event.vals ) )
for i, event in pairs(events.all_events_group) do
local old_one_event = viewers.form9tests( tostring(event.key), lua_table.to_list( event.vals ) )
if new_one_event == old_one_event then new_one_event = nil ; break end -- Add only new events. Reject already seen events.
end
-- events.add_wng("modes_auto_val_warning_wng", langs.user_translations[key], val) -- form_result
if new_one_event then table.insert(events.all_events_group, one_event) end
return one_event
end -- function events.add_new(typ, ref, ...)
 
function events.add_record(typ, key, ... ) -- Add a new error, warning or category in a list.
-- Guide line: all events are in a single table, including categories, without duplication.
-- Guide line: without duplication: events differ if the type, the key or any value of any argument differs.
-- Guide line: We can view or categorize categories.
local intern_or_use = versions.memo_i18n["en"][key]
local one_event = events.new(typ, key, ...) -- Initialize and finalize a new event.
local one_event = events.add_new(one_event) -- Add an error, warning or category in the lists. S170626rev
local res, one_event = events.formats(one_event, c) -- Format an event as an error, warning or category.
return res, one_event
end -- local res, one_event = events.add_record(typ, key, ... )
 
function events.formats(one_event, c) -- Format an event as an error, warning or category.
one_event.res = tostring(one_event.res) .. "? form " .. viewers.form9tests(".form one_event.key=%1, one_event.res=%2, ", one_event.key, one_event.res )
local one_event = mw.clone(one_event) -- do not disturb input event
if type(one_event) ~= "table" then
one_event.res = lua_table.rough_view(one_event)
return one_event.res, one_event
end
if (one_event.typ ~= "cat") and (one_event.typ ~= "wng") and (one_event.typ ~= "err") then
one_event.res = lua_table.rough_view(one_event)
return one_event.res, one_event
end
one_event.tableStyle = one_event.tableStyle or "" -- Could change the style of the wikitext. Not available on 20160916
if type(one_event.name) ~= "string" then one_event.name = ""
elseif one_event.name ~= "" then one_event.name = one_event.name .. "_" end
one_event.idargs = one_event.name .. tostring( viewers.form9user( tostring(one_event.key), lua_table.to_list( one_event.vals ) ) )
-- Each type of event formats its own type of wikitext
one_event.content_wkt = viewers.form9content(one_event.key, lua_table.to_list( one_event.vals ) )
one_event.page_wkt = viewers.form9page(one_event.key, lua_table.to_list( one_event.vals ) )
one_event.user_wkt = viewers.form9user(one_event.key, lua_table.to_list( one_event.vals ) )
one_event.res = "" -- multilingual
if one_event.typ == "err" then one_event.res = viewers.styles_color_error(one_event.user_wkt) end
if one_event.typ == "wng" then one_event.res = viewers.styles_color_warning(one_event.user_wkt) end
one_event.ccc = c or one_event.catview or events.catview or ":"
one_event.content_catspace = mw.site.namespaces.Category.name -- name: Local namespace name.
if one_event.typ == "cat" then -- Format a category to display or activate
one_event.res = events.formats_cat(one_event)
if viewers.is_in("_i_cat", key) then -- If needed, add a second "Category:Module with internal error"
res = res .. events.add_cat("versions_with_internal_error")
end
if viewers.is_in("_u_cat", key) then -- If needed, add a second "Category:Module with user error"
res = res .. events.add_cat("versions_with_user_error")
end
end
return one_event.res, one_event
end -- function events.formats(one_event, c)
 
events.all_kinds_test_test_group = {
{ "abc", "langs_form9user_all_types_values", { "pi = ", "circle / diameter", 3.14, }, },
{ "equation", "langs_form9user_all_types_values", { 11, 7, 3.14, }, },
{ "Matrix:", "langs_form9user_all_types_values", { "2.1.0", "v4-6, ISO_8601, FC14 h6", }, },
{ "pi = ", "langs_form9user_all_types_values", { "circle / diameter", 3.14, }, },
{ "quadrature", "langs_form9user_all_types_values", { function() end, "convert a square to a circle", }, },
}
-- langs_form9user_all_types_values = "Test: string=%1 number=%2 nil=%3 function=%4 table=%5.",
function events.all_kinds_test(t) -- Test: all kinds of events (err, wng, cat)
local memo = viewers.save_configs("events.all_kinds_test") -- Save global configuration before eventual changes.
events.all_kinds_trck = "\n* events.all_kinds_trck: "
local t = t or ""
t = t .. "\n* events.all_kinds_test(t) -- Test: all kinds of events (err, wng, cat): "
t = t .. events.all_kinds_trck
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = events.all_kinds_test_test_group, -- Use default cases.
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 = {},
}
function tab_view.form_one_case(one_event) -- Convert a case from test_group to rowGroup.
return { one_event.typ or "t", one_event.key or "k", one_event.idargs or "i", one_event.res or "r" }
end
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
t = t .. viewers.ta("end #test_group *2", lua_table.level_count(tab_view.test_group) ) -- function tableview.new( nil bug170602
t = t .. viewers.ta("end #rowGroup *2", lua_table.level_count(tab_view.rowGroup) ) -- function tableview.new( nil bug170602
t = t .. events.all_kinds_trck
viewers.restore_configs(memo, "events.all_kinds_test") -- Restore global configurations after eventual changes.
return t
end -- function events.all_kinds_test(t)
 
function events.add_cat_group(groupCat, groupList) -- Add some categories in the actual table of events. Separated by ";".
-- catGroup("Country %1", "France,Italia") -> [[Category:Country France]] [[Category:Country Italia]]
if type(groupCat) ~= "string" then groupCat = "%1" end
if type(groupList) ~= "string" then return "" end
local cats = ""
for i, str in mw.text.gsplit(groupList, ";", true) do
local wkt = viewers.form9user(groupCat, str)
cats = cats .. events.add_cat(groupCat, wkt)
end
local res, one_event = events.add("catGroup", groupCat, cats) -- Add an event to a group.
one_event.trc = one_event.trc .. viewers.form9user("\n* add_cat one_event.typ=%1, one_event.key=%2, ", one_event.typ, one_event.key)
return res, one_event
end -- function events.add_cat_group(groupCat, groupList)
 
function events.select_typ(typ) -- Select events by one type
local is = {}
for i, one_event in pairs(events.test_group) do
if one_event.typ == typ then table.insert( is, one_event.idargs ) end
end
return is
end
 
function events.sort_typ() -- Sort events by type in wng, err, cat.
local wng, err, cat = {}, {}, {}
for i, one_event in pairs(events.test_group) do
if one_event.typ == "wng" then table.insert( wng, one_event ) end
if one_event.typ == "err" then table.insert( err, one_event ) end
if one_event.typ == "cat" then table.insert( cat, one_event ) end
end
return wng, err, cat
end -- function events.sort_typ()
 
function events.selector( tab_view, one_event )
if type(one_event) ~= "table" then
one_event = { -- options for tableview.new() -- Formats a table with lines and columns.
headers = "typ;key;selector-name;wkt",
style = "",
typ = "err",
rowGroup = {},
}
else
one_event.headers = one_event.headers or "typ;key;else-name;wkt"
one_event.tableStyle = one_event.tableStyle or ""
one_event.name = one_event.name or "_"
one_event.typ = one_event.typ or "nil"
end
if (type(tab_view) == "table") and (type(tab_view.typ) == "string") and (tab_view.typ == one_event.typ) then
table.insert( tab_view.test_group, { one_event.typ, one_event.key, one_event.name, one_event.wkt } )
elseif (type(tab_view) == "table") and (type(tab_view.typ) == "string") and (tab_view.typ == "v") then
table.insert( tab_view.test_group, { one_event.typ, one_event.key, one_event.name, one_event.wkt } )
else
tab_view = {}
table.insert( tab_view.test_group, { one_event.typ, one_event.key, one_event.name, one_event.wkt } )
end
end -- function events.selector( tab_view, one_event )
 
function events.all_kinds_test_test(t) -- Test: all kinds of events (err, wng, cat)
local memo = viewers.save_configs("events.all_categories_test") -- Save global configuration before eventual changes.
local t = t or "\n* <b>events.all_kinds_test()</b> Test: all kinds of events (err, wng, cat)"
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = nil, -- Use default cases.
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",
}
function tab_view.form_one_case(one_event) -- Convert a case from test_group to rowGroup.
return { one_event.typ, one_event.key, one_event.idargs, one_event.res }
end
t = t .. tableview.new(tab_view) -- Form a table view with lines and columns.
viewers.restore_configs(memo, "events.all_kinds_test_test") -- Restore global configurations after eventual changes.
return t --, errors -- langs_missing_translations_title
end -- function events.all_kinds_test_test(t)
 
events.errors_list = {} -- Deprecated: Table to collect errors and warnings
events.erron = true -- Activated or not errors. Errores activado o no. Erreurs activées ou non.
events.categories_list = {} -- Table to collect all categories to generate in wikitext
 
function events.errors_lister(title, v1, v2, v3, v4, v5, v6, v7, v8, v9)
local res, msgref = "", ""
local mwtitle = mw.title.getCurrentTitle()
local page = tostring(mwtitle.nsText) .. ":" .. tostring(mwtitle.text)
if type(title) ~= "string" then title = "modes_error_list_header_err" end
res = res .. '\n*' .. viewers.form9user(title, page, v1, v2, v3, v4, v5, v6, v7, v8, v9) -- .. ' - ' .. page
local n = 0
for k, wng in ipairs(events.errors_list) do
msgref = viewers.form9user(wng.ref, wng.v1, wng.v2, wng.v3, wng.v4, wng.v5, wng.v6, wng.v7, wng.v8, wng.v9) -- texte traduit ou direct
if wng.typ == "wng" then
res = res .. '<br>⦁ ' .. viewers.styles_color_warning(msgref)
end
end
for k, wng in ipairs(events.errors_list) do
msgref = viewers.form9user(wng.ref, wng.v1, wng.v2, wng.v3, wng.v4, wng.v5, wng.v6, wng.v7, wng.v8, wng.v9) -- texte traduit ou direct
if wng.typ == "err" then
res = res .. '<br>⦁ ' .. viewers.styles_color_error(msgref)
n = n + 1
end
end
if n > 0 then
events.add_cat("versions_module_with_error_err")
end
return res
end -- function events.errors_lister(title, v1, v2, v3, v4, v5, v6, v7, v8, v9)
 
function events.gener_categories() -- Only for this library, form categories without activate them
-- events.gener_categories Only display categories, as a text line, using function events.categories_lister
-- function events.formats(one_event, c) -- Format an event as an error, warning or category.
local gener = {}
modes.options_to_cat_view()
-- c can replace cat_view to enforce the documentation or the categorisation
c = c or modes.cat_view or ""
for k, one_event in pairs(events.all_events_group) do
one_event = events.formats(one_event, c) -- Format an event as an error, warning or category.
table.insert(gener, one_event ) -- Build a table with translations counts.
end
return gener
end -- function events.gener_categories(known_arguments)
 
function events.categories_lister(c) -- Categorize categories, or view categories if c=":".
local res = ""
modes.options_to_cat_view()
-- c can replace cat_view to enforce the documentation or the categorisation
c = c or modes.cat_view or ""
for k, one_event in pairs(events.all_events_group) do
if (one_event.typ == "cat") then
local keyuser = viewers.form9user(one_event.key)
local keycontent = viewers.form9content(one_event.key)
res = res .. events.formats_cat(one_event, keyuser, keycontent, c)
end
end
return res
end -- function events.categories_lister(c)
 
-- cut_libraries
Ligne 2 055 ⟶ 2 456 :
langs.i18n = {} -- Translations for Library:langs
langs.i18n.br = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
language = 'langue',
langs_translations_counts_title = "langs.translations_counts() Comptages des traductions en tables",
Ligne 2 103 ⟶ 2 502 :
} -- langs.i18n.br
langs.i18n.de = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
language = 'Sprache',
langs_translations_counts_title = "langs.translations_counts() Übersetzungen in Tabellen zählen",
Ligne 2 127 ⟶ 2 524 :
langs_main_i18n_languages_count = "Dieses Modul kann <b>%1</b> Sätze in <b>%2</b> Sprachen übersetzen.",
langs_table_can_translate_counts = "LaDie Tabelle <b>%1</b> kann <b>%2</b> Sätze in <b>%3</b> Sprachen übersetzen.",
langs_mw_language_fetchLanguageName = "<b>%1</b>(<b>%2</b>=<b>%3</b>), ",
langs_counts_translations_headers = "*; Name der Tabelle; Texte; Tabellen; Kommentar",
langs_i18n_list_all_string = "Diese Liste zeigt alle Texte, kann aber die ursprünglichen Aussagen nicht ersetzen.",
Ligne 2 151 ⟶ 2 548 :
} -- langs.i18n.de
langs.i18n.en = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
language = 'language',
langs_translations_counts_title = "langs.translations_counts() Counts of translations into tables",
Ligne 2 200 ⟶ 2 595 :
} -- langs.i18n.en
langs.i18n.es = { -- ¿Quién es?
["docfunc"] = "docfunc",
["dockey"] = "dockey",
language = 'lenguaje',
langs_translations_counts_title = "langs.translations_counts() Condes des traducciones en tablas",
Ligne 2 225 ⟶ 2 618 :
langs_main_i18n_languages_count = "Este módulo puede traducir <b>%1</b> frases en <b>%2</b> idiomas: ",
langs_table_can_translate_counts = "Tabla <b>%1</b> puede traducir <b>%2</b> frases en <b>%3</b> idiomas.",
langs_mw_language_fetchLanguageName = "<b>%1</b>( <b>%2</b> = <b>%3</b> ), ",
langs_counts_translations_headers = "*; Nombre de la tabla; Textos; Mesas; Comentario",
langs_languages_nbr_and_list = "\n* Hay <b>%1</b> mesas de traducciones en estas idiomas: <b>%2</b> <br>",
Ligne 2 250 ⟶ 2 643 :
} -- langs.i18n.es
langs.i18n.fr = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
language = 'langue',
langs_translations_counts_title = "langs.translations_counts() Comptages des traductions en tables",
Ligne 2 298 ⟶ 2 689 :
} -- langs.i18n.fr
langs.i18n.hu = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
language = 'nyelv',
langs_translations_counts_title = "langs.translations_counts() Fordítások a táblázatokba",
Ligne 2 347 ⟶ 2 736 :
} -- langs.i18n.hu
langs.i18n.vi = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
language = 'langue',
langs_translations_counts_title = "langs.translations_counts() Số bản dịch vào các bảng",
Ligne 2 504 ⟶ 2 891 :
headers_class = "wikitable alternative center sortable",
rowselect = selector,
rowGroup = {}, -- tests or tab_view.test_group or
-- track_on == "details",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 2 523 ⟶ 2 909 :
local memo = viewers.save_configs("langs.translations_statistics_report") -- Save global configuration before eventual changes.
local t = t or "\n* <b>langs.translations_statistics_report(t)</b> Statistical report on translations by languages and libraries."
t = t .. "\n* TacticGuideline for this stat : Count lists of translations by languages and libraries, then convert in a 2D table, then format and report them."
t = t .. "\n* <b>Normal result: Counts are similar in all languages.</b>"
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- modes.known_arguments = { -- p.known_arguments - = { -- }
local translate_i18n = versions.memo_i18n
local all_stats = {} -- all_stats + Total
local trans_count, case, i18n_group, total_stat, total_stats = 0
-- TacticGuideline for this stat : Collect counts of translations by languages and libraries, then put them in a 2D table, then format and report them.RIC
for libname, vers in pairs(package.loaded) do -- in reverse order bind_libra
total_stat = { ["libr"] = tostring(vers.libname), ["code"] = "en", ["content"] = 0, ["page"] = 0, ["user"] = 0, ["n_langs"] = 0, ["total"] = 0, }
Ligne 2 625 ⟶ 3 011 :
end -- function langs.key(key, lang)
 
function langs.list_MediaWiki_languagesmain_i18n_languages_list(t, lang) -- List allavailable translations MediaWikiand languages.
local main_i18n = versions.memo_i18n or {}
local memo = viewers.save_configs("langs.list_MediaWiki_languages") -- Save global configuration before eventual changes.
local xxx, strings_c, tables_c, strs_on_tabs, subnames = langs.i18n_sub_counts("versions.memo_i18n", "langs_main_i18n_languages_count", "user")
if type(t) ~= "string" then t = "\n* <b>langs.list_MediaWiki_languages()</b> List all known MediaWiki languages:" end
local tab_to_sort = {}
local interwikiMap = mw.site.interwikiMap("local") local lang = mw.language.new( langs.user_lang or "en" )
for lang, modname in pairs(main_i18n) do
local LangCode = lang:getFallbackLanguages()
table.insert(tab_to_sort, lang) -- build a table with only languages codes
local lang_code_name = mw.language.fetchLanguageNames() -- inLanguage, 'mwfile' )
local toSort, t2 = {}, ""
local t = (t or "") .. "\n* Infos lang_code_name: " .. viewers.ta("#lang_code_name", lua_table.level_count(lang_code_name) )
for code, name in pairs(lang_code_name) do -- make a true table in rough order
table.insert(toSort, { code, name } )
-- insert detail { [1]=code, [2]=name } )
end
table.sort(toSorttab_to_sort, function (row_xa, row_yb) return-- (sort row_x[1]the <languages row_x[1] ) end ) --codes Sortin basedstable onalphabetic [1]=codeorder
return ( a < b )
table.sort(toSort, function (row_x, row_y) return ( row_x[2] < row_x[2] ) end ) -- Sort based on [2]=name
end )
t = t .. "\n* List of <b>known</b> languages of MediaWiki lang_code_name: <br/>" .. t2
strs_on_tabs = math.floor(strs_on_tabs / tables_c)
t = t .. "\n* Infos: " .. viewers.ta("#lang_code_name", lua_table.level_count(lang_code_name) ) .. viewers.ta("#toSort", lua_table.level_count(toSort) ) .. viewers.ta("user_lang", langs.user_lang)
local t = viewers.form9user("langs_main_i18n_languages_count", strs_on_tabs, tables_c)
t2 = ""
for i, lang in pairs(toSorttab_to_sort) do -- Name and count translations in each language
local langi18n = "langs.main_i18n." .. lang
local ok = 1 or langs.abnormal_char_in_text(lang[2], langs.user_lang) -- Detect abnormal characters in an unilingual text.
local xxx, strings_c, tables_c, strs_on_tabs, subnames = langs.i18n_sub_counts(langi18n, "langs_main_i18n_languages_count", "user")
local lang_2 = lang[2]
t = t .. "<b>" .. strings_c .. "</b>-"
if not ok then lang_2 = viewers.styles_color_error(lang_2) end
local nativename = mw.language.fetchLanguageName(lang)
t2 = t2 .. viewers.ta( lang[1], lang_2 ) -- .. "\n* "
local englishname = mw.language.fetchLanguageName(lang, "en")
end
local englishname = mw.language.fetchLanguageName(lang, "en")
t = t .. "\n* List of <b>known</b> languages of MediaWiki: <br/>" .. t2
t = t .. viewers.form9user("langs_mw_language_fetchLanguageName", nativename, lang, englishname) -- "<b>%1</b>(%2=%3), "
viewers.restore_configs(memo, "langs.list_MediaWiki_languages") -- Restore global configurations after eventual changes.
if i > 12 then t = t .. "<b> ...</b>" ; break end
end -- see langs.select_lang
return t
end -- function langs.list_MediaWiki_languagesmain_i18n_languages_list(t, lang)
 
langs.Central_version = "Central-s-fr" -- To adapt the version of Module:Centralizer in any translated text.
langs.default_user_lang = "en" -- To adapt the version of Module:Centralizer in any translated text.
-- waiting T68051 Central modules need the user language to display errors and category names
 
function langs.init_content_page_user_lang(content_lang, page_lang, user_lang)
-- Initialize or change the content, the page and the user languages and their translations tables.
-- TacticGuide line: decreasing priority, for each of these 3 languages, is : argument, else MediaWiki, else default values.
-- See also https://meta.wikimedia.org/wiki/Translate_extension and [[Special:PageLanguage]] 2016-12-19
local main_i18n = versions.memo_i18n or langs.main_i18n or versions.main_i18n or {}
local t = "" -- internal track
local lg = {}
Ligne 2 707 ⟶ 3 094 :
{ 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 726 ⟶ 3 111 :
local memo = viewers.save_configs("langs.list_MediaWiki_languages") -- Save global configuration before eventual changes.
if type(t) ~= "string" then t = "\n* <b>langs.list_MediaWiki_languages()</b> List all known MediaWiki languages:" end
local interwikiMap = mw.site.interwikiMap("local") local lang = mw.language.new( langs.user_lang or "en" )
local lang = mw.language.new( langs.user_lang or "en" )
local LangCode = lang:getFallbackLanguages()
local lang_code_name = mw.language.fetchLanguageNames() -- inLanguage, 'mwfile' )
local toSort, t2 = {}, ""
local t = (t or "") .. "\n* Infos lang_code_name: " .. viewers.ta("#lang_code_name", lua_table.level_count(lang_code_name) )
for code, name in pairs(lang_code_name) do table.insert(toSort, { code, name } ) end -- make a true table in rough order
table.insert(toSort, { code, name } )
-- insert detail { [1]=code, [2]=name } )
end
table.sort(toSort, function (row_x, row_y) return ( row_x[1] < row_x[1] ) end ) -- Sort based on [1]=code
table.sort(toSort, function (row_x, row_y) return ( row_x[2] < row_x[2] ) end ) -- Sort based on [2]=name
t = t .. "\n* List of <b>known</b> languages of MediaWiki lang_code_name: <br/>" .. t2
Ligne 2 852 ⟶ 3 240 :
kind = "projects", -- MediaWiki or projects
typ = "err",
rowGroup = {}, -- tests or tab_view.test_group or
-- track_on == "details",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 2 964 ⟶ 3 351 :
kind = "projects", -- MediaWiki or projects
typ = "err",
rowGroup = {}, -- tests or tab_view.test_group or
-- track_on == "details",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 3 050 ⟶ 3 436 :
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 061 ⟶ 3 446 :
-- local isLang = mw.language.isSupportedLanguage(lang)
local isBuilt = mw.language.isValidBuiltInCode(lang)
local space_name = tostring(mw.site.namespaces.Module.name)
return { lang, isTag, tostring(isLang), isBuilt, langname, native, }
return { lang, isTag, tostring(isLang), isBuilt, langname, native, space_name, }
end
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
Ligne 3 083 ⟶ 3 469 :
lua_table.i18n = {} -- Translations for lua_table library
lua_table.i18n.br = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
luaTable_recursive_luaTable_title = "MediaWiki lua_table récursive",
luaTable_rough_view_tests_title = "lua_table.rough_view() Test: Former un code Lua grossier d'une table",
Ligne 3 101 ⟶ 3 485 :
luaTable_table_dont_exists_err = "La table <b>%1</b> n'existe pas.",
luaTable_table_args_source_title = "lua_table.structure() Table des arguments reçus, args_source :",
luaTable_tables_differences_title = "signalerSignaler les différences entre 2 tables.",
} -- lua_table.i18n.br
lua_table.i18n.de = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
luaTable_recursive_luaTable_title = "MediaWiki lua_table rekursive",
luaTable_rough_view_tests_title = "lua_table.rough_view() Test: Bilden Sie einen groben Lua-Code aus einer Tabelle",
Ligne 3 122 ⟶ 3 504 :
luaTable_table_dont_exists_err = "Tabelle <b>%1</b> existiert nicht.",
luaTable_table_args_source_title = "lua_table.structure() Tabelle der Argumente erhaltenTabelle der Argumente erhalten, args_source:",
luaTable_tables_differences_title = "berichtenBerichten Sie die Unterschiede zwischen 2 Tabellen.",
} -- lua_table.i18n.de
lua_table.i18n.en = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
luaTable_recursive_luaTable_title = "MediaWiki recursive lua_table",
luaTable_rough_view_tests_title = "lua_table.rough_view() Test: Formats a rough Lua code of a table",
Ligne 3 146 ⟶ 3 526 :
} -- lua_table.i18n.en
lua_table.i18n.es = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
luaTable_recursive_luaTable_title = "MediaWiki lua_table recursiva",
luaTable_rough_view_tests_title = "lua_table.rough_view() Prueba: Formar un código de Lua grueso de una tabla",
Ligne 3 164 ⟶ 3 542 :
luaTable_table_dont_exists_err = "La tabla <b>%1</b> no existe.",
luaTable_table_args_source_title = "lua_table.structure() Tabla de argumentos recibido, args_source:",
luaTable_tables_differences_title = "reportarReportar diferencias entre 2 tablas.",
} -- lua_table.i18n.es
lua_table.i18n.fr = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
luaTable_recursive_luaTable_title = "MediaWiki lua_table récursive",
luaTable_rough_view_tests_title = "lua_table.rough_view() Test: Former un code Lua grossier d'une table",
Ligne 3 188 ⟶ 3 564 :
} -- lua_table.i18n.fr
lua_table.i18n.hu = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
luaTable_recursive_luaTable_title = "MediaWiki lua_table rekurzív",
luaTable_rough_view_tests_title = "lua_table.rough_view() Teszt: Formázz egy durva Lua kódot egy asztaltól",
Ligne 3 205 ⟶ 3 579 :
luaTable_table_dont_exists_err = "A <b>%1</b> táblázat nem létezik.",
luaTable_table_args_source_title = "lua_table.structure() A kapott érvek táblázata, args_source :",
luaTable_tables_differences_title = "jelenteniJelenteni a különbségeket a két táblázat között.",
} -- lua_table.i18n.hu
lua_table.i18n.vi = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
luaTable_recursive_luaTable_title = "MediaWiki lua_table đệ quy",
luaTable_rough_view_tests_title = "lua_table.rough_view() Kiểm tra: Tạo thành một mã Lua thô từ một bảng",
Ligne 3 225 ⟶ 3 597 :
luaTable_table_dont_exists_err = "Bảng <b>%1</b> không tồn tại.",
luaTable_table_args_source_title = "lua_table.structure() Bảng đối số nhận được, args_source:",
luaTable_tables_differences_title = "báoBáo cáo sự khác biệt giữa 2 bảng.",
} -- lua_table.i18n.vi
 
Ligne 3 405 ⟶ 3 777 :
return tabN_to_list1(tab, 1, ...)
end -- function lua_table.to_list(tab, ...)
 
--[[ viewers.value(
ftd = ftd .. "lua_table.count_all;lua_table.count_tests;lua_table.count_types;lua_table.count_values;"
ftd = ftd .. "lua_table.from_subnames_object;lua_table.from_subnames_table;lua_table.level_count;lua_table.level_get;"
ftd = ftd .. "lua_table.level_list;lua_table.named_sub_counts;lua_table.obj_from_subnames;lua_table.sort_onkey;"
ftd = ftd .. "lua_table.sort_types;lua_table.structure;lua_table.structure_recursive_report;lua_table.tab_from_subnames;"
ftd = ftd .. "lua_table.to_list;lua_table.to_list_tests;lua_table.to_table;lua_table.to_table_test;"
 
function viewers.value(value, form) -- Formats a string to discribe a value like: true, 123.456, "abcd", func(), table{}.
local typ, view = type(value), "-" -- options: ' nonil noquote '
if typ == "boolean" then
if value == true then view = "true" else view = "false" end
elseif typ == "function" then view = "func()"
elseif typ == "number" then view = tostring(value)
elseif typ == "string" then
if viewers.is_in('noquote', form) then view = value
else view = '"' .. value .. '"' end
elseif typ == "table" then view = "table{}"
elseif typ == "nil" then view = "nil"
if viewers.is_in('nonil', form) then view = "" end
end
return view
end -- function viewers.value(value, form)
 
{| class="wikitable alternative center" |
! scope="col" | Cas testé ! scope="col" | Table à lister, vue brute ! scope="col" | Liste de sortie |- | Simple table | { [1] = 123, [2] = abc, [3] = 456, [4] = def, } | [1] = 123 , [2] = abc , [3] = 456 , [4] = def , |- | Text and number | { [1] = one, [2] = 111, } | [1] = one , [2] = 111 , |- | Function and Logic | { [1] = function, [2] = true, [3] = false,
["1"] = function() }
| [1] = function , [2] = true , [3] = false , |- | 10 values in the table | { [1] = a, [2] = b, [3] = c, [4] = d, [5] = e, [6] = f, [7] = g, [8] = h, [9] = i9, [10] = j10, } | [1] = a , [2] = b , [3] = c , [4] = d , [5] = e , [6] = f , [7] = g , [8] = h , [9] = i9 , [10] = j10 ,
|}
-- function viewers.ta(
function viewers.ta(txt, val, sep) -- Formats an argument and its value in a documentation. The text is "nil" if the value is nil.
if val == nil then val = "nil" end
if sep == nil then sep = "=" end
return tostring(txt) .. " " .. tostring(sep) .. " <b>" .. tostring(val) .. "</b> " .. ", "
end
--]]
 
function lua_table.to_list_tests(t) -- Return a list from a Lua table.
Ligne 3 411 ⟶ 3 819 :
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = {
-- { "Simple table", { 123, "abc", ["key"] =456, "txtdef", }, },
-- { "AllText typesand transmitednumber", { "nameone", 111, true, false, { 789, "xyz"}, function()end }, },
-- { "10Function valuesand in the tableLogic", { "a"function()end, "b", "c"true, "d"false, "e", "f", "g", "h", "i9", "j10" }, },
{ "Any10 numbervalues ofin valuesthe table", { "a", "b", "c", "d", "e", "f", "g", "h", "i9", "j10" }, },
{ "Any number of values", { "a", "b", "c", "d", "e", "f", "g", "h", "i09", }, },
{ "Any number of values", { "a", "b", "c", "d", "e", "f", "g", "h", "i09", "j10", }, },
{ "Any number of values", { "a", "b", "c", "d", "e", "f", "g", "h", "i09", "j10", "k11", }, },
},
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 439 ⟶ 3 841 :
return t --, errors -- langs_missing_translations_title
end -- function lua_table.to_list_tests(t)
 
 
function lua_table.toList(tab, ...) -- Return a list from any Lua table.
-- This function is the reverse of func( ... )
if (type(tab) ~= "table") then tab = {} end
local tab = mw.clone(tab) -- to not disturb original table
local maxn = lua_table.count_all(tab)
local function tabN_to_list1(tab, n, ...)
local max_tab = lua_table.count_all(tab)
local listab = {...}
local max_list = lua_table.count_all(listab)
local tab_last = tab[n] -- last element, even a table to not delete below
local tab_last_string = type(tab_last) -- tostring(tab_last)
if (type(tab_last) ~= "nil") and (n <= max_tab) then
if (type(tab) == "table") then
return tab_last, tabN_to_list1(tab, n + 1, ...)
else
tab_last = tostring(tab_last)
end
else return end
end
return tabN_to_list1(tab, 1, ...)
end -- function lua_table.toList(tab, ...)
 
function lua_table.toList_tests(t) -- Return a list from a LUA table.
local memo = events.save_configs() -- Save global configuration before eventual changes.
local t = t or "\n* <b>events.all_kinds_test()</b> Test: all kinds of events (err, wng, cat)"
local tabView = {
testGroup = {
{ "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", "i09", "j10",
"a", "b", "c", "d", "e", "f", "g", "h", "i19", "j20",
"a", "b", "c", "d", "e", "f", "g", "h", "i29", "j30",
"a", "b", "c", "d", "e", "f", "g", "h", "i39", "j40",
"a", "b", "c", "d", "e", "f", "g", "h", "i49", "j50",
"a", "b", "c", "d", "e", "f", "g", "h", "i59", "j60" }, },
},
title_memo = "luaTable_toList_tests_title", -- "lua_table.toList() Return a list from a Lua table.",
headers = "luaTable_toList_tests_headers", -- "Tested case; Input table, roughView; Output list",
}
function tabView.form_one_case(case) -- Convert a case from testGroup to rowGroup.
local descript = case[1]
local tabview = lua_table.roughView( case[2] )
local tab_list = { lua_table.toList( case[2] ) }
local t1 = ""
for i, elem in ipairs(tab_list) do
t1 = t1 .. viewer.ta( "[" .. i .. "]", tostring(elem) )
end
return { descript, tabview, t1, }
end
local t = tableview.form(tabView) -- Form a table view with lines and columns.
events.restore_configs(memo) -- Restore global configurations after eventual changes.
return t --, errors -- langs_missing_translations_title
end -- function lua_table.toList_tests(t)
 
function lua_table.to_table(stringList, pattern, plain) -- convert a string to a table of words
Ligne 3 468 ⟶ 3 927 :
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 686 ⟶ 4 143 :
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 3 989 ⟶ 4 444 :
mathroman.i18n = {} -- Translations for mathroman library
mathroman.i18n.br = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
mathroman_errors_head_err = "Erreur : ",
mathroman_roman_err = "Erreur de romain : ",
Ligne 4 004 ⟶ 4 457 :
mathroman_roman2int_tests_headers = "Nombre romain; Valeur décimale; Correct; Erreur(s)",
mathroman_int2roman_test_title = "mathroman.int2roman() Test des nombres décimaux en nombres romains",
mathroman_int2roman_tests_headers = "Nombre romaindécimal; entierValeur résultantromaine; attenduCorrect; Erreurs; raisonErreur(s)", -- br fr
mathroman_int_is_not_integer_err = "Le nombre non entier <b>%1</b> n'est pas convertible en nombre romain",
mathroman_int_is_not_number_err = "La valeur <b>%1</b> n'est pas un nombre convertible en nombre romain",
Ligne 4 010 ⟶ 4 463 :
} -- mathroman.i18n.br
mathroman.i18n.de = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
mathroman_errors_head_err = "Fehler: ",
mathroman_roman_err = "Römischer Fehler: ",
Ligne 4 025 ⟶ 4 476 :
mathroman_roman2int_tests_headers = "Römische Nummer; Dezimalwert; Richtig; Error (s)",
mathroman_int2roman_test_title = "mathroman.int2roman() Test von Dezimalzahlen in römischen Zahlen",
mathroman_int2roman_tests_headers = "Römische ZahlDezimalzahl; resultierendeRömischer GanzzahlWert; erwartetRichtig; Fehler;Error Grund(s)", -- de
mathroman_int_is_not_integer_err = "Das nicht ganzzahlige <b>%1</b> ist nicht in römische Zahl umwandelbar",
mathroman_int_is_not_number_err = "Der Wert <b>%1</b> ist keine Zahl, die in eine römische Zahl umgewandelt werden kann",
Ligne 4 031 ⟶ 4 482 :
} -- mathroman.i18n.de
mathroman.i18n.en = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
mathroman_errors_head_err = "Error: ",
mathroman_roman_err = "Roman error: ",
Ligne 4 046 ⟶ 4 495 :
mathroman_roman2int_tests_headers = "Roman number; Digital value; Correct; Error(s)",
mathroman_int2roman_test_title = "mathroman.int2roman() Test digital numbers to roman numbers",
mathroman_int2roman_tests_headers = "RomanDigital number; resultingRoman integervalue; expectedCorrect; errors; reasonError(s)", -- en
mathroman_int_is_not_integer_err = "The not integer number <b>%1</b> is not convertible to Roman numeral",
mathroman_int_is_not_number_err = "The value <b>%1</b> is not a convertible number to Roman numeral",
Ligne 4 052 ⟶ 4 501 :
} -- mathroman.i18n.en
mathroman.i18n.es = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
mathroman_errors_head_err = "Error: ",
mathroman_roman_err = "Error de romano: ",
Ligne 4 067 ⟶ 4 514 :
mathroman_roman2int_tests_headers = "Número romano; Valor digital; Corregido; Error(s)",
mathroman_int2roman_test_title = "mathroman.int2roman() Prueba de números decimales a números romanos",
mathroman_int2roman_tests_headers = "Número romano;decimal, enteroValor resultanteromana; esperadoCorrecto; errores; razónError(es),", -- es
mathroman_int_is_not_integer_err = "El no entero <b>%1</b> no se puede convertir en número romano",
mathroman_int_is_not_number_err = "El valor <b>%1</b> no es un número y no se puede convertir en número romano",
Ligne 4 073 ⟶ 4 520 :
} -- mathroman.i18n.es
mathroman.i18n.fr = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
mathroman_errors_head_err = "Erreur : ",
mathroman_roman_err = "Erreur de romain : ",
Ligne 4 088 ⟶ 4 533 :
mathroman_roman2int_tests_headers = "Nombre romain; Valeur décimale; Correct; Erreur(s)",
mathroman_int2roman_test_title = "mathroman.int2roman() Test des nombres décimaux en nombres romains",
mathroman_int2roman_tests_headers = "Nombre romaindécimal; entierValeur résultantromaine; attenduCorrect; Erreurs; raisonErreur(s)", -- br fr
mathroman_int_is_not_integer_err = "Le nombre non entier <b>%1</b> n'est pas convertible en nombre romain",
mathroman_int_is_not_number_err = "La valeur <b>%1</b> n'est pas un nombre convertible en nombre romain",
Ligne 4 094 ⟶ 4 539 :
} -- mathroman.i18n.fr
mathroman.i18n.hu = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
mathroman_errors_head_err = "Hiba: ",
mathroman_roman_err = "Római hiba: ",
Ligne 4 109 ⟶ 4 552 :
mathroman_roman2int_tests_headers = "Római szám; Decimális érték; helyes; Hiba (k)",
mathroman_int2roman_test_title = "mathroman.int2roman() A decimális számok vizsgálata római számokban",
mathroman_int2roman_tests_headers = "RómaiTizedes szám,; ennekRómai eredményekéntérték; azhelyes; egészHiba szám, a várható, a hibák, az ok(k)", -- hu
mathroman_int_is_not_integer_err = "A nem egész <b>%1</b> nem konvertálható a római számra",
mathroman_int_is_not_number_err = "A <b>%1</b> érték nem egy szám, amely átváltható egy római számra",
Ligne 4 115 ⟶ 4 558 :
} -- mathroman.i18n.hu
mathroman.i18n.vi = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
mathroman_errors_head_err = "Lỗi: ",
mathroman_roman_err = "Lỗi roman: ",
Ligne 4 130 ⟶ 4 571 :
mathroman_roman2int_tests_headers = "Số La Mã; Giá trị thập phân; chính xác; Lỗi",
mathroman_int2roman_test_title = "mathroman.int2roman() Kiểm tra các số thập phân trong số La Mã",
mathroman_int2roman_tests_headers = "Số Lathập phân; kếtGiá quảtrị La số nguyên; dựchính kiếnxác; lỗi; lý do", -- vi
mathroman_int_is_not_integer_err = "Số nguyên <b>%1</b> không thể chuyển đổi thành số La Mã",
mathroman_int_is_not_number_err = "Giá trị <b>%1</b> không phải là số có thể chuyển đổi thành số La Mã",
Ligne 4 140 ⟶ 4 581 :
-- Romans view : XIJ=12 MCXI=1111 MCDXLIV=1444 MDCLXVI=1666 MCMXCIX=1999 MMCCXXII=2222 MMMMCMXCIX=4999 ERREURS=0 erreur caractere S en 7. XIA=11 erreur caractere A en 3. XJI=12 erreur caractere J avant la fin. IXC=89 erreur caracteres croissants. VLD=445 erreur caracteres croissants. MMMMM=5000 erreur > 4999. MMMMMYJXC=5089 erreur > 4999. erreur caractere Y en 6. erreur caractere J avant la fin.
 
function mathroman.roman2int(rm) -- Convert a roman number to integer -- S170606rmn
mathroman.known_arguments = { -- Table of the definitions of all known arguments at module level.
-- { ["name"] = "mathroman.roman2int (4)', ["args"] = { "VI", }, ["expect"] = { 123 } }, -- example of test case
-- Arguments in order without names, with their keyword for use as other arguments.
local v = 0 -- valeur totale
[1] = { ["syn"] = 2, ["need"] = "noevent", ["keyword"] = "mode"},
local v1 = 0 -- valeur de derniere lettre
-- Special arguments to modify the fonctions and outputs of this module.
local v2 = 0 -- valeur de lettre precedente
["mode"] = { ["typ"] = "config", ["need"] = "noevent", ["keyword"] = "mode"},
local v3 = 0 -- valeur de lettre precedente
["c"] = { ["typ"] = "config", ["need"] = "noevent", ["keyword"] = "c"},
local x = '-' -- caractere en cours d'evaluation
["options"] = { ["typ"] = "config", ["need"] = "noevent", ["keyword"] = "options"},
local i = 1 -- numero du caractere en cours d'evaluation
-- The userlang argument permits at an administrator in his own langage (errors, warnings, catégories, tests) to help a wiki in any language.
local j = 0 -- numero du caractere de reference courant (debut en Lua)
["contentlang"] = { ["typ"] = "config", ["need"] = "noevent", ["keyword"] = "contentlang"},
local k = 0 -- numero du caractere de reference courant (fin en Lua)
["pagelang"] = { ["typ"] = "config", ["need"] = "noevent", ["keyword"] = "pagelang"},
local errs, errtab = "", {}
["userlang"] = { ["typ"] = "config", ["need"] = "noevent", ["keyword"] = "userlang"},
if type(rm) ~= "string" then
["birthyear"] = { ["typ"] = "dat", ["need"] = "noevent", ["keyword"] = "birthyear", ["prop"] = "P569", ["format"] = "year", },
table.insert(errtab, tostring(events.add_err("mathroman_is_not_string_err", tostring(rm) ) ) )
["deathyear"] = { ["typ"] = "dat", ["need"] = "noevent", ["keyword"] = "deathyear", ["prop"] = "P570", ["format"] = "year", },
return 0, errs
}
end
if rm == "" then
errs = errs .. events.add_err("mathroman_is_not_string_err", '""')
table.insert(errtab, tostring(events.add_err("mathroman_is_not_string_err", '""') ) )
return 0, errs
end
if type(rm) ~= "string" then rm = "-" end
local lst = '-MDCLXVIJ' -- caracteres autorises
x = string.sub(rm, i, i) or ''
while (x ~= '') do
v3 = v2
v2 = v1
v1 = 0
if ( x == 'M' ) then v1 = 1000 end
if ( x == 'D' ) then v1 = 500 end
if ( x == 'C' ) then v1 = 100 end
if ( x == 'L' ) then v1 = 50 end
if ( x == 'X' ) then v1 = 10 end
if ( x == 'V' ) then v1 = 5 end
if ( x == 'I' ) then v1 = 1 end
if ( x == 'J' ) then v1 = 1 end
if ( x == 'J' ) and ( i < string.len(rm) ) then
errs = errs .. events.add_err("mathroman_J_before_end_err") -- e4 = 'character J before the end'
table.insert(errtab, tostring(events.add_err("mathroman_J_before_end_err") ) ) -- e4 = 'character J before the end'
end
if ( v1 == 0 ) then
errs = errs .. events.add_err("mathroman_char_X_in_N_err", x, i) -- e3 = "character K in 3"
table.insert(errtab, tostring(events.add_err("mathroman_char_X_in_N_err", x, i) ) )
end
v = v + v1
if ( (v1 == 5*v2) or (v1 == 10*v2) ) then v = v - (2*v2) end -- adjust 4, 9, 40, 90 ...
j, k = string.find(lst, x)
if ( j == nil ) then j = -1 end
if ( k == nil ) then k = -1 end
if (v1 > v2) and (v2 > v3) and (v3 > 0) then
errs = errs .. events.add_err("mathroman_char_increase_err") -- e2 = ' increasing chars.'
table.insert(errtab, tostring(events.add_err("mathroman_char_increase_err") ) )
end
i = i + 1
x = string.sub(rm, i, i) or ''
end
if ( v < 1 ) then -- e0 = ' valeur nulle.'
errs = errs .. events.add_err("mathroman_null_value_err")
table.insert(errtab, tostring(events.add_err("mathroman_null_value_err") ) )
end
if ( v > 4999 ) then -- e1 = ' valeur > 4999.'
errs = errs .. events.add_err("mathroman_greater_4999_err")
table.insert(errtab, tostring(events.add_err("mathroman_greater_4999_err") ) )
end
errs = table.concat(errtab, " ; ")
return v, errs -- with or without errors
end -- function mathroman.roman2int(rm)
 
function mathroman.romani2r(i, j)
Ligne 4 171 ⟶ 4 664 :
end -- function mathroman.romani2r(i, j)
 
function mathroman.int2roman(int) -- Convert an integer to a roman number, also if int is a string.
-- { ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { int = 444 }, ["expect"] = { "CDXLIV" } }, -- example of test case
local errs = "" -- local collection of errors -- S170606rmn
Ligne 4 244 ⟶ 4 737 :
end
end
return vroman, errs -- with or without errors
end -- v, errs =function mathroman.int2roman(int) -- Convert an integer to a roman number
 
function mathroman.roman2int_tests(t) -- Tests of main central modules -- S170606rmn
mathroman.int2romanTests = { -- Autotest cases to validate the mathroman library at MediaWiki level.
local memo = viewers.save_configs("mathroman.roman2int_tests") -- Save global configuration before eventual changes.
-- each test_case defines a name, a function, an input, an output. See also viewers.strTestCase. 8 - 1 = 7 + 8 = 15 cases
local t = t or "\n* " .. viewers.form9user("mathroman_roman2int_tests_title")
{ ["int"] = -10, ["expect"] = "X", ["reason"] = "Forbiden negative value" },
local tab_view = { -- Group datas and options for a table view with lines and columns.
{ ["int"] = 0, ["expect"] = "0", ["reason"] = "Forbiden null value" },
tests_title = "mathroman_roman2int_tests_title", -- "mathroman.roman2int() Test roman to digital numbers"
{ ["int"] = 1, ["expect"] = "I", ["reason"] = "Normal 1 digit value" },
{ ["int"] test_group = 11,{ ["expect"]{ =123, }, { "XI"2.78, }, [{ "reason-X"], =}, { "Normal 2 digit value", },
{ ["int0"] =, 111}, [{ "expectMCXI"] =, },{ "CXIXIJ", }, [{ "reasonXJI"], =}, "Normal{ 3 digit value"XIA", },
{ ["intVLD"] =, 1111}, [ { "expectIXC"], =}, { "MCXIMMMMCMXCIX", }, ["reason"] = { "Normal 4 digit valueMMMMM", },
{ "MMMMMYJXC", }, { {x}, }, { function()end, },
{ ["int"] = "19", ["expect"] = "IXX", ["reason"] = "Converted string value" }, -- ""
},
{ ["int"] = 4999, ["expect"] = "MMMMCMXCIX", ["reason"] = "Highter limit of classic roman numbers" },
headers = "mathroman_roman2int_tests_headers", -- "Roman number; Digital value; Correct; Error(s)"
{ ["int"] = 5000, ["expect"] = "0", ["reason"] = "Smaller too big classic roman numbers" },
rowGroup = {},
}
}
 
tab_view.t = (tab_view.t or "") .. viewers.ta("roman2int_tests: ", "start")
-- vueRomains, available errors :
tab_view.t = tab_view.t .. viewers.ta("#test_group: ", lua_table.level_count(tab_view.test_group) )
-- XIJ=12 MCXI=1111 MCDXLIV=1444 MDCLXVI=1666 MCMXCIX=1999 MMCCXXII=2222 MMMMCMXCIX=4999 ERREURS=0 erreur caractere S en 7.
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
-- XIA=11 erreur caractere A en 3. XJI=12 erreur caractere J avant la fin. IXC=89 erreur caracteres croissants. VLD=445 erreur caracteres croissants.
local word = case[1] -- DEBUG : mathroman.roman2int() can fail without blocking page.
-- MMMMM=5000 erreur > 4999. MMMMMYJXC=5089 erreur > 4999. erreur caractere Y en 6. erreur caractere J avant la fin.
local valX, errs = mathroman.roman2int(word) -- DEBUG : mathroman.roman2int() can fail without blocking page.
local wordX, errsX = mathroman.int2roman(valX) -- DEBUG : mathroman.roman2int() can fail without blocking page.
return { word, valX, wordX, errs .. " " .. errsX, }
end
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
viewers.restore_configs(memo, "mathroman.roman2int_tests") -- Restore global configurations after eventual changes.
return t
end -- function mathroman.roman2int_tests(t)
 
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 integer to roman numbersviewers.form9user("mathroman_int2roman_test_title")
local group = {}
for i, one_test in pairs(mathroman.int2romanTests) do -- apply the tests cases
one_test["result"], one_test["errs_rom"] = mathroman.int2roman( tonumber(one_test["int"]) )
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_memotests_title = "mathroman_int2roman_test_title", -- "mathroman.int2roman() Test integerdigital numbers to roman numbers"
test_group = group{ { -10, }, { 3.14, }, { "not-a-number", }, { "", },
{ 0, }, { 12, }, { 17, }, { "18", }, { "19", },
form_one_case = function(case) -- Convert a case from test_group to rowGroup.
{ 111, }, { 444, }, { 555, },
return { case["int"], tostring(case["result"]), tostring(case["expect"]), case["errors"], case["reason"], }
{ "777", }, { "1111", },{ "4999", }, { "5000", },
end,
},
headers = "roman input; resulting roman; expected; errors; reason", -- to try
headers = "mathroman_int2roman_tests_headers", -- "romanDigital inputnumber; resultingRoman romanvalue; expectedCorrect; errors; reasonError(s)"
headers_class = "wikitable alternative center sortable",
rowGroup = {},
-- track_on == "details",
}
tab_view.t = (tab_view.t or "") .. viewers.ta("int2roman_tests: ", "start")
tab_view.t = tab_view.t .. viewers.ta("#test_group: ", lua_table.level_count(tab_view.test_group) )
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
local val = case[1] -- DEBUG : mathroman.roman2int() can fail without blocking page.
local wordX, errs = mathroman.int2roman(val, " ") -- DEBUG : mathroman.int2roman() can fail without blocking page.
local valX, errsX = mathroman.roman2int(wordX) -- DEBUG : mathroman.roman2int() can fail without blocking page.
return { val, wordX, valX, errs .. " " .. errsX, }
end
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
t = t .. viewers.ta("#test_group: ", lua_table.level_count(tab_view.test_group) )
t = t .. viewers.ta("#rowGroup: ", lua_table.level_count(tab_view.rowGroup) )
viewers.restore_configs(memo, "mathroman.int2roman_test") -- Restore global configurations after eventual changes.
return t
end -- function mathroman.int2roman_test(t)
 
-- vueRomains : XIJ=12 MCXI=1111 MCDXLIV=1444 MDCLXVI=1666 MCMXCIX=1999 MMCCXXII=2222 MMMMCMXCIX=4999 ERREURS=0 erreur caractere S en 7. XIA=11 erreur caractere A en 3. XJI=12 erreur caractere J avant la fin. IXC=89 erreur caracteres croissants. VLD=445 erreur caracteres croissants. MMMMM=5000 erreur > 4999. MMMMMYJXC=5089 erreur > 4999. erreur caractere Y en 6. erreur caractere J avant la fin.
function mathroman.roman2int(rm) -- Convert a roman number to integer
-- { ["nameerrorsKey"] = "mathroman.roman2int (4)'2, ["argsmodulename"] = { "VImathroman", }, ["expectfuncname"] = {"mathroman.int2roman", 123group }= mathroman.TestsCasesGroup, }, -- example of test case
-- { ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { 1 }, ["expect"] = { "I" } },
local v = 0 -- valeur totale
local v1 = 0 -- valeur de derniere lettre
local v2 = 0 -- valeur de lettre precedente
local v3 = 0 -- valeur de lettre precedente
local x = '-' -- caractere en cours d'evaluation
local i = 1 -- numero du caractere en cours d'evaluation
local j = 0 -- numero du caractere de reference courant (debut en Lua)
local k = 0 -- numero du caractere de reference courant (fin en Lua)
local errs, errtab = "", {}
if type(rm) ~= "string" then
table.insert(errtab, tostring(events.add_err("mathroman_is_not_string_err", tostring(rm) ) ) )
return 0, errs
end
if rm == "" then
errs = errs .. events.add_err("mathroman_is_not_string_err", '""')
table.insert(errtab, tostring(events.add_err("mathroman_is_not_string_err", '""') ) )
return 0, errs
end
if type(rm) ~= "string" then rm = "-" end
local lst = '-MDCLXVIJ' -- caracteres autorises
x = string.sub(rm, i, i) or ''
while (x ~= '') do
v3 = v2
v2 = v1
v1 = 0
if ( x == 'M' ) then v1 = 1000 end
if ( x == 'D' ) then v1 = 500 end
if ( x == 'C' ) then v1 = 100 end
if ( x == 'L' ) then v1 = 50 end
if ( x == 'X' ) then v1 = 10 end
if ( x == 'V' ) then v1 = 5 end
if ( x == 'I' ) then v1 = 1 end
if ( x == 'J' ) then v1 = 1 end
if ( x == 'J' ) and ( i < string.len(rm) ) then
errs = errs .. events.add_err("mathroman_J_before_end_err") -- e4 = 'character J before the end'
table.insert(errtab, tostring(events.add_err("mathroman_J_before_end_err") ) ) -- e4 = 'character J before the end'
end
if ( v1 == 0 ) then
errs = errs .. events.add_err("mathroman_char_X_in_N_err", x, i) -- e3 = "character K in 3"
table.insert(errtab, tostring(events.add_err("mathroman_char_X_in_N_err", x, i) ) )
end
v = v + v1
if ( (v1 == 5*v2) or (v1 == 10*v2) ) then v = v - (2*v2) end -- adjust 4, 9, 40, 90 ...
j, k = string.find(lst, x)
if ( j == nil ) then j = -1 end
if ( k == nil ) then k = -1 end
if (v1 > v2) and (v2 > v3) and (v3 > 0) then
errs = errs .. events.add_err("mathroman_char_increase_err") -- e2 = ' increasing chars.'
table.insert(errtab, tostring(events.add_err("mathroman_char_increase_err") ) )
end
i = i + 1
x = string.sub(rm, i, i) or ''
end
if ( v < 1 ) then -- e0 = ' valeur nulle.'
errs = errs .. events.add_err("mathroman_null_value_err")
table.insert(errtab, tostring(events.add_err("mathroman_null_value_err") ) )
end
if ( v > 4999 ) then -- e1 = ' valeur > 4999.'
errs = errs .. events.add_err("mathroman_greater_4999_err")
table.insert(errtab, tostring(events.add_err("mathroman_greater_4999_err") ) )
end
errs = table.concat(errtab, " ; ")
return v, errs -- with or without errors
end -- v, errs = mathroman.roman2int(rm) -- Convert a roman number to integer
 
mathroman.TestsCasesGroup = { -- 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 cases
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "XXII" }, ["expect"] = { 22 }, },
}
 
mathroman.Tests_cases = { -- 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. 5 cases
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { 12, }, ["expect"] = { "XII" }, },
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "VIA", }, ["expect"] = { 6, "character AAA in 3" }, },
}
 
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
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { "19" }, ["expect"] = { "XII" } },
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { 4999 }, ["expect"] = { "MMMMCMXCIX" } },
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { 5000 }, ["expect"] = { "0", "value > 4999" } },
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { -10 }, ["expect"] = { "X", "null value" } },
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { 0 }, ["expect"] = { "0", "null value" } },
}
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
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "-X" }, ["expect"] = { 10, "mathroman_char_X_in_N_err---1-" } },
{ ["rom"] = "-X", ["expect"] = 10, ["reason"] = "Forbiden negative value" },
{ ["romerrorsKey"] = 2, ["0modulename"] = "mathroman", ["expectfuncname"] = 0"mathroman.roman2int", ["reasonargs"] = { "Converted0" }, ["expect"] = { 0, "null value" } },
{ ["romerrorsKey"] = 2, ["XIAmodulename"] = "mathroman", ["expectfuncname"] = 11"mathroman.roman2int", ["reasonargs"] = { "XIA" }, ["expect"] = { 11, "character A in 3" } },
--[
{ ["rom"] = "", ["expect"] = 0, ["reason"] = "empty value" },
{ ["romerrorsKey"] = 2, ["modulename"] = "MCXImathroman", ["expectfuncname"] = 1111"mathroman.roman2int", ["reasonargs"] = { ""normal integer}, decreasing["expect"] = { 0 } },
{ ["romerrorsKey"] = 2, ["modulename"] = "IXCMmathroman", ["expectfuncname"] = 12"mathroman.roman2int", ["reasonargs"] = { "MCXI"Forbiden 3}, increasing characters["expect"] = { 1111 } },
{ ["romerrorsKey"] = 2, ["XIJmodulename"] = "mathroman", ["expectfuncname"] = 12"mathroman.roman2int", ["reasonargs"] = { "XIJ"normal end}, in J["expect"] = { 12 } },
{ ["romerrorsKey"] = 2, ["XJImodulename"] = "mathroman", ["expectfuncname"] = 12"mathroman.roman2int", ["reasonargs"] = { "XJI"Forbiden J}, before["expect"] = { 12, end"X Y Z" } },
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "XJI" }, ["expect"] = { 12, "mathroman_char_increase_err" } },
{ ["rom"] = "VLD", ["expect"] = 445, ["reason"] = "normal integer decreasing" },
{ ["romerrorsKey"] = 2, ["modulename"] = "IXCmathroman", ["expectfuncname"] = 89"mathroman.roman2int", ["reasonargs"] = { "nullVLD" value}, ["expect"] = { 445 } },
{ ["romerrorsKey"] = 2, ["MMMMCMXCIXmodulename"] = "mathroman", ["expectfuncname"] = 4999"mathroman.roman2int", ["reasonargs"] = { "HighterIXC" limit}, of["expect"] classic= roman{ numbers"89 } },
{ ["romerrorsKey"] = 2, ["MMMMMmodulename"] = "mathroman", ["expectfuncname"] = 5000"mathroman.roman2int", ["reasonargs"] = { "SmallerMMMMCMXCIX" too}, big["expect"] classic= roman{ numbers"4999 } },
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "MMMMM" }, ["expect"] = { 5000, "mathroman_J_before_end_err-XJI" } },
{ ["rom"] = "MMMMMYJXC", ["expect"] = 5089, ["reason"] = "several errors" },
--]]
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "MMMMMYJXC" }, ["expect"] = { 5089, ";mathroman_J_before_end_err;mathroman_char_increase_err;mathroman_char_X_in_N_err-Y-6;mathroman_greater_4999_err;" } },
}
 
mathroman.testsRecursive = { -- Autotest cases to validate the mathroman library at MediaWiki level.
function mathroman.roman2int_tests(t) -- Tests of main central modules -- S170606rmn
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "XXIJ" }, ["expect"] = { 22 } },
local memo = viewers.save_configs("mathroman.roman2int_tests") -- Save global configuration before eventual changes.
-- { ["errorsKey"] = 2, ["modulename"] = "mathroman", funcname = 'recurse', group = mathroman.testsRecursive, },
local t = t or "\n* <b>mathroman.roman2int(t)</b> Test roman to integer numbers. " .. viewers.form9user("mathroman_roman2int_tests_title")
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "MCXI" }, ["expect"] = { 1111 } },
local group = {}
-- { ["errorsKey"] = 2, ["modulename"] = "mathroman", funcname = 'recurse', group = mathroman.testsRecursive, },
for i, one_test in pairs(mathroman.roman2intTests) do -- apply the tests cases
}
one_test["result"], one_test["err_int"] = mathroman.roman2int( tostring(one_test["rom"]) ) -- DEBUG : function mathroman.roman2int() can fail without blocking page.
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 integer numbers"
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.
t = t .. viewers.ta("#test_group: ", lua_table.level_count(tab_view.test_group) )
t = t .. viewers.ta("#rowGroup: ", lua_table.level_count(tab_view.rowGroup) )
viewers.restore_configs(memo, "mathroman.roman2int_tests") -- Restore global configurations after eventual changes.
return t
end -- function mathroman.roman2int_tests(t)
 
local func_example = { ["funcname"] = "mathroman.roman2int", ["args"] = { "MCXI" }, ["expect"] = { 1111 }, ["errorsKey"] = 2, }
local group_example = { ["name"] = "mathroman.roman2int.5", ["modulename"] = "mathroman", ["groupname"] = "mathroman.testsRecur", }
 
mathroman.tests_groups = { -- Autotest cases to validate the mathroman library at MediaWiki level.
-- Each test_case defines a name, a function, an input, an output.
{ ["name"] = "mathroman", ["modulename"] = "mathroman", ["funcname"] = "runGroups", ["groupname"] = "mathroman.Tests_cases", }, --
{ ["name"] = "mathroman", ["modulename"] = "mathroman", ["funcname"] = "runGroups", ["groupname"] = "mathroman.int2romanTests", }, --
{ ["name"] = "mathroman", ["modulename"] = "mathroman", ["funcname"] = "runGroups", ["groupname"] = "mathroman.roman2intTests", }, --
-- modulename = "mathroman", ["funcname"] = "runGroups", ["groupname"] = "mathroman.testsRecursive", },
}
 
-- cut_libraries
Ligne 4 431 ⟶ 4 872 :
modes.i18n = {} -- Translations for modes library
modes.i18n.br = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Noms et descriptions des arguments de configurations
[1] = "1",
Ligne 4 439 ⟶ 4 878 :
[4] = "4",
["modules_guide"] = "Argument modules_guide",
["label_descr"] = "Argument automatique de Wikidata.",
["sitelink"] = 'sitelink',
["sitelink_descr"] = "Argument automatique de Wikidata.",
-- Languages
["contentlang"] = "contentlang",
["contentlang_descr"] = "Langue du wiki.",
["pagelang"] = "pagelang",
["pagelang_descr"] = "Langue de la page.",
["userlang"] = "userlang",
["userlang_descr"] = "Language du lecteur de la page.",
--
["personlang"]QITEM = "personlang"'QITEM',
["description"]uri = "description"'uri',
["label"]itemid = "label"'itemid',
itemid_descr = "Identifiant des données de Wikidata, comme <code>Q535</code> pour Victor Hugo.",
["labelcontent"] = "labelcontent",
["labelpage"]itemid2 = "labelpage"'id',
itemid2_descr = "Autre identifiant des données de Wikidata, comme <code>Q535</code> pour Victor Hugo.",
["labeluser"] = "labeluser",
["labelbylang"]debug = "labelbylang"'debug',
category = 'Catégorie',
--
["uri"]mode = 'uri'"mode",
mode_descr = "Type d'utilisation du module ou du modèle : lire, éditer, documenter, tester.",
["QITEM"] = 'QITEM',
["itemid"]options = 'itemid'"options",
options_descr = "Options d'affichage d'un module ou d'un modèle.",
["itemid_descr"] = "Identifiant des données de Wikidata, comme <code>Q535</code> pour Victor Hugo.",
["itemid2"]c = 'id'"c",
c_descr = "Options d'affichage d'un module ou d'un modèle.",
["itemid2_descr"] = "Autre identifiant des données de Wikidata, comme <code>Q535</code> pour Victor Hugo.",
["debug"] knownversions = 'debug'"knownversions",
knownversions_descr = "Versions connues, pour les gérer.",
["category"] = 'Catégorie',
["mode"] soughtversions = "modesoughtversions",
soughtversions_descr = "Versions demandées, pour les gérer.",
["mode_descr"] = "Type d'utilisation du module ou du modèle : lire, éditer, documenter, tester.",
modes_form_ok_categ_tests = "Test de génération de catégorie OK",
["options"] = "options",
["options_descr"] = "Options d'affichage d'un module ou d'un modèle.",
["c"] = "c",
["c_descr"] = "Options d'affichage d'un module ou d'un modèle.",
["knownversions"] = "knownversions",
["knownversions_descr"] = "Versions connues, pour les gérer.",
["soughtversions"] = "soughtversions",
["soughtversions_descr"] = "Versions demandées, pour les gérer.",
["modes_form_ok_categ_tests"] = "Test de génération de catégorie OK",
-- Principaux textes, erreurs et catégories des outils
["language"] = 'langue',
-- Messages et erreurs divers
modes_used_options_list_title = "modes.used_options_list() Utilisation des options :",
Ligne 4 518 ⟶ 4 949 :
--
modes_delete_docbox_wng = "Vous devez suprimer cette documentation avant d'enregistrer.<br>Supprimez tous les modes pour revenir en mode read.",
mw_wikibase_wng modes_auto_val_warning_wng = "Vérifiez l'argument automatique.",
--
modes_assist_user_param_err = "Support aux utilisateurs pour vérifier les paramètres :",
Ligne 4 531 ⟶ 4 962 :
modes_levenshtein_similar_tests_title = "modes.levenshtein() Test des distances de <b>[https://fr.wikipedia.org/wiki/Distance_de_Levenshtein Levenshtein]</b> entre mots:",
modes_known_arguments_structure_title = "modes.known_arguments_structure() Définitions des arguments",
modes_args_unknown_report_title = "viewers.simple_list_test() Signaler les arguments inconnus",
modes_normal_box_main_text_1 = "Boîte d'information simple : titre de cette page <b>%1</b>, description : <b>%2</b>",
modes_normal_box_main_text_2 = "<br/>Il était <b>%1</b>, se nommait <b>%2</b> <b>%3</b>, il est mort en <b>%4</b>.",
Ligne 4 545 ⟶ 4 976 :
modes_recursive_normal_tests_title = "modes.recursive_normal() Test: Normalise le niveau récursif et la limite récursive",
modes_namespaces_page_list_title = "modes.namespaces_page_list() Module, namespaces, et noms de pages :",
modes_known_arguments_report_title = "modes.known_arguments_report(t) Rapport des principaux arguments connus.",
modes_known_arguments_report_headers = "clé; valeur; type; nécessaire; mot-clé; synonyme; propriété; par défaultformat; formatsource; sourcecommentaire",
modes_get_args_report_title = "modes.get_argsactivate_known_arguments() Valeurs des argument dans p.known_arguments{}.", -- fr
} -- modes.i18n.br
 
modes.i18n.de = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Namen und Beschreibungen von Konfigurationsargumenten
[1] = "1",
Ligne 4 559 ⟶ 4 988 :
[4] = "4",
["modules_guide"] = "Argument modules_guide",
["label"] = 'label',
["label_descr"] = "Wikidata automatisches Argument.",
["sitelink"] = 'sitelink',
["sitelink_descr"] = "Wikidata automatisches Argument.",
-- Sprachen
["contentlang"] = "contentlang",
["contentlang_descr"] = "Wiki-Sprache.",
["pagelang"] = "pagelang",
["pagelang_descr"] = "Sprache der Seite.",
["userlang"] = "userlang",
["uruserlang_descri"]userlang_descr = "Lesersprache der Seite.",
--
["uri"]QITEM = 'uriQITEM',
["QITEM"]uri = 'QITEMuri',
["QITEM_descr"] = "Name der Wikidata-Daten wie <code>Q535</code> für Victor Hugo.",
["itemid"] = 'itemid',
["itemid_descr"] = "Name der Wikidata-Daten wie <code>Q535</code> für Victor Hugo.",
["itemid2"] = 'itemidid',
["itemid2_descr"] = "Name der Wikidata-Daten wie <code>Q535</code> für Victor Hugo.",
["debug"] = 'debug',
["category"] = 'Kategorie',
["mode"] = "modo",
["mode_descr"] = "Art der Verwendung des Moduls oder Modells: Lesen, Bearbeiten, Dokumentieren, Testen.",
["options"] = 'opciones',
["options_descr"] = "Anzeigeoptionen für ein Modul oder ein Modell.",
["c"] = "c",
["c_descr"] = "Anzeigeoptionen für ein Modul oder ein Modell.",
["knownversions"] = "knownversions",
["knownversions_descr"] = "Bekannte Versionen, um mit ihnen umzugehen.",
["soughtversions"] = "soughtversions",
["soughtversions_descr"] = "Verlangen Sie Versionen, um mit ihnen umzugehen.",
modes_form_ok_categ_tests = "Testkategoriegenerierung OK",
--
Ligne 4 633 ⟶ 5 062 :
modes_unknown_auto_arg_err = "Interner fehler: Automatisches unbekanntes Argument: <b>%1</b> = <b>%2</b>.",
modes_delete_docbox_wng = "Sie müssen diese Dokumentation vor dem Brennen entfernen.<br>Entfernen Sie alle Modi, um in den Lesemodus zurückzukehren.",
mw_wikibase_wng modes_auto_val_warning_wng = "Überprüfen Sie die automatischen Argumente.",
--
modes_assist_user_param_err = "Benutzerunterstützung zur Überprüfung der Konfiguration:",
Ligne 4 644 ⟶ 5 073 :
modes_levenshtein_similar_tests_title= "modes.levenshtein() Beweis der Entfernungen <b>[https://es.wikipedia.org/wiki/Distancia_de_Levenshtein Levenshtein]</b> zwischen den Wörtern:",
modes_known_arguments_structure_title = "modes.known_arguments_structure() Definitionen von Argumenten",
modes_args_unknown_report_title = "viewers.simple_list_test() Melden Sie unbekannte Argumente",
modes_normal_box_main_text_1 = "Einfaches Informationsfeld: Titel der Seite: <b>%1</b>, Beschreibung: <b>%2</b>",
modes_normal_box_main_text_2 = "<br/>Er war ein <b>%1</b>, heißt <b>%2</b> <b>%3</b> war in gestorben <b>%4</b>.",
Ligne 4 658 ⟶ 5 087 :
modes_recursive_normal_tests_title = "modes.recursive_normal() Test: Normalisieren Sie die rekursive Ebene und die rekursive Grenze",
modes_namespaces_page_list_title = "modes.namespaces_page_list() Module, Namespaces und Seitennamen:",
modes_known_arguments_report_title = "modes.known_arguments_report(t) Bericht der wichtigsten bekannten Argumente.",
modes_known_arguments_report_headers = "Schlüssel; Wert; tippenArt; Sieerforderlich; einStichwort; notwendig Schlüsselwort SynonymeSynonym; Eigentum; StandardFormat; FormatQuelle; BrunnenKommentar",
modes_get_args_report_title = "modes.get_argsactivate_known_arguments() Werte der Argumente in p.known_arguments{}.", -- es
} -- modes.i18n.de
 
modes.i18n.en = { -- 182 <tab>mode_...
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- From here, TRANSLATE ONLY descriptions with a key like label_descr
-- To translate, always keep
Ligne 4 674 ⟶ 5 101 :
[4] = "4",
["modules_guide"] = "Argument modules_guide",
["label"] = 'label',
["label_descr"] = "Automatic Wikidata argument.",
["sitelink"] = 'sitelink',
["sitelink_descr"] = "Automatic Wikidata argument.",
-- Languages
["contentlang"] = "contentlang",
["contentlang_descr"] = "Language of the wiki.",
["pagelang"] = "pagelang",
["pagelang_descr"] = "Language of the page.",
["userlang"] = "userlang",
["userlang_descr"] = "Language of the page reader.",
--
["personlang"] = "personlang",
["description"] = "description",
["label"] = "label",
["labelcontent"] = "labelcontent",
["labelpage"] = "labelpage",
["labeluser"] = "labeluser",
["labelbylang"] = "labelbylang",
--
["uri"]QITEM = 'uriQITEM',
["QITEM"]uri = 'QITEMuri',
["QITEM_descr"] = "Wikidata data identifier, like <code>Q535</code> for Victor Hugo.",
["itemid"] = 'itemid',
["itemid_descr"] = "Wikidata data identifier, like <code>Q535</code> for Victor Hugo.",
["itemid2"] = 'id',
["itemid2_descr"] = "Wikidata data identifier, like <code>Q535</code> for Victor Hugo.",
["debug"] = 'debug',
["category"] = 'Category',
["mode"] = "mode",
["mode_descr"] = "Type of use of the module or template: read, edit, document, test.",
["options"] = "options",
["options_descr"] = "Display options of a module or a model.",
["c"] = "c",
["c_descr"] = "Display options of a module or a model.",
["knownversions"] = "knownversions",
["knownversions_descr"] = "Known versions, to manage them.",
["soughtversions"] = "soughtversions",
["soughtversions_descr"] = "Sought versions, to manage them.",
modes_used_options_list_title = "modes.used_options_list() Use of options:",
modes_options_uses_tests_title = "modes.options_from_mode_tests() Options uses and short test",
Ligne 4 752 ⟶ 5 171 :
--
modes_unknown_auto_arg_err = "Internal Error: Unknown automatic argument: <b>%1</b> = <b>%2</b>.",
modes_delete_docbox_wng = "You must remove this documentation before recording.<br>Remove all modes to return to read modemodes.",
-- mw_wikibase_wng modes_auto_val_warning_wng = "Verify the automatic argument: <b>%1</b> = <b>%2</b>.",
mw_wikibase_wng modes_auto_val_warning_wng = "Verify the automatic arguments.",
--
modes_assist_user_param_err = "User support for checking the settings:",
Ligne 4 767 ⟶ 5 186 :
modes_levenshtein_similar_tests_title= "modes.levenshtein() Test the distances between words <b>[https://en.wikipedia.org/wiki/Levenshtein_distance Levenshtein]</b>:",
modes_known_arguments_structure_title = "modes.known_arguments_structure() Arguments definitions",
modes_args_unknown_report_title = "viewers.simple_list_test() Report unknown arguments",
modes_normal_box_main_text_1 = "Simple infobox: page title: <b>%1</b>, description: <b>%2</b>",
modes_normal_box_main_text_2 = "<br/>He was <b>%1</b>, named <b>%2</b> <b>%3</b> was dead in <b>%4</b>.",
Ligne 4 782 ⟶ 5 201 :
modes_recursive_normal_tests_title = "modes.recursive_normal() Test: Normalize the recursive level and the recursive limit",
modes_namespaces_page_list_title = "modes.namespaces_page_list() Module, namespaces, and page names:",
modes_known_arguments_report_title = "modes.known_arguments_report(t) Report of main known args.",
modes_known_arguments_report_headers = "keywordkey; value; type; neednecessary; keyword; synsynonymous; property; by defaultformat; formatsource; sourcecomment",
modes_get_args_report_title = "modes.get_argsactivate_known_arguments() Values of the arguments in p.known_arguments{}.", -- en
} -- modes.i18n.en
 
modes.i18n.es = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Nombres y descripciones de argumentos de configuraciones
[1] = "1",
Ligne 4 796 ⟶ 5 213 :
[4] = "4",
["modules_guide"] = "Argument modules_guide",
["label"] = 'label',
["label_descr"] = "Wikidata automática argumento.",
["sitelink"] = 'sitelink',
["sitelink_descr"] = "Wikidata automática argumento.",
-- Languages
["contentlang"] = "contentlang",
["contentlang_descr"] = "Idioma del wiki.",
["pagelang"] = "pagelang",
["pagelang_descr"] = "Idioma de la página.",
["userlang"] = "userlang",
["userlang_descr"] = "Idioma del lector de la página.",
--
["personlang"] = "personlang",
["description"] = "description",
["label"] = "label",
["labelcontent"] = "labelcontent",
["labelpage"] = "labelpage",
["labeluser"] = "labeluser",
["labelbylang"] = "labelbylang",
--
["uri"]QITEM = 'uriQITEM',
["QITEM"]uri = 'QITEMuri',
["QITEM_descr"] = "Nombre de los datos Wikidata, como <code>Q535</code> para Victor Hugo.",
["itemid"] = 'itemid',
["itemid_descr"] = "Nombre de los datos Wikidata, como <code>Q535</code> para Victor Hugo.",
["itemid2"] = 'id',
["itemid2_descr"] = "Nombre de los datos Wikidata, como <code>Q535</code> para Victor Hugo.",
["debug"] = 'debug',
["category"] = 'Categoría',
["mode"] = "modo",
["mode_descr"] = "Tipo de uso del módulo o modelo: leer, editar, documentar, probar.",
["options"] = 'opciones',
["options_descr"] = "Opciones de visualización de un módulo o un modelo.",
["c"] = "c",
["c_descr"] = "Opciones de visualización de un módulo o un modelo.",
["knownversions"] = "knownversions",
["knownversions_descr"] = "Conocidas versiones, para manejarlos.",
["soughtversions"] = "soughtversions",
["soughtversions_descr"] = "Versiones demanda, para manejarlos.",
modes_form_ok_categ_tests = "Prueba generación categoría en OK",
--
Ligne 4 876 ⟶ 5 285 :
modes_unknown_auto_arg_err = "Error interno: Argumento desconocido automático: <b>%1</b> = <b>%2</b>.",
modes_delete_docbox_wng = "Debe quitar esta documentación antes de grabar.<br>Retire todos los modos para volver al modo read.",
mw_wikibase_wng modes_auto_val_warning_wng = "Verifique el argumentos automáticos.",
--
modes_assist_user_param_err = "Apoyo al usuario para comprobar la configuración:",
Ligne 4 889 ⟶ 5 298 :
modes_levenshtein_similar_tests_title= "modes.levenshtein() Prueba de las distancias <b>[https://es.wikipedia.org/wiki/Distancia_de_Levenshtein Levenshtein]</b> entre las palabras:",
modes_known_arguments_structure_title = "modes.known_arguments_structure() Definiciones de argumentos",
modes_args_unknown_report_title = "viewers.simple_list_test() Informar argumentos desconocidos",
modes_normal_box_main_text_1 = "Simple caja de información: Título de la página: <b>%1</b>, descripción: <b>%2</b>",
modes_normal_box_main_text_2 = "<br/>Él era un <b>%1</b>, es nombrado <b>%2</b> <b>%3</b> había muerto en <b>%4</b>.",
Ligne 4 903 ⟶ 5 312 :
modes_recursive_normal_tests_title = "modes.recursive_normal() Prueba: Normalizar el nivel recursivo y el límite recursiva",
modes_namespaces_page_list_title = "modes.namespaces_page_list() Módulo, namespaces, y nombres de páginas:",
modes_known_arguments_report_title = "modes.known_arguments_report(t) Informe de los principales argumentos conocidos.",
modes_known_arguments_report_headers = "clave; valor; tipo; es necesario; palabra clave; sinónimos; propiedad; por defecto; formato; fuente; comentario",
modes_get_args_report_title = "modes.get_argsactivate_known_arguments() Valores de los argumentos en p.known_arguments{}.", -- es
} -- modes.i18n.es
 
modes.i18n.fr = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Noms et descriptions des arguments de configurations
[1] = "1",
Ligne 4 917 ⟶ 5 324 :
[4] = "4",
["modules_guide"] = "Argument modules_guide",
["label"] = 'label',
["label_descr"] = "Argument automatique de Wikidata.",
["sitelink"] = 'sitelink',
["sitelink_descr"] = "Argument automatique de Wikidata.",
-- Languages
["contentlang"] = "contentlang",
["contentlang_descr"] = "Langue du wiki.",
["pagelang"] = "pagelang",
["pagelang_descr"] = "Langue de la page.",
["userlang"] = "userlang",
["userlang_descr"] = "Language du lecteur de la page.",
--
["personlang"] = "personlang",
["description"] = "description",
["label"] = "label",
["labelcontent"] = "labelcontent",
["labelpage"] = "labelpage",
["labeluser"] = "labeluser",
["labelbylang"] = "labelbylang",
--
["uri"]QITEM = 'uriQITEM',
["QITEM"]uri = 'QITEMuri',
["itemid"] = 'itemid',
["itemid_descr"] = "Identifiant des données de Wikidata, comme <code>Q535</code> pour Victor Hugo.",
["itemid2"] = 'id',
["itemid2_descr"] = "Autre identifiant des données de Wikidata, comme <code>Q535</code> pour Victor Hugo.",
["debug"] = 'debug',
["category"] = 'Catégorie',
["mode"] = "mode",
["mode_descr"] = "Type d'utilisation du module ou du modèle : lire, éditer, documenter, tester.",
["options"] = "options",
["options_descr"] = "Options d'affichage d'un module ou d'un modèle.",
["c"] = "c",
["c_descr"] = "Options d'affichage d'un module ou d'un modèle.",
["knownversions"] = "knownversions",
["knownversions_descr"] = "Versions connues, pour les gérer.",
["soughtversions"] = "soughtversions",
["soughtversions_descr"] = "Versions demandées, pour les gérer.",
modes_form_ok_categ_tests = "Test de génération de catégorie OK",
-- Principaux textes, erreurs et catégories des outils
Ligne 4 997 ⟶ 5 396 :
--
modes_delete_docbox_wng = "Vous devez suprimer cette documentation avant d'enregistrer.<br>Supprimez tous les modes pour revenir en mode read.",
mw_wikibase_wng modes_auto_val_warning_wng = "Vérifiez l'argument automatique.",
--
modes_assist_user_param_err = "Support aux utilisateurs pour vérifier les paramètres :",
Ligne 5 010 ⟶ 5 409 :
modes_levenshtein_similar_tests_title = "modes.levenshtein() Test des distances de <b>[https://fr.wikipedia.org/wiki/Distance_de_Levenshtein Levenshtein]</b> entre mots:",
modes_known_arguments_structure_title = "modes.known_arguments_structure() Définitions des arguments",
modes_args_unknown_report_title = "viewers.simple_list_test() Signaler les arguments inconnus",
modes_normal_box_main_text_1 = "Boîte d'information simple : titre de cette page <b>%1</b>, description : <b>%2</b>",
modes_normal_box_main_text_2 = "<br/>Il était <b>%1</b>, se nommait <b>%2</b> <b>%3</b>, il est mort en <b>%4</b>.",
Ligne 5 024 ⟶ 5 423 :
modes_recursive_normal_tests_title = "modes.recursive_normal() Test: Normalise le niveau récursif et la limite récursive",
modes_namespaces_page_list_title = "modes.namespaces_page_list() Module, namespaces, et noms de pages :",
modes_known_arguments_report_title = "modes.known_arguments_report(t) Rapport des principaux arguments connus.",
modes_known_arguments_report_headers = "clé; valeur; type; nécessaire; mot-clé; synonyme; propriété; par défaultformat; formatsource; sourcecommentaire",
modes_get_args_report_title = "modes.get_argsactivate_known_arguments() Valeurs des argument dans p.known_arguments{}.", -- fr
} -- modes.i18n.fr
 
modes.i18n.hu = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Nombres y descripciones de argumentos de configuraciones
[1] = "1",
Ligne 5 038 ⟶ 5 435 :
[4] = "4",
["modules_guide"] = "Argument modules_guide",
["label"] = 'label',
["label_descr"] = "Automatikus Wikidata argumentum.",
["sitelink"] = 'sitelink',
["sitelink_descr"] = "Automatikus Wikidata argumentum.",
-- Languages
["contentlang"] = "contentlang",
["contentlang_descr"] = "Wiki nyelv.",
["pagelang"] = "pagelang",
["pagelang_descr"] = "Az oldal nyelve.",
["userlang"] = "userlang",
["userlang_descr"] = "Az oldal olvasó nyelve.",
--
["personlang"] = "personlang",
["description"] = "description",
["label"] = "label",
["labelcontent"] = "labelcontent",
["labelpage"] = "labelpage",
["labeluser"] = "labeluser",
["labelbylang"] = "labelbylang",
--
["uri"]QITEM = 'uriQITEM',
["QITEM"]uri = 'QITEMuri',
["QITEM_descr"] = "Wikidata adatok neve, például Victor Hugo kódja <code>Q535</code>.",
["itemid"] = 'itemid',
["itemid_descr"] = "Wikidata adatok neve, például Victor Hugo kódja <code>Q535</code>.",
["itemid2"] = 'id',
["itemid2_descr"] = "Wikidata adatok neve, például Victor Hugo kódja <code>Q535</code>.",
["debug"] = 'debug',
["category"] = 'kategória',
["mode"] = "modo",
["mode_descr"] = "A modul vagy modell használata: olvasás, szerkesztés, dokumentum, tesztelés.",
["options"] = 'opciones',
["options_descr"] = "Egy modul vagy modell megjelenítési lehetőségei.",
["c"] = "c",
["c_descr"] = "Egy modul vagy modell megjelenítési lehetőségei.",
["knownversions"] = "knownversions",
["knownversions_descr"] = "Jól ismert verziók, kezelni őket.",
["soughtversions"] = "soughtversions",
["soughtversions_descr"] = "Kérjen változatokat, kezelni őket.",
-- Textos principales, errores y categorías de instrumentos
modes_form_ok_categ_tests = "OK kategória-generációs teszt",
Ligne 5 119 ⟶ 5 508 :
modes_unknown_auto_arg_err = "Belső hiba: Automatikus ismeretlen argumentum: <b>%1</b> = <b>%2</b>.",
modes_delete_docbox_wng = "Törölje a dokumentációt az égetés előtt.<br> Távolítsa el az összes módot, hogy visszatérjen az olvasási üzemmódba.",
mw_wikibase_wng modes_auto_val_warning_wng = "Ellenőrizze az automatikus érveket.",
--
modes_assist_user_param_err = "Felhasználói támogatás a konfiguráció ellenőrzéséhez:",
Ligne 5 132 ⟶ 5 521 :
modes_levenshtein_similar_tests_title= "modes.levenshtein() A távolságok igazolása <b>[https://es.wikipedia.org/wiki/Distancia_de_Levenshtein Levenshtein]</b> entre las palabras:",
modes_known_arguments_structure_title = "modes.known_arguments_structure() Az érvek fogalommeghatározása",
modes_args_unknown_report_title = "viewers.simple_list_test() Ismeretlen érvek jelentése",
modes_normal_box_main_text_1 = "Egyszerű információs mező: Az oldal címe: <b>%1</b>, leírás: <b>%2</b>",
modes_normal_box_main_text_2 = "<br/><b>%1</b> névvel <b>%2</b> <b>%3</b> meghalt <b>%4</b>.",
Ligne 5 146 ⟶ 5 535 :
modes_recursive_normal_tests_title = "modes.recursive_normal() Teszt: Normalizálja a rekurzív szintet és a rekurzív határt",
modes_namespaces_page_list_title = "modes.namespaces_page_list() Modul, névterek és oldalnevek:",
modes_known_arguments_report_title = "modes.known_arguments_report(t) A legfontosabb ismert érvekről szóló jelentés.",
modes_known_arguments_report_headers = "kulcsszókulcs; érték; típusfajtája; szükségszükséges; kulcsszó; szinszinonimája; ingatlantulajdon; alapértelmezés szerintformátumban; formátumforrás; forrásmegjegyzés",
modes_get_args_report_title = "modes.get_argsactivate_known_arguments() Az érvek értékei p.known_arguments{}.", -- es
} -- modes.i18n.hu
 
modes.i18n.vi = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Noms et descriptions des arguments de configurations
[1] = "1",
Ligne 5 160 ⟶ 5 547 :
[4] = "4",
["modules_guide"] = "Argument modules_guide",
["label"] = 'label',
["label_descr"] = "Đối số tự động để Wikidata.",
["sitelink"] = 'sitelink',
["sitelink_descr"] = "Đối số tự động để Wikidata.",
-- Languages
["contentlang"] = "contentlang",
["contentlang_descr"] = "Ngôn ngữ wiki.",
["pagelang"] = "pagelang",
["pagelang_descr"] = "Ngôn ngữ trang.",
["userlang"] = "userlang",
["userlang_descr"] = "Ngôn ngữ để người đọc trang.",
--
["personlang"]QITEM = "personlang"'QITEM',
["description"]uri = "description"'uri',
["label"]itemid = "label"'itemid',
itemid_descr = "Định danh dữ liệu Wikidata, chẳng hạn như <code>Q535</code> để Victor Hugo.",
["labelcontent"] = "labelcontent",
["labelpage"]itemid2 = "labelpage"'id',
itemid2_descr = "Số nhận dạng khác để dữ liệu Wikidata, chẳng hạn như <code>Q535</code> để Victor Hugo.",
["labeluser"] = "labeluser",
["labelbylang"]debug = "labelbylang"'gỡ lỗi',
category = 'Loại',
--
["uri"]mode = 'uri'"mode",
mode_descr = "Loại sử dụng mô-đun hoặc mô hình: đọc, chỉnh sửa, tài liệu, kiểm tra.",
["QITEM"] = 'QITEM',
options = "options",
["QITEM_descr"] = "Định danh dữ liệu Wikidata, chẳng hạn như <code>Q535</code> để Victor Hugo.",
options_descr = "Hiển thị tùy chọn mô-đun hoặc mô hình.",
["itemid"] = 'itemid',
c = "c",
["itemid_descr"] = "Định danh dữ liệu Wikidata, chẳng hạn như <code>Q535</code> để Victor Hugo.",
c_descr = "Hiển thị tùy chọn mô-đun hoặc mô hình.",
["itemid2"] = 'id',
knownversions = "knownversions",
["itemid2_descr"] = "Số nhận dạng khác để dữ liệu Wikidata, chẳng hạn như <code>Q535</code> để Victor Hugo.",
knownversions_descr = "Các phiên bản đã biết, để quản lý chúng.",
["debug"] = 'gỡ lỗi',
["category"]soughtversions = 'Loại'"soughtversions",
soughtversions_descr = "Các phiên bản được yêu cầu, để quản lý chúng.",
["mode"] = "mode",
["mode_descr"] = "Loại sử dụng mô-đun hoặc mô hình: đọc, chỉnh sửa, tài liệu, kiểm tra.",
["options"] = "options",
["options_descr"] = "Hiển thị tùy chọn mô-đun hoặc mô hình.",
["c"] = "c",
["c_descr"] = "Hiển thị tùy chọn mô-đun hoặc mô hình.",
["knownversions"] = "knownversions",
["knownversions_descr"] = "Các phiên bản đã biết, để quản lý chúng.",
["soughtversions"] = "soughtversions",
["soughtversions_descr"] = "Các phiên bản được yêu cầu, để quản lý chúng.",
-- Principaux textes, erreurs et catégories des outils
["language"] = 'langue',
-- Messages et erreurs divers
modes_used_options_list_title = "modes.used_options_list() Sử dụng các tùy chọn:",
Ligne 5 240 ⟶ 5 618 :
--
modes_delete_docbox_wng = "Bạn phải xóa tài liệu này trước khi lưu.<br> Xóa tất cả các chế độ để trở về chế độ đọc.",
mw_wikibase_wng modes_auto_val_warning_wng = "Kiểm tra đối số tự động.",
--
modes_assist_user_param_err = "Hỗ trợ người dùng để kiểm tra cài đặt:",
Ligne 5 253 ⟶ 5 631 :
modes_levenshtein_similar_tests_title = "modes.levenshtein() Kiểm tra khoảng cách <b>[https://fr.wikipedia.org/wiki/Distance_de_Levenshtein Levenshtein]</b> entre mots:",
modes_known_arguments_structure_title = "modes.known_arguments_structure() Định nghĩa đối số",
modes_args_unknown_report_title = "viewers.simple_list_test() Báo cáo đối số không xác định",
modes_normal_box_main_text_1 = "Hộp thông tin đơn giản: tiêu đề để trang này <b>%1</b>, mô tả: <b>%2</b>",
modes_normal_box_main_text_2 = "<br/>Anh ta <b>%1</b>, tên anh ta <b>%2</b> <b>%3</b>, anh ta đã chết <b>%4</b>.",
Ligne 5 267 ⟶ 5 645 :
modes_recursive_normal_tests_title = "modes.recursive_normal() Kiểm tra: Bình thường hóa mức đệ quy và giới hạn đệ quy",
modes_namespaces_page_list_title = "modes.namespaces_page_list() Mô-đun, namespaces, và tên trang:",
modes_known_arguments_report_headers modes_known_arguments_report_title = "modestừ khóa; giá trị; kiểu; nhu cầu; từ khóa; đồng bộ; bất động sản; theo mặc định; định dạng; nguồnmodes.known_arguments_report(t) Báo cáo để các đối số được biết đến chính.",
modes_known_arguments_report_headers= "chính; giá trị; loại; cần thiết; từ khóa; đồng nghĩa; bất động sản; định dạng; nguồn; chú thích",
modes_known_arguments_report_title = "Báo cáo Từ dữ liệu ngay mw.wikibase",
modes_get_args_report_title = "modes.get_argsactivate_known_arguments() Giá trị để các đối số trong p.known_arguments{}.",
} -- modes.i18n.vi
 
Ligne 5 276 ⟶ 5 654 :
-- - - - ------------------ - - - - ---------------------------------
 
modes.options_for_modes = { -- default options_for_modes FAMLTVQDR
["docfunc"] read = "docfunc box1 ",
edit = " box1 docdef docline docsrc docdata catview docview : ",
["dockey"] = "dockey",
["read"]doc = " box1nobox1 noerr nocatview ",
["edit"]tests = " box1 docdef docline docsrc docdata catview docview : tests ",
["doc"] = " nobox1 noerr nocatview ",
["tests"] = " box1 docdef docline docsrc docdata catview docview : tests ",
-- List of parameters for module documentation
-- "docview" or ":" add the documentation panel
Ligne 5 299 ⟶ 5 675 :
-- Manage Library:modes options. Administrar opciones. Gérer les options.
modes.template_options = "" -- Normal options from the template, like {{Bananas|options=docmax docdef}}.
modes.mode_options = "" -- Internal options from the modemodes.
modes.available_options = "" -- table to collect all available options, at any time.
modes.used_options = {} -- table to collect really or tested options then list them at end of tests.
 
mathroman.known_arguments = { -- Table of the definitions of all known arguments at module level.
-- Arguments in order without names, with their keyword for use as other arguments.
-- Special arguments to modify the fonctions and outputs of this module.
mode = {typ = "config", need = 0, keyword = "mode"},
c = {typ = "config", need = 0, keyword = "c"},
options = {typ = "config", need = 0, keyword = "options"},
-- The userlang argument permits at an administrator in his own langage (errors, warnings, catégories, tests) to help a wiki in any language.
contentlang = {typ = "config", need = 1, keyword = "contentlang"},
pagelang = {typ = "config", need = 2, keyword = "pagelang"},
userlang = {typ = "config", need = 0, keyword = "userlang"},
birthyear = {typ = "dat", need = 0, keyword = "birthyear", prop = "P569", format = "year"},
}
 
function modes.bind_known_arguments_props(known_arguments, args_new) -- Bind known args and their properties for central libraries. Later for modules.
Ligne 5 318 ⟶ 5 707 :
 
function modes.known_arguments_one_lib(known_arguments, args_new) -- Bind known args and their properties for central libraries. Later for modules.
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- modes.known_arguments = { -- p.known_arguments - = { -- }
if (type(known_arguments) ~= "table") then return {} end
local known_arguments_props = {}
Ligne 5 333 ⟶ 5 722 :
local memo = viewers.save_configs("modes.bind_known_arguments_one_lib_report") -- Save global configuration before eventual changes.
local t = t or "\n* mathroman.known_arguments_one_lib(t) Report the binding of one library known args."
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- modes.known_arguments = { -- p.known_arguments - = { -- }
local known_arguments_props = modes.known_arguments_one_lib(modes.known_arguments, mathroman.known_arguments)
t = t .. "\n* " .. viewers.ta("#known_arguments_props", lua_table.level_count(known_arguments_props) )
Ligne 5 339 ⟶ 5 728 :
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = known_arguments,
rowGroup = {},
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 346 ⟶ 5 736 :
headers = "modes_bind_known_arguments_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 366 ⟶ 5 754 :
local memo = viewers.save_configs("modes.known_arguments_report") -- Save global configuration before eventual changes.
local t = t or "\n* <b>modes.known_arguments_report(t)</b> Report of main known args."
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- modes.known_arguments = { -- p.known_arguments - = { -- }
local args_group = {} -- modes.known_arguments = { -- p.known_arguments - = { -- }
for key, tab in pairs(known_arguments) do -- import and mix known args and properties
table.insert( args_group, tab )
Ligne 5 376 ⟶ 5 764 :
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = args_group, -- tab_view.test_group or
rowGroup = {},
title_memo = "modes.known_arguments_report(t) Report of main known args. **",
title_memo = "modes_known_arguments_report_title", -- "modes.known_arguments_report(t) Rapport des principaux arguments connus.",
headers = "modes_known_arguments_report_headers", -- headers = "key; valvalue; type; neednecessary; keyword; synsynonymous; propproperty; format; source; comment",
form_one_case = function(case) -- Convert a case from test_group to rowGroup. tab_view.form_one_case or
return { (case.keyword), (case.val or "-"), case.typ, case.need, case.keyword, case.syn, case.prop, case.format, case.src, case.comment or "c", }
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 573 ⟶ 5 960 :
local t = t or "\n* <b>known_arguments_structure :</b> " -- modes_list_all_args_main_title
local tt
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments - = { }
if type(known_arguments) == "table" then
for key, elem in pairs(known_arguments) do
tt = viewers.tam("typ", elem.typ) .. viewers.tam("keyword", elem.keyword) .. viewers.tam("syn", elem.syn)
tt = tt .. viewers.tam("need", elem.need) .. viewers.tam("prop", elem.prop) .. viewers.tam("prop_default", elem.prop_default) .. viewers.tam("format", elem.format)
tt = string.sub(tt, 3, -1)
t = t .. '\n: ' .. tostring(key) .. ' = { ' .. tt .. ' } '
Ligne 5 640 ⟶ 6 027 :
end -- function modes.levenshtein(word1, word2)
 
function modes.levenshtein_similar_tests(t) -- Tests of modes.words_to_diffmaxi_limitsimilar_args_diffmaxi(10, t .. "diffmaxi = ")
local memo = viewers.save_configs("modes.levenshtein_similar_tests") -- Save global configuration before eventual changes.
local t = t or ("\n* " .. viewers.form9user("modes_max_nearest_argument_msg") ) -- "A longer name argument accepts more letter errors."
t = t .. "\n* " .. "AFormula formulato computescompute the near words limit: diffmaxiFormule =de math.floor(calcul 0.30de *limite lengthdes +mots 0.82proches ): "
local diffmaxi, errors, key, argsyn, arglingual, txt = 0, ""
t = t .. "\n* List of diffmaxi = formula( <b>length</b> )lengths : "
local diffmaxi
for i = 0, 20 do -- Formula diffmaxi = modes.diffmaxi_for_diff(diff_size)
for i = 1, 10 do
diffmaxi = modes.diffmaxi_for_diff(i)
diffmaxi, tt = modes.similar_args_diffmaxi( string.sub("azertyuiopqsdfghjklm", 1, i), "azertyuiopqsdfghjklm") -- Format a string from the formula
modes.length_from_i[i] = diffmaxi
t = t .. viewers.ta(tostring(i), diffmaxi)
end
local diffmaxi, tt = modes.similar_args_diffmaxi(10, t .. "diffmaxi = ")
t = t .. "\n* An error appears when the word exceeds the limit of close words: "
-- local diffmaxi, tt = modes.words_to_diffmaxi_limit(10, t .. "diffmaxi = ")
local group_test = { -- events.test_group
{ try = "nom", correct = "nom", },
Ligne 5 675 ⟶ 6 063 :
test_group = group_test,
title_memo = "modes.recursive_normal() Test: Normalize the recursive level and the recursive limit",
headers = "try; correcttry_length; Levenshtein distancecorrect; diffmaxicorrect_length; error", -- Test Normalize recursiveLevel and recursive_limit
headers_class = "wikitable alternative center sortable",
modes_nearest_argument_err = "Error: Do you need the known argument <b>%1</b> ?",
Ligne 5 682 ⟶ 6 070 :
case.try_length = string.len(case.try)
case.correct_length = string.len(case.correct)
case.diffmaxi, case.diff_size = modes.words_to_diffmaxi_limitsimilar_args_diffmaxi( string.len(case.try,) case.correct) -- Format a string from the formula
case.diff = modes.similar_args_diffmaxi(case.correct)
if case.diff_size > case.diffmaxi then case.error = viewers.usual_color(case.try, "error") end
return {if case.try,diff > case.correct,diffmaxi then case.diff_size,errors = viewers.usual_color(case.diffmaxicorrect, case."error") }end
return { case.try, case.try_length, case.correct, case.correct_length, case.errors }
end,
rowGroup = {},
Ligne 5 701 ⟶ 6 090 :
modes.constants.near_word_search_diff_coef = 0.30 -- Access to change these constants from anywhere.
modes.constants.near_word_search_diff_const = 0.82
 
function modes.diffmaxi_for_diff(diff_size) -- Formula diffmaxi = modes.diffmaxi_for_diff(diff_size)
local coef = modes.constants.near_word_search_diff_coef or 0.30
local constant = modes.constants.near_word_search_diff_const or 0.82
local length = diff_size
local diffmaxi = math.floor( coef * length + constant )
return diffmaxi
end
 
-- Maximum number of different letters between 2 argument names
Ligne 5 714 ⟶ 6 095 :
-- Nombre maximum de lettres différentes entre deux noms d'arguments
modes.length_from_i = {} -- Format a string from the formula
-- function modes.levenshteinsimilar_args_diffmaxi(word1word, word2t) -- ComputeFormat thea Levenshteinstring distancefrom betweenthe 2 ASCII words.formula
local coef = modes.constants.near_word_search_diff_coef or 0.30
function modes.words_to_diffmaxi_limit(word1, word2) -- Reports the diffmaxi and the limit
local constant = modes.constants.near_word_search_diff_const or 0.82
local word1 = tostring(word1)
local word2word = tostring(word2word)
local length = string.len(word)
local diff_size = modes.levenshtein(word1, word2) -- Compute the Levenshtein distance between 2 ASCII words.
local diffmaxi = modesmath.diffmaxi_for_difffloor(diff_size coef * length + constant )
if type(t) == "string" then t = t .. tostring(coef) .. " * length + " .. tostring(constant) else t = "" end
-- local length = string.len(word1)
return diffmaxi, t
-- local limit = math.floor( coef * length + constant )
end -- local diffmaxi, t = function modes.similar_args_diffmaxi(word, t) -- Format a string from the formula
if type(word1) == "string" then word1 = word1 .. tostring(coef) .. " * length + " .. tostring(constant) else word1 = "" end
return diffmaxi, diff_size
end -- local diffmaxi, diff_size = function modes.words_to_diffmaxi_limit(word1, word2) -- Reports the diffmaxi and the limit
 
-- For an unknown argument, seeks the name of the closest among the known arguments translated
Ligne 5 749 ⟶ 6 128 :
local argvalue = argvalue or known_arguments[argname]
local arg_values, key_values, keyword, keyval, argval, rank
local argmtone_arg = known_arguments[argname]
if argmtone_arg then
arg_values = langs.content_translations[argmtone_arg.arg_values] or "" -- example "no;nada;cn;50;us;70;mpf" in local language
key_values = argmtone_arg.key_values or "" -- example "no;none;cn;50;us;70;mpf" in referal english
end
if type(arg_values) == "string" and type(key_values) == "string" then
local arg_tab = mw.text.split(arg_values, ';') -- table of argmtone_arg
local key_tab = mw.text.split(key_values, ';') -- table of key
-- Default values
Ligne 5 762 ⟶ 6 141 :
keyval = nil -- key value
argval = nil
if argmtone_arg and arg_values and argvalue then
for i, key in ipairs(arg_tab) do
if key == argvalue then -- Search argvalue in arg_tab
Ligne 5 768 ⟶ 6 147 :
keyval = key_tab[i] -- Return correponding keyval in key_tab
argval = argvalue
keyword = argmtone_arg.keyword
end
end
Ligne 5 859 ⟶ 6 238 :
local memo = viewers.save_configs("modes.multiple_selection_tests") -- Save global configuration before eventual changes.
local t = (t or "") .. "\n* <b>multiple_selection</b> options: " .. viewers.ta("=", "equal only") .. viewers.ta("t", "not trim before and after") .. viewers.ta("U", "not lowercase and uppercase")
--[[
local function multiple_selection_test1(t, opt, selector, to_select)
local selected_txt, selected_tab, txt = modes.multiple_selection(opt, selector, to_select)
local t = t .. viewers.table_row() .. viewers.table_dat(opt) .. viewers.table_dat(selector) .. viewers.table_dat(to_select) .. viewers.table_dat( txt .. viewers.ta("selected_txt", selected_txt) )
return t, opt, selector, to_select -- , selected_txt, selected_tab
end
--]]
local opt = "; "
t = t .. "\n: selector = <b>nobel,+1,président,3,député,prix</b> signifie : sélectionner le premier, puis 1 de plus parmi les suivants, puis 3 en tout au maximum."
Ligne 5 900 ⟶ 6 286 :
 
function modes.verify_args_tables(_known, _source)
-- initialize all the values to "" in argmtone_arg table
-- if type(_known) ~= "table" then _known = modes.known_arguments end
-- if type(_source) ~= "table" then _source = modes.args_source end
Ligne 5 915 ⟶ 6 301 :
return
end -- function modes.verify_args_tables(_known, _source)
 
function modes.get_args(known_arguments) -- Update argmt.val and argmt.src in p.known_arguments -{}
local m, val = modes, nil
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments - = {...}
local prop, props = datas.get_item(known_arguments, QITEM) -- Get datas from mw.wikibase for the page.
local arguments_known = mw.clone(known_arguments)
local counts = { ["template"] = 0, ["import"] = 0, ["source"] = 0, ["datas"] = 0, ["final"] = 0, ["known"] = 0, }
local arguments = {}
local tt = ""
for key, argmt in pairs(arguments_known) do -- For all known parameters
if type(argmt) == "table" then
-- * These origins of arguments are in the increasig priority: <code>known</code>, <code>import</code>, <code>datas</code>, <code>template</code>, <code>interact_final</code>.
if argmt.keyword then
argmt.val = argmt.default ; argmt.src = "known" ;
counts.known = counts.known+1 ; tt = tt .. viewers.ta(argmt.src, counts.known)
end
if known_arguments[argmt.keyword] then
argmt.val = known_arguments[argmt.keyword] ; argmt.src = "import" ;
counts[argmt.src] = counts[argmt.src]+1 ; tt = tt .. viewers.ta(argmt.src, counts[argmt.src])
end
if prop[argmt.keyword] then
argmt.val = prop[argmt.keyword] ; argmt.src = "datas" ;
counts[argmt.src] = counts[argmt.src]+1 ; tt = tt .. viewers.ta(argmt.src, counts[argmt.src])
end
if known_arguments[argmt.keyword] then
argmt.val = known_arguments[argmt.keyword] ; argmt.src = "final" ;
counts[argmt.src] = counts[argmt.src]+1 ; tt = tt .. viewers.ta(argmt.src, counts[argmt.src])
end
table.insert(arguments, argmt) -- insert in the arguments their own key
end
end
local labelcontent_memo, label_to_change, has_label = {}, {}, {}
for i, onearg in pairs(arguments) do -- To search the label and labelcontent arguments
if onearg.keyword == "labelcontent" then labelcontent_memo = onearg end
if onearg.keyword == "label" then label_to_change = onearg end
end
if label_to_change and labelcontent_memo then -- To search and change the label argument
label_to_change.val = labelcontent_memo.val
label_to_change.keyword = "label"
label_to_change.prop = "label"
label_to_change.src = "datas"
label_to_change.need = labelcontent_memo.need
end
arguments.label = arguments.label or arguments.labeluser or arguments.labelpage or arguments.labelcontent or arguments.labelbylang -- insure label.val
table.sort(arguments, function (a, b) return ( tostring(a.keyword) < tostring(b.keyword) ) end ) -- alphabetic sort of translated arguments
modes.arguments = arguments
return arguments, counts, tt -- With argmt.val and argmt.src
end -- local arguments = modes.get_args(known_arguments) -- Update argmt.val and argmt.src in p.known_arguments -{}
 
function modes.get_default_args(known_arguments) -- Gets default arguments values
-- List of twice-view cases : in CentralManual modes.get_args_report ; not in ModuleCentral test mode ; yes in ModuleCentral "Doc with function from string". Search ▼
local memo = viewers.save_configs("modes.get_default_args") -- Save global configuration before eventual changes.
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments - = { }
-- ["QITEM"] = { ["typ"] = "dat", ["need"] = "noevent"0, ["keyword"] = "QITEM", ["prop"] = "QITEM", ["prop_default"] = "Q307", },
-- keep Galilée (Q307), avoid Victor Hugo (Q535), Rudyard Kipling (Q34743),
-- 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)
-- ["QITEM"] = { ["typ"] = "dat", ["need"] = "noevent"0, ["keyword"] = "QITEM", ["prop"] = "QITEM", prop_default = "Q34743", },
for key, one_arg in pairs(known_arguments) do
if type(one_arg) == "table" then
Ligne 5 981 ⟶ 6 318 :
modes.arguments = arguments
viewers.restore_configs(memo, "modes.get_default_args") -- Restore global configurations after eventual changes.
return arguments, counts, tt -- With argmtone_arg.val and argmtone_arg.src
end -- local arguments = modes.get_default_args(known_arguments) -- Gets default arguments values
 
modes.options_for_modes = { -- default options_for_modes
function modes.get_args_report(t) -- Update modes.get_args()=known_arguments
read = " box1 ",
-- List of twice-view cases : in CentralManual modes.get_args_report ; not in ModuleCentral test mode ; yes in ModuleCentral "Doc with function from string". Search ▼
edit = " box1 docdef docline docsrc docdata catview docview : ",
local memo = viewers.save_configs("modes.get_args_report") -- Save global configuration before eventual changes.
doc = " nobox1 noerr nocatview ",
local t = t or "\n* <b>modes.get_args(known_arguments)</b>: Update argmt.val and argmt.src in p.known_arguments -{}."
tests = " box1 docdef docline docsrc docdata catview docview : tests ",
t = t .. '\n* List of twice-view cases : in CentralManual modes.get_args_report ; not in ModuleCentral test mode ; yes in ModuleCentral "Doc with function from string". Search ▼'
}
local arguments, counts, tt = modes.get_args(p.known_arguments) -- Update argmt.val and argmt.src in p.known_arguments -{}
 
function modes.activate_known_arguments(known_arguments, phase) -- Activates known_arguments for phase = mode or argument or QITEM or property DODO
-- if type(one_arg["keyword"]) == "number" then one_arg["keyword"] = one_arg["syn"] end -- to move in the rigth place DODO
local m, val = modes, nil
local phase = phase or "none" -- Tactic: phase can be "mode", "argument", "QITEM", "property", "...". Any other value desactivates it, "none" is explicit. MUMU
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments = {...}
modes.actual_arguments = modes.actual_arguments or {} -- Groups activated arguments MUMU
local t = "\n* <b>function modes.activate_known_arguments(known_arguments, phase)</b> -- Activates known_arguments"
t = t .. "\n* in <b> function modes.activate_known_arguments(known_arguments, phase)</b> Counts initial modes.actual_arguments : " .. lua_table.level_count(modes.actual_arguments) .. "\n*"
if modes.actual_arguments == {} then modes.actual_arguments = mw.clone(known_arguments) end
local prop, props = datas.get_item(known_arguments, QITEM) -- Get datas from mw.wikibase for the page.
local arguments_known = mw.clone(known_arguments)
local counts = { ["template"] = 0, ["import"] = 0, ["source"] = 0, ["datas"] = 0, ["final"] = 0, ["known"] = 0, }
for key, one_arg in pairs(known_arguments) do -- For all known parameters
if type(one_arg) == "table" then -- avoid abnormal structure of known_arguments
-- * These origins of arguments are in the increasig priority: <code>known</code>, <code>import</code>, <code>datas</code>, <code>template</code>, <code>interact_final</code>.
if phase == "mode" then -- Tactic: this phase selects and activate the mode between "read", "edit", or "tests".
if one_arg["keyword"] and ( type(one_arg["keyword"] == "string") ) then -- If the argument need a Tactic
local mode = one_arg["prop_default"] -- Default is read mode
-- ["mode"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "mode", ["prop_default"] = "read"},
for i in pairs(modes.options_for_modes) do
if modes.options_for_modes[ mode ] then one_arg["mode"] = mode end
end
one_arg.val = mode -- mode = activate_known_arguments(known_arguments, "mode") done at 20181230 1755
counts = counts + 1
table.insert(modes.actual_arguments, mw.clone(one_arg) ) -- Inserts one_arg in the arguments already actualized.
end
end
--
if phase == "argument" then -- Tactic: this phase selects and activate the mode between mode or argument or QITEM or property".
if one_arg["keyword"] and ( type(one_arg["keyword"] == "string") ) then -- If the argument need a Tactic
-- ["mode"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "mode", ["prop_default"] = "read"},
-- ["modules_guide"] = { ["typ"] = "ctr", ["need"] = 0, ["keyword"] = "modules_guide", ["prop_default"] = "Centralizer", },
one_arg.val = one_arg["prop_default"] ; one_arg.src = "known" ;
counts = counts + 1
table.insert(modes.actual_arguments, mw.clone(one_arg) ) -- Inserts one_arg in the arguments already actualized.
end
end
--
if phase == "QITEM" then -- Tactic: this phase gets the sought QITEM or a default one's.
if one_arg["keyword"] and ( type(one_arg["keyword"] == "string") ) then -- If the argument need a Tactic
-- ["QITEM"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "QITEM", ["prop"] = "QITEM", ["prop_default"] = "Q307", }, -- ["prop"] = "QITEM" for:
-- datas.prop, datas.props = function datas.get_item(modes.args_unknown, QITEM) -- Get datas from mw.wikibase for the page.
 
one_arg.val = one_arg.default ; one_arg.src = "known" ;
table.insert(modes.actual_arguments, mw.clone(one_arg) ) -- Inserts one_arg in the arguments already actualized.
-- elseif one_arg.prop == "description" then val = mw.wikibase.description(QITEM) -- use props.description -- ric : Description of the QITEM page
counts = counts + 1
end
end
--
if phase == "property" then -- Tactic: this phase gets a sought property or a default one's.
if one_arg["keyword"] and ( type(one_arg["keyword"] == "string") ) then -- If the argument need a Tactic
one_arg.val = one_arg.default ; one_arg.src = "known" ;
counts = counts + 1
local datas_prop = datas.property(one_arg) -- Get datas from mwwikibase for one property of the page.
table.insert(modes.actual_arguments, mw.clone(datas_prop) ) -- Inserts one_arg in the arguments already actualized. function p.Init_central_module() group only
end
end
end
end
t = t .. "\n* in <b>function modes.activate_known_arguments(known_arguments, phase)</b> Counts final modes.actual_arguments : " .. lua_table.level_count(modes.actual_arguments) .. "\n*"
-- arguments.label = arguments.label or arguments.labeluser or arguments.labelpage or arguments.labelcontent or arguments.labelbylang -- insure label.val
table.sort(modes.actual_arguments, function (a, b) return ( tostring(a.keyword) < tostring(b.keyword) ) end ) -- alphabetic sort of translated arguments
return modes.actual_arguments, counts, tt -- With one_arg.val and one_arg.src
end -- modes.actual_arguments = function modes.activate_known_arguments(known_arguments, phase) -- Activates known_arguments for phase = mode or argument or QITEM or property
 
function modes.activate_known_arguments_report(t) -- Reports known_arguments after function ;modes.activate_known_arguments(known_arguments, phase) in functions_to_doc
local memo = viewers.save_configs("modes.activate_known_arguments_report") -- Save global configuration before eventual changes.
local t = t or "\n* <b>modes.activate_known_arguments(known_arguments)</b>: Update one_arg.val and one_arg.src in p.known_arguments."
t = t .. '\n* List of twice-view cases : in CentralManual modes.activate_known_arguments_report ; not in ModuleCentral test mode'
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments = { }
local arguments, counts, tt = modes.activate_known_arguments(known_arguments, phase) -- Activates known_arguments for phases = mode or argument or QITEM or property
-- function modes.activate_known_arguments(known_arguments, phase) -- Activates known_arguments for phase ...
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = arguments, -- Use default cases.
title_memo = "modes_known_arguments_report_title", -- "modes.known_arguments_report(t) Report of main known args.", -- en
rowGroup = {},
headers = "modes_known_arguments_report_headers", -- "key; val; type; need; keyword; syn; prop; format; source"
headers_class = "wikitable alternative center sortable",
form_one_case = function(case) -- Convert a case from test_group to rowGroup.
return { case.key, case.val or "-", case.typ, case.need, case.keyword, case.syn, case.prop, case.prop_defaultformat, case.formatsrc or "-", case.srccomment or "-c", }
end,
rowGroup = {},
title_memo = "modes_get_args_report_title", -- "modes.get_args() Values of the arguments in p.known_arguments -{}.", -- en
-- track_on == "details",
headers = "modes_known_arguments_report_headers", -- "key; val; type; need; keyword; syn; prop; format; source"
} -- drop_box.new()
t = t .. "<br/>" .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
t = t .. viewers.ta("known_arguments", lua_table.level_count(p.known_arguments) ) .. viewers.ta("arguments", lua_table.level_count(arguments) )
Ligne 6 005 ⟶ 6 418 :
t = t .. viewers.ta(tostring(count), n)
end
t = t .. "\n* Track argmt.keyword = n : " .. tt
t = t .. "\n* Final content of arguments{}."
for key, argmtone_arg in pairs(arguments) do -- For all known parameters
t = t .. viewers.ta(tostring(key), argmtone_arg.kw)
end
viewers.restore_configs(memo, "modes.get_args_reportactivate_known_arguments_report") -- Restore global configurations after eventual changes.
return t
end -- t = t .. modes.get_args_reportactivate_known_arguments_report(t) -- Update modes.get_argsactivate_known_arguments()=known_arguments
-- res = res .. drop_box.new(selector, "modes_known_arguments_report_title", modes.known_arguments_report)
 
function modes.mix_args(mix, mode_name, args_template) -- Mix arguments from options_for_modes, args_template S170710mix
local mix = mix or {}
modes.mix = mix
Ligne 6 046 ⟶ 6 459 :
end -- local mix = modes.mix_modes(mix, mode_name, args_template)
 
function modes.mix_options(mix, old_group, new_group) -- Mix 2 groups of options from diverse origins S170710mix
mix = mix or {}
if (type(old_group) ~= "string") then old_group = "" end
Ligne 6 072 ⟶ 6 485 :
mix.no_options = table.concat(no_options_tab, " ")
return mix
end -- active_options = modes.mix_options(old_group, new_group) -- S170710mix
 
function modes.init_args_mode_options(mix, mode_name, args_template) -- Imports and mixes args mode and options from template and invoke
-- TacticGuideline: Any combination of options can define a mixture of options to modify options.
-- This function allows any module to modify this process.
-- The default process gives the priority to options from arguments.
Ligne 6 085 ⟶ 6 498 :
-- Steps to mix modes values
--
-- Once run mix_args and mix_modes, in case a mode option would change the modemodes.
mix = modes.mix_args(mix, mode_name, args_template) -- Mix arguments from options_for_modes, args_template
mix = modes.mix_modes(mix, mode_name, args_template) -- Mix some modes from several origins S170710mix
modes.options = modes.options_for_modes[modes.mode_name] -- options from mode
--
-- Once repeat mix_args and mix_modes, in case the mode changes through them.
mix = modes.mix_args(mix, mode_name, args_template) -- Mix arguments from options_for_modes, args_template
mix = modes.mix_modes(mix, mode_name, args_template) -- Mix some modes from several origins S170710mix
modes.options = modes.options_for_modes[modes.mode_name] -- options from mode
mix = modes.mix_options(mix, modes.options, modes.args_template.options ) -- Mix options from template
Ligne 6 112 ⟶ 6 525 :
 
function modes.args_mixer(args_template) -- S170703amo
-- TacticGuideline: Any combination of templates can define a mixture of arguments to modify arguments.
-- This function allows any module to modify this process.
-- The default process gives the priority to templates arguments.
Ligne 6 147 ⟶ 6 560 :
 
function modes.options_mixer(args_template) -- S170703amo
-- TacticGuideline: Any combination of options can define a mixture of options to modify options.
-- This function allows any module to modify this process.
-- The default process gives the priority to options from arguments.
Ligne 6 188 ⟶ 6 601 :
 
function modes.import_args_mode_options(args_template) -- Import and mix args mode and options from template and invoke -- S170703amo
-- TacticGuideline: Any combination of options can define a mixture of options to modify options.
-- This function allows any module to modify this process.
-- The default process gives the priority to options from arguments.
Ligne 6 214 ⟶ 6 627 :
local min1, min2, min3 = 99, 99, 99
if (type(search) ~= "string") then search = "" end
local diffmaxi = modes.words_to_diffmaxi_limitsimilar_args_diffmaxi( string.len(search) )
local t = ", " .. tostring(diffmaxi) .. " / " .. tostring(length) .. " "
for key, arglingual in pairs(list) do
Ligne 6 229 ⟶ 6 642 :
end
t = t .. "<br>" .. viewers.ta("cherche", cherche) .. viewers.ta("trouve1", trouve1) .. viewers.ta("min1", min1) .. viewers.ta("trouve2", trouve2) .. viewers.ta("min2", min2) .. " " .. t
if trouve1 and (min1 == 0) then t = t .. viewers.styles_color_wikidata(viewers.ta("connu", trouve1)) end
if trouve1 and (min1 <= diffmaxi) then t = t .. viewers.styles_color_wikidata(viewers.ta("min1 "..min1.."<="..diffmaxi, trouve1)) end
if trouve2 and (min2 <= diffmaxi) then t = t .. viewers.styles_color_wikidata(viewers.ta("min2 "..min2.."<="..diffmaxi, trouve2)) end
if trouve3 and (min3 <= diffmaxi) then t = t .. viewers.styles_color_wikidata(viewers.ta("min3 "..min3.."<="..diffmaxi, trouve3)) end
return trouve1, min1, trouve2, min2, t
end -- function modes.similar_args_search(search, list)
 
function modes.import_arguments(known_arguments, args_source, content_translations, args_wikidata) -- Import all arguments from template, or invoke, or wikidata
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments - = { }
modes.known_arguments = known_arguments
local args_wikidata = args_wikidata or modes.args_wikidata or p.args_wikidata or {} -- optional value from p.known_arguments - = { -- }
modes.args_wikidata = args_wikidata
local args_import = args_import or modes.args_import or {} -- optional value from p.known_arguments - = { }
modes.args_import = args_import
-- default parameters
Ligne 6 247 ⟶ 6 660 :
content_translations = content_translations or langs.content_translations
-- Mix args_source in args_import, with priority for present args_source.
-- for key, argm in pairs(modes.args_template) do modes.args_import[key] = argm end
local err = nil
local cats = ""
modes.nowyear = tonumber(os.date("%Y") ) -- now_date = os.date("%Y-%m-%d %H:%M:%S")
ARGS.add(viewers.ARGS, 1, "import_arguments", { ["argsknown"] = known_arguments, ["argssource"] = args_source, ["argswikidata"] = args_wikidata, ["nowyear"] = modes.nowyear, } ) -- ARGS.t
modes.import_arguments_err = ""
modes.import_arguments_track = ""
Ligne 6 264 ⟶ 6 678 :
local key_N, key_NN = 0, 0
local arg_found, rec_found, already_found = false, false, false
-- initialize all arguments to "not found" before import them from p.known_arguments - = { -- }
for key_known, argm in pairs(known_arguments) do
if type(argm) == "table" then argm.found = 0 end
Ligne 6 274 ⟶ 6 688 :
datas.prop, datas.props = datas.get_item(modes.args_unknown, QITEM) -- Get datas from mw.wikibase for the page.
-- Try to read all known arguments. Intentar leer todos los argumentos conocidos. Essayer de lire tous les arguments connus.
for key_known, argm in pairs(known_arguments) do
local local_need, one_arg = 0, {} -- to select
if type(argm) == "table" then
local headers = "modes_known_arguments_report_headers" -- "key; val; type; need; keyword; syn; prop; format; source"
argm.src = nil
-- [[ Tactic NOWNOW CentralManual need=0=noevent need=1=depend keyword+default event need=2=permit default need=3=enforce default
argm.trk = " n"
for key_known, one_arg in pairs(known_arguments) do
if known_arguments["keyword"] and known_arguments["keyword"]["need"] then local_need = known_arguments["keyword"]["need"] end -- need=0=noevent
if type(one_arg) == "table" then -- events.add_err(
if (known_arguments["keyword"] == one_arg["keyword"]) and (local_need == "enforce" ) then -- need=3=enforce default
one_arg["val"] = known_arguments["keyword"]["prop_default"] -- Wanted even if nil.
elseif (known_arguments["keyword"] == one_arg["keyword"]) and (local_need == "default" ) then -- need=2=permit default
one_arg["val"] = known_arguments["keyword"]["prop_default"]
elseif (known_arguments["keyword"] == one_arg["keyword"]) and (local_need == "default" ) then -- need=1=depend keyword+default event
one_arg["val"] = known_arguments["keyword"]["prop_default"]
elseif (known_arguments["keyword"] == one_arg["keyword"]) and (local_need == "" ) then -- need=0=noevent
one_arg["val"] = known_arguments["keyword"]["prop_default"]
end
one_arg.src = nil
one_arg.trk = " n"
key_known_init = key_known
-- first initialise each known argument
modes.import_arguments_track = tostring(modes.import_arguments_track) .. " - " .. tostring(key_known)
one_arg_synargm_syn = known_arguments[one_argargm.keyword]
ARGS.add(viewers.ARGS, 1, "known_arguments for", { key = key_known, None_argNargm = lua_table.level_count(one_argargm), syn = one_argargm.syn, } ) -- ARGS.t
if one_argargm.syn == 2 then
-- Name an unnamed argument, positional, by its synonym. Nommer un argument non nommé, numéroté, par son synonyme.
-- Rename a named argument, by its synonym. Renommer un argument nommé, par son synonyme.
-- one_arg_origargm_orig = key_known -- DEBUG
key_known = one_argargm.keyword
-- synonyms are defined with the stamp "syn = 2", then here stamp the basic argument with "syn = 1".
known_arguments[key_known].syn = 1
one_argargm = known_arguments[key_known] -- new variable one_argargm
one_argargm.src = nil
one_argargm.trk = "s"
modes.import_arguments_track = tostring(modes.import_arguments_track) .. ">" .. tostring(key_known)
end
Ligne 6 311 ⟶ 6 712 :
arg_found = false
argval = nil
one_argargm.trk = one_argargm.trk.."="
-- Import a wikidata argument. Importer un argument wikidata
if type(datas.props) == "table" and datas.props[key_known] then
one_argargm["val"] = datas.props[key_known]
argval = datas.props[key_known]
one_argargm.src = "wd"
one_argargm.trk = one_argargm.trk.."w"
if one_arg_origargm_orig then
-- known_arguments[one_arg_origargm_orig].src = "wd"
-- known_arguments[one_arg_origargm_orig].trk = (known_arguments[one_arg_origargm_orig].trk or "").."w"
end
arg_found = true
Ligne 6 332 ⟶ 6 733 :
-- if argval then -- the argument value exist and come from template else from invoke else from wikidata
argval = args_source[arglingual]
one_argargm.src = "args"
one_argargm.trk = one_argargm.trk.." a"
arg_found = true
local arg_values = content_translations[one_argargm.arg_values]
if one_argargm.keys_values and arg_values then
-- The argument is limited to multiple values with arg_values and keys_values, and the values are defined.
local pos = string.find(arg_values, argval)
if pos then
-- The value of the argument is in the multiple values of the arguments.
-- one_argargm.src = "args"
one_argargm.trk = one_argargm.trk.."m"
-- arg_found = true
if one_arg_origargm_orig then
-- known_arguments[one_arg_origargm_orig].src = "args"
-- known_arguments[one_arg_origargm_orig].trk = (known_arguments[one_arg_origargm_orig].trk or "").."d"
end
else
events.add_err("modes_args_values_err", one_argargm.keyword, argval, arg_values)
-- function events.add_err( local_need == 2
-- case.res = events.add_record(case.typ, case.key, case.vals ) -- Add a new error, warning or category in a list. function events.add_record(
-- return { case.typ, case.key, case.need, case.res, }
-- function modes.import_arguments(known_arguments, case.typ, case.key, case.need, case.res events.add_err( local_need == 2
-- argval = nil
end
else
-- one_argargm.src = "args"
one_argargm.trk = one_argargm.trk.."c"
-- arg_found = true
if one_arg_origargm_orig then
-- known_arguments[one_arg_origargm_orig].src = "args"
-- known_arguments[one_arg_origargm_orig].trk = (known_arguments[one_arg_origargm_orig].trk or "").."c"
end
end
Ligne 6 370 ⟶ 6 767 :
-- events.add_err("versions_module_miss_i18n_trad_err", key_known)
-- Generate a category to list all modules with missing translation
cats = cats .. events.add_cat( "versions_err_module_miss_i18n_cat" )
end
key_N = tonumber(key_known_init)
if key_N and not known_arguments[key_N] then
events.add_err("modes_too_unnamed_arguments_err", key_N, argval) -- local_need
events.add_cat("versions_with_usage_error_cat")
end
-- Record the argument. Guarde el argumento. Enregistrer l'argument.
if arg_found == true then
one_argargm.found = one_argargm.found + 1 -- count redifined arguments
one_argargm.val = argval
args_import[key_known] = argval -- received international arguments table
if modes.args_unknown[arglingual] then
Ligne 6 389 ⟶ 6 786 :
end
-- modes.import_arguments: after import itself, some surrounding checks.
for key_known, one_argargm in pairs(known_arguments) do -- For all known arguments
-- Redefined arguments. Argumentos redefinieron. Arguments redéfinis.
-- synonyms are defined with the stamp "syn = 2", then here stamp the basic argument with "syn = 1".
if one_argargm.keyword and known_arguments[one_argargm.keyword] and known_arguments[one_argargm.keyword].syn then -- if the argument is a synonym, increase the found level
if one_argargm.found and (one_argargm.found > 2) then
events.add_err("modes_value_re_defined_err", (one_argargm["keyword"] or "**") ) --.. ">2")
cats = cats .. events.add_cat("versions_with_usage_error_cat")
end
else
if one_argargm.found and (one_argargm.found > 1) then
events.add_err("modes_value_re_defined_err", (one_argargm["keyword"] or "**") ) --.. ">1")
cats = cats .. events.add_cat("versions_with_usage_error_cat")
end
end
Ligne 6 407 ⟶ 6 804 :
-- need = 2 necessary from argument or module interaction
-- Missing Arguments. Argumentos que faltan. Arguments manquants.
if one_argargm.need and (one_argargm.need == 1) and (not argm.val) then
arglingual = content_translations[key_known]
if arglingual then
events.add_err("modes_need_arg_value_err", arglingual)
cats = cats .. events.add_cat("versions_with_usage_error_cat")
end
end
Ligne 6 424 ⟶ 6 821 :
if not key_N then
events.add_err("modes_unknown_argument_err", arglingual, val_src)
cats = cats .. events.add_cat("versions_with_usage_error_cat")
-- "Error: parameter <b>%1</b> is unknown in this template. Check the name or flag this gap.",
-- Look for a known and similar name argument
local diffmaxi = modes.words_to_diffmaxi_limitsimilar_args_diffmaxi( string.len(arglingual) )
local trouve1, min1, trouve2, min2 = modes.similar_args_search(arglingual, args_list)
if min1 and (min1 <= diffmaxi) then
Ligne 6 452 ⟶ 6 849 :
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = modes.args_unknown, -- Use default cases.
rowGroup = {},
form_one_case = function(case) -- Convert a case from test_group to rowGroup.
return { case.i, case.where, case.save, }
Ligne 6 459 ⟶ 6 855 :
headers = "modes_args_unknown_report_headers",
headers = "i;where;save",
rowGroup = {},
-- track_on == "details",
}
t = t .. "<br/>" .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
Ligne 6 490 ⟶ 6 888 :
if type(module_name) ~= "string" then module_name = "Central" end
local n, t, val = 0, "", ""
if type(known_arguments) ~= "table" then t = t.."err_known_argumentserr_args_final="..type(known_arguments).."<br>" end -- optional arguments
if type(known_arguments) ~= "table" then known_arguments = modes.known_arguments end -- optional arguments
local key, argknw, argval, arglingual = "", "", ""
Ligne 6 500 ⟶ 6 898 :
if n then key = tostring(parm["keyword"]) end -- key for unnamed arguments, in numeric sort
argknw = known_arguments[key]
arglingual = viewers.form9user(arglingual) -- multilingual name of the argmtone_arg in the template
if arglingual == "nil" then arglingual = key end -- if argument is translatable
val = parm -- tostring(args_import[key])
Ligne 6 631 ⟶ 7 029 :
args = mw.clone(known_arguments)
local arglst = {}
for key, elem in pairs(known_arguments) do
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang()
for key, elem in pairs(args) do
elem.key = tostring(key)
descr = key .. "_descr" -- key for description of an argument
Ligne 6 784 ⟶ 7 181 :
end -- function modes.init_modes_translate_events(frame, Central_version, mode_name, known_arguments, options_for_modes, QITEM)
 
-- p_template_drop_box_name = 'Cuadro desplegable', -- Equivalent templates exist in other wikis
-- { "20181204", "20181204", "done", "Rical", "S181204SCi", "For 'Begin' function modes.get_args_datas(known_arguments) Simplify Central.init" },
-- p_template_drop_box_name = 'Boîte déroulante', -- Modèle:Boîte déroulante for drop_box.form
-- { "20181203", "20181204", "done", "Rical", "S181203mad", "For 'Begin' rename function modes.get_args_datas( to modes.get_mode_args_datas( To simplify Central.init" },
-- p_template_drop_box_name = 'Drop-down box', -- Template: Drop-down box for drop_box.form
-- function modes.get_mode_args_datas(known_arguments) -- S181203mad To simplify Central.init S181204SCi
-- p_template_drop_box_name = 'Cuadro desplegable', -- Modelo: cuadro desplegable :Boîte déroulante for drop_box.form
function modes.get_args_datas(known_arguments) -- Applies the Tatic for (err, wng, cat) S181124Dng FAMLTVQDR
-- ["QITEM"] = { ["typ"] = "dat", ["keyword"] = "QITEM", ["prop"] = "QITEM", ["prop_default"] = "Q307", }, -- Galilée
-- datas.entity = mw.wikibase.getEntity(datas.QITEM or datas.default_item or "Q34743" ) -- Rudyard Kipling
-- Tactic : p.known_arguments redefines arguments from submodules then avoid their tactics.
-- Tactic : if the ["QITEM"] = don't exists do not query datas.item.
-- Tactic : if the ["keyword"] = "QITEM" don't exists do not query datas.item.
-- Tactic : if ["QITEM"] exists the decreasing priorities are : .
-- Tactic : if ["prop"] = "QITEM" try to query mw.wikibase.getEntity(...)
-- Tactic : then if not datas.item then try ["prop_default"] = "Q307" -- Galilée
-- Tactic : no other priority. Tactic todo
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {}
local known_arguments_local = mw.clone(known_arguments)
local group, one_data, one_QITEM = {}, {}, {}
for i, one_arg in pairs(known_arguments_local) do
if not one_arg.prop then one_arg.prop = one_arg.prop_default end
if one_arg.prop then
one_arg.prop = datas.one_prop(one_arg)
one_arg["val"] = one_arg.prop
-- function datas.one_prop(one_arg) -- Get datas from mwwikibase for one property of the page.
-- elseif one_arg["prop"] == "labeluser" then one_arg["val"] = mw.wikibase.getLabelByLang(datas.QITEM, langs.user_lang ) -- Rudyard Kipling
-- return one_arg
end
if one_arg["QITEM"] then
-- function datas.get_item(known_arguments, QITEM) -- Get datas from mw.wikibase for the page.
-- datas.props = props
-- datas.prop = prop
-- return prop, props
datas.prop, datas.props = datas.get_item(known_arguments, one_arg["QITEM"]) -- Get datas from mwwikibase for one property of the page. function datas.get_item(
if not datas.props then
one_arg["QITEM"] = one_arg.prop_default
datas.prop, datas.props = datas.get_item(known_arguments, one_arg["QITEM"]) -- function datas.get_item(known_arguments, one_arg["QITEM"])
one_arg["val"] = datas.prop
end
if datas.props then one_arg["val"] = datas.props end
end
end -- modes.get_args_datas(t) is empty
return known_arguments
end -- known_arguments = modes.get_args_datas(known_arguments)
 
modes.get_args_datas_tests_group = { -- Table of the definitions of all known arguments at module level.
["QITEM"] = { ["typ"] = "dat", ["keyword"] = "QITEM", ["prop"] = "Q1001", ["prop_default"] = "Q307", }, -- Galilée
["label"] = { ["typ"] = "dat", ["keyword"] = "label" , ["prop"] = "label", ["prop_default"] = "label", },
["mode"] = { ["typ"] = "mode", ["keyword"] = "mode", ["prop"] = "edit", ["Tactic"] = "canbenil;nevererror", ["prop_default"] = "read", },
["labelcontent"] = { ["typ"] = "arg", ["keyword"] = "labelcontent",["prop"] = "labelcontent", ["prop_default"] = "Q307", }, -- Galilée
["labelpage"] = { ["typ"] = "arg", ["keyword"] = "labelpage", ["prop"] = "labelpage", ["prop_default"] = "Q307", }, -- Galilée
["labeluser"] = { ["typ"] = "arg", ["keyword"] = "labeluser", ["prop"] = "labeluser", ["prop_default"] = "Q307", }, -- Galilée
["labelbylang"] = { ["typ"] = "arg", ["keyword"] = "labelbylang",["prop"] = "labelbylang", ["prop_default"] = "Q307", }, -- Galilée
["birthyear"] = { ["typ"] = "dat", ["keyword"] = "birthyear", ["prop"] = "P569", ["format"] = "year", ["prop_default"] = "P570", }, -- birthyear else deathyear
["deathyear"] = { ["typ"] = "dat", ["keyword"] = "birthyear", ["prop"] = "P570", ["format"] = "year", ["prop_default"] = "P569", }, -- deathyear else birthyear
["birthyear"] = { ["typ"] = "err", ["keyword"] = "birthyear", ["prop"] = "WANTED ERROR", ["format"] = "year", ["prop_default"] = "P570", }, -- ERROR deathyear
-- Galilée (Q307), Victor Hugo (Q535), Aristote (Q868), Albert Einstein (Q937), Mohandas Karamchand Gandhi (Q1001), Christophe Colomb (Q7322),
}
 
-- { "20181130", "20181203", "done", "Rical", "S181130mgT", "function modes.get_args_datas_tests(t) Tactic all in one for modes args datas no known_arguments no origins" },
function modes.get_args_datas_tests(t) -- Test: events.need_tactic for (err, wng, cat)
local memo = viewers.save_configs("modes.get_args_datas_tests") -- Save global configuration before eventual changes.
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {}
local t = t or "\n* <b>modes.get_args_datas(t)</b> -- Test: all kinds of events (err, wng, cat): "
local group = {}
for i, one_event in pairs(modes.get_args_datas_tests_group) do
-- TO TAKE IN ACCOUNT
-- datas.prop, datas.props = datas.get_item(known_arguments, one_arg["QITEM"]) -- Get datas from mwwikibase for one property of the page. function datas.get_item(
-- t = t .. viewers.ta("keyword", one_event.keyword) .. viewers.ta("prop", one_event.prop) .. viewers.ta("prop_default", one_event.prop_default)
table.insert(group, one_event)
end -- modes.get_args_datas(t) is empty
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = group, -- Use default cases
title_memo = "events_one_event_test_title", -- "events.all_kinds_test() Test: all kinds of events (err, wng, cat)",
headers_class = "wikitable alternative center sortable",
headers = "events_all_kinds_tests_headers", -- "typ;key;idargs;result"
headers = " arg name; type; property; prop_default; value",
form_one_case = function(case) -- Convert a case from test_group to rowGroup.
return { tostring(case.keyword), tostring(case.typ), tostring(case.prop), tostring(case.prop_default) , tostring(case.val) }
end,
rowGroup = {},
-- track_on = true,
}
-- res = res .. drop_box.new(selector, "modes_get_args_datas_tests_title", modes.get_args_datas_tests)
t = t .. tableview.new(tab_view) -- Formats a table view with lines and columns.
viewers.restore_configs(memo, "modes.get_args_datas_tests") -- Restore global configurations after eventual changes.
return t
end -- t = t .. modes.get_args_datas_tests(t) -- Tests
 
function modes.Init_mode_args_datas_tests(t) -- p.teststests = "FAMLTVQDR"
local memo = viewers.save_configs("modes.Init_mode_args_datas_tests") -- Save global configuration before eventual changes.
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {}
local t = t or "\n* <b>modes.Init_mode_args_datas_tests(t) -- p.teststests</b> -- Test: all kinds of events (err, wng, cat): "
-- res = res .. drop_box.new(selector, "modes_Init_args_datas_tests_title p.teststests **", modes.Init_mode_args_datas_tests)
-- res = res .. drop_box.new(selector, "modes_get_args_datas_tests_title", modes.get_args_datas_tests)
local group = {}
for i, one_event in pairs(modes.get_args_datas_tests_group) do
-- TO TAKE IN ACCOUNT
-- datas.prop, datas.props = datas.get_item(known_arguments, one_arg["QITEM"]) -- Get datas from mwwikibase for one property of the page. function datas.get_item(
-- t = t .. viewers.ta("keyword", one_event.keyword) .. viewers.ta("prop", one_event.prop) .. viewers.ta("prop_default", one_event.prop_default)
table.insert(group, one_event)
end -- modes.get_args_datas(t) is empty
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = group, -- Use default cases
title_memo = "events_one_event_test_title", -- "events.all_kinds_test() Test: all kinds of events (err, wng, cat)",
headers_class = "wikitable alternative center sortable",
headers = "events_all_kinds_tests_headers", -- "typ;key;idargs;result"
headers = " arg name; type; property; prop_default; value",
form_one_case = function(case) -- Convert a case from test_group to rowGroup.
return { tostring(case.keyword), tostring(case.typ), tostring(case.prop), tostring(case.prop_default) , tostring(case.val) }
end,
rowGroup = {},
-- track_on = true,
}
-- res = res .. drop_box.new(selector, "modes_get_args_datas_tests_title", modes.get_args_datas_tests)
t = t .. tableview.new(tab_view) -- Formats a table view with lines and columns.
viewers.restore_configs(memo, "modes.Init_mode_args_datas_tests") -- Restore global configurations after eventual changes.
return t
end -- t = t .. modes.Init_mode_args_datas_tests(t)
 
-- FAMLTVQDR Tactic only once steps : Frame Mode-from-Frame Args Libraries Translations Versions QITEM Datas Results
-- { "20181220", "20181221", "NOW", "Rical", "S181220oso", "select only sub-functions in the right order in function p.init_central_module()", },
function p.Init_central_module(frame, mode_name, known_arguments, options_for_modes, QITEM) -- FAMLTVQDR replaces function Central.init( code
-- Central.init(frame, mode_name, known_arguments, options_for_modes, QITEM) -- FAMLTVQDR Typical call
local res = ""
local frame = frame or mw.getCurrentFrame() -- for F = Frame
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- for A in FAMLTVQDR Arguments definitions at module level p.known_arguments - = {...}
for key, one_arg in pairs(known_arguments) do
-- ["mode"] = { ["typ"] = "config", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
if type(one_arg) == "table" then
if one_arg["keyword"] and (one_arg["keyword"] == "mode") and modes.options_for_modes[modes.mode_name] then modes.mode_name = modes.mode_name
else modes.mode_name = one_arg["prop_default"] end -- prop_default = read -- for M = Mode
end
end
local bindable_libraries = bindable_libraries or versions.bindable_libraries or {} -- optional value from p.known_arguments - = {...}
versions.setup_central_libraries(bindable_libraries, opt) -- for L = Libraries Install central bindable libraries in package.loaded
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang() -- for T = Translations
-- 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.", }
versions.init(frame, Central_version, mode_name, known_arguments, options_for_modes, QITEM) -- V in FAMLTVQDR
local options_for_modes = options_for_modes or modes.options_for_modes or {} -- M in FAMLTVQDR or {} -- optional value from p.known_arguments - = {...}
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.known_arguments, options_for_modes, QITEM or itemid)
datas.props = datas.get_item(known_arguments, QITEM) -- Get datas from mw.wikibase for the page.
known_arguments = modes.get_args_datas(known_arguments) -- Applies the Tatic for (err, wng, cat) S181124Dng
modes.get_args(known_arguments) -- Interactions between arguments
modes.known_arguments = modes.import_arguments(known_arguments, 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 p.Init_central_module_tests(t) -- For FAMLTVQDR.
local memo = viewers.save_configs("p.Init_central_module_tests") -- Save global configuration before eventual changes.
local t = t or "\n* <b>For FAMLTVQDR tests</b>"
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = {
{ ["typ"] = "config", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
{ ["typ"] = "config", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "edit", }, -- Mode read as default
{ ["typ"] = "config", ["keyword"] = "modemode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
{ ["typ"] = "dat", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
},
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",
}
-- res = res .. drop_box.new(selector, "modes Init Frame Args Mode Libraries **", p.Init_central_module_tests)
-- res = res .. drop_box.new(selector, "modes_get_args_datas_tests_title", modes.get_args_datas_tests)
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
return { case.typ, case.keyword, case.prop, case.prop_default, }
end
local t = tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
viewers.restore_configs(memo, "p.Init_central_module_tests") -- Restore global configurations after eventual changes.
return t --, errors -- langs_missing_translations_title
end -- t = t .. p.Init_central_module_tests
 
-- cut_libraries
 
-- - - - ------------------ - - - - ------------------ - - - - -----------------------------
-- - - - ------------------ - - - - ------------------ - - - - -----------------------------
-- The Library:events supports events of types erros, warnings and categories.
-- viewers.save_configs("events.save_configs" memo, tab_view, group ) -- Init a new events group
-- events.add_err(key, ... ) -- Add an error in the actual table of events.
-- events.add_cat_group(groupCat, groupList) -- Add some categories in the actual table of events.
-- events.form(evt) -- Format events types
-- events.all_categories_test(t) -- test categories
-- - - - ------------------ - - - - ---------------------------------
-- - - - ------------------ - - - - ---------------------------------
 
-- events = {} -- already declared by Scribunto, see central_library.new() -- Record a library in package.loadedS
 
events.i18n = {} -- Translations for Library:events
events.i18n.br = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "Tester categ_Test : catégories dans quelques langues",
events_all_kinds_tests_title = "events.all_kinds_test() Test: toutes les sortes d'événements (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_add_cat_deprecated = "Fonction obsolète dans le module principal.",
events_close_without_memo_err = "viewers.restore_configs(memo, where) sans <b>memo</b> dans le module <b>%1</b>.",
events_antiCrash_protect_err = "La fonction antiCrash() protège cette page contre un effondrement complet dû à une erreur interne : %1.",
} -- events.i18n.br
events.i18n.en = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "categ_Test test : classes in some languages",
events_all_kinds_tests_title = "events.all_kinds_test() Test: all kinds of events (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_close_without_memo_err = "viewers.restore_configs(memo, where) without <b>memo</b> in module <b>%1</b>.",
events_antiCrash_protect_err = "The antiCrash() function protects this page against a complete crash due to an internal error: %1.",
} -- events.i18n.en
events.i18n.es = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "Prueba categ_Test: clases en algunos lenguajes",
events_all_kinds_tests_title = "events.all_kinds_test() Prueba: todo tipo de eventos (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_add_cat_deprecated = "Función obsoleto en módulo principal.",
events_close_without_memo_err = "viewers.restore_configs(memo, where) sin <b>memo</b> en el módulo <b>%1</b>.",
events_antiCrash_protect_err = "La función antiCrash() protege esta página contra un colapso completo debido a un error interna: %1.",
} -- events.i18n.es
events.i18n.fr = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "Tester categ_Test : catégories dans quelques langues",
events_all_kinds_tests_title = "events.all_kinds_test() Test: toutes les sortes d'événements (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_add_cat_deprecated = "Fonction obsolète dans le module principal.",
events_close_without_memo_err = "viewers.restore_configs(memo, where) sans <b>memo</b> dans le module <b>%1</b>.",
events_antiCrash_protect_err = "La fonction antiCrash() protège cette page contre un effondrement complet dû à une erreur interne : %1.",
} -- events.i18n.fr
events.i18n.hu = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "Tester categ_Test : catégories dans quelques langues",
events_all_kinds_tests_title = "events.all_kinds_test() Test: toutes les sortes d'événements (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_add_cat_deprecated = "Fonction obsolète dans le module principal.",
events_close_without_memo_err = "viewers.restore_configs(memo, where) sans <b>memo</b> dans le module <b>%1</b>.",
events_antiCrash_protect_err = "La fonction antiCrash() protège cette page contre un effondrement complet dû à une erreur interne : %1.",
} -- events.i18n.hu
events.i18n.vi = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "Tester categ_Test : catégories dans quelques langues",
events_all_kinds_tests_title = "events.all_kinds_test() Test: toutes les sortes d'événements (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_add_cat_deprecated = "Fonction obsolète dans le module principal.",
events_close_without_memo_err = "viewers.restore_configs(memo, where) sans <b>memo</b> dans le module <b>%1</b>.",
events_antiCrash_protect_err = "La fonction antiCrash() protège cette page contre un effondrement complet dû à une erreur interne : %1.",
} -- events.i18n.vi
 
 
function events.add_record(typ, key, ... ) -- Add a new error, warning or category in a list.
-- Guide line: all events are in a single table, including categories, without duplication.
-- Guide line: without duplication: events differ if the type, the key or any value of any argument differs.
-- Guide line: We can view or categorize categories.
local evt = events.new(typ, key, ...) -- Initialize and finalize a new event.
local evt = events.add_new(evt) -- Add an error, warning or category in the lists. S170626rev
local res, evt = events.form(evt, c) -- Format an event as an error, warning or category.
events.one_event = evt
return res, evt
end -- local res, evt = events.add_record(typ, key, ... )
 
function events.form(one_event, vals) -- Format an event as an error, warning or category or data.
local one_event = mw.clone(one_event or {}) -- do not disturb input event
-- one_event.res = tostring(one_event.res) .. "? form " .. viewers.form9tests(".form one_event.key=%1, one_event.res=%2, ", one_event.key, one_event.res )
if type(one_event) ~= "table" then
local one_event = {}
one_event.res = lua_table.rough_view(one_event)
return one_event.res, one_event
end
if (one_event.typ ~= "cat") and (one_event.typ ~= "wng") and (one_event.typ ~= "err") then
one_event.res = lua_table.rough_view(evt)
return one_event.res, evt
end
one_event.tableStyle = one_event.tableStyle or "" -- Could change the style of the wikitext. Not available on 20160916
if type(one_event.name) ~= "string" then one_event.name = ""
elseif one_event.name ~= "" then one_event.name = one_event.name .. "_" end
one_event.idargs = one_event.name .. tostring( viewers.form9user( tostring(one_event.key), lua_table.to_list( one_event.vals ) ) )
-- Each type of event formats its own type of wikitext
one_event.content_wkt = viewers.form9content(one_event.key, lua_table.to_list( one_event.vals ) )
one_event.page_wkt = viewers.form9page(one_event.key, lua_table.to_list( one_event.vals ) )
one_event.user_wkt = viewers.form9user(one_event.key, lua_table.to_list( one_event.vals ) )
one_event.res = "" -- multilingual
if one_event.typ == "err" then one_event.res = viewers.styles_color_error(one_event.user_wkt) end
if one_event.typ == "wng" then one_event.res = viewers.styles_color_warning(one_event.user_wkt) end
one_event.ccc = c or one_event.catview or events.catview or ":"
one_event.content_catspace = mw.site.namespaces.Category.name -- name: Local namespace name.
if one_event.typ == "cat" then -- Format a category to display or activate
one_event.res = events.form_cat(one_event)
-- If needed, add a second "Category:Module with internal error" S180604crm
if viewers.is_in("_i_cat", key) then res = res .. events.add_cat("versions_with_internal_error") end
if viewers.is_in("_i_err", key) then res = res .. events.add_cat("versions_with_internal_error") end
-- If needed, add a second "Category:Module with user error"
if viewers.is_in("_u_cat", key) then res = res .. events.add_cat("versions_with_user_error") end
if viewers.is_in("_u_err", key) then res = res .. events.add_cat("versions_with_user_error") end
end
local one_event_data
if (one_event.need == "noevent") then one_event.res = nil end
if (one_event.need == "default") and one_event.res == nil then one_event.res = one_event.prop_default end
if (one_event.need == "enforce") then one_event.res = one_event.prop_default end
if (one_event.need == "data") then
one_event_data = datas.one_prop(one_event) -- Get datas from mwwikibase for one property of the page. function datas.one_prop
one_event.res = one_event_data.val end -- one_arg_properties
-- { ["typ"] = "cat", ["need"] = "data", ["prop_default"] = "P1559", ["key"] = "Q535", ["vals"] = {}, }, -- Property:P1559 ⋅ Property:P1559 ⋅ actions Victor hugo
return one_event.res, one_event
end -- function events.form(one_event, vals) -- Format an event as an error, warning or category or data
 
events.need_one_event_test_group = {
{ ["typ"] = "err", ["need"] = "default", ["prop_default"] = "England", ["key"] = "versions_module_with_error_err", },
{ ["typ"] = "cat", ["need"] = "default", ["prop_default"] = "France", ["key"] = "p_authors_birthyear_cat", },
{ ["typ"] = "err", ["need"] = "default", ["prop_default"] = "España", ["key"] = "modes_no_known_arguments_err", ["vals"] = {}, },
{ ["typ"] = "cat", ["need"] = "default", ["prop_default"] = "Paris", ["key"] = "modes_no_known_arguments_i_cat", ["vals"] = {}, },
{ ["typ"] = "err", ["need"] = "default", ["prop_default"] = "Madrid", ["key"] = "modes_no_source_arguments_err", ["vals"] = {}, },
{ ["typ"] = "cat", ["need"] = "default", ["prop_default"] = "England", ["key"] = "modes_no_source_arguments_cat", ["vals"] = {}, },
{ ["typ"] = "cat", ["need"] = "default", ["prop_default"] = "España", ["key"] = "versions_err_module_miss_i18n_cat", ["vals"] = {}, },
{ ["typ"] = "data", ["need"] = "default", ["prop_default"] = "P1559", ["key"] = "Q535", ["vals"] = {}, },
} -- events.need_one_event_test_group
-- Guide line NOWNOW CentralManual need=0="noevent" need=1=depend keyword+default event need=2=permit default need=3=enforce default
-- Guide line ["need"] = 0, ["need"] = "noevent", ["need"] = 1, ["need"] = "default", ["need"] = 2, ["need"] = "default", ["need"] = 3, ["need"] = "enforce",
 
function events.need_tactic(one_event, ...) -- Formats one_event according to need in known_args or datas_args (err, wng, cat)
local one_event = mw.clone(one_event) -- Do not disturb initial known_args or datas_args.
one_event.vals = lua_table.to_list( ... )
-- if type(one_event.vals) ~= "table" then one_event.vals[1] = "nil table" end
-- if type(one_event.vals) == {} then one_event.vals[1] = "empty table" end
local one_event = events.new(one_event.typ, one_event.key, one_event.vals) -- Initialize and finalize a new event.
local one_event = events.add_new(one_event) -- Add an error, warning or category in the lists. S170626rev
return one_event
end -- local one_event = events.all_kinds_test(t)
 
 
-- old right version begin
 
 
 
function events.add_cat(key, ... ) -- Add a category in the actual table of events.
return events.add_record("cat", key, ...) -- Add a error, warning or category in the lists. S170626rev
end
 
function events.add_err(key, ... ) -- Add an error in the actual table of events.
return events.add_record("err", key, ...) -- Add a error, warning or category in the lists. S170626rev
end
 
function events.add_wng(key, ... ) -- Add a warning in the actual table of events.
return events.add_record("wng", key, ...) -- Add a error, warning or category in the lists. S170626rev
end
 
function events.form_cat(evt, txt, lnk, c, space)
local evt = evt or events.one_event
local space = space or (mw.site.namespaces.Category.name .. ":")
local c = c or evt.ccc or ":"
if evt.typ == "cat" then -- Format a category to display or activate
evt.content_wkt = viewers.form9content(evt.key, lua_table.to_list( evt.vals ) )
evt.page_wkt = viewers.form9page(evt.key, lua_table.to_list( evt.vals ) )
evt.user_wkt = viewers.form9user(evt.key, lua_table.to_list( evt.vals ) )
return " [[" .. c .. space .. (evt.content_wkt or lnk) .. "|" .. (evt.user_wkt or txt) .. "]] "
else
return ""
end
end
 
events.list_all_events = {} -- Table to collect all events types "err", "wng" and "cat".
 
function events.new(typ, key, ...) -- Initialize and finalize a new event.
local evt = {} -- default event
if type(typ) == "table" then
evt = typ -- Use a predefined event
else -- To finalize an existing event.
evt.typ = typ
evt.key = key
end -- Finalize all events
evt.typ = evt.typ or typ -- Type of event: err, wng, cat
evt.key = evt.key or key -- Translation key, simple or extended by name
if type(typ) ~= "string" then typ = "notyp" end -- To debug abnormal type of event
if type(key) ~= "string" then key = "nokey" end -- To debug abnormal translation key
evt.name = evt.typ or evt.key or "name" -- Translation key, simple or extended by name
evt.vals = evt.vals or { ... } -- table of arguments values
evt.catview = evt.catview or ":" -- Default value for eventual use
-- Check, yes or no, to form an event, in special cases
if (evt.typ == "cat") then
evt.res, evt = events.form( evt ) -- Formats the resulting wikitext, can be re-form later
elseif (evt.typ == "err") then
evt.res, evt = events.form( evt ) -- Formats the resulting wikitext, can be re-form later
elseif (evt.typ == "wng") then
evt.res, evt = events.form( evt ) -- Formats the resulting wikitext, can be re-form later
end
events.one_event = evt
return evt
end -- function events.new(typ, key, ...)
 
function events.add_new(evt) -- Add a error, warning or category in the lists. S170626rev
local evt = evt or events.one_event
-- Select only new events
if type(evt) ~= "table" then evt = {} end
local new_evt = viewers.form9tests( tostring(evt.key), lua_table.to_list( evt.vals ) )
for i, event in pairs(events.list_all_events) do
local old_evt = viewers.form9tests( tostring(event.key), lua_table.to_list( event.vals ) )
if new_evt == old_evt then new_evt = nil ; break end -- Add only new events. Reject already seen events.
end
-- events.add_wng("modes_auto_val_warning_wng", langs.user_translations[key], val) -- form_result
if new_evt then table.insert(events.list_all_events, evt) end
events.one_event = evt
return evt
end -- function events.add_new(typ, ref, ...)
 
function events.add_record(typ, key, ... ) -- Add a new error, warning or category in a list.
-- Guide line: all events are in a single table, including categories, without duplication.
-- Guide line: without duplication: events differ if the type, the key or any value of any argument differs.
-- Guide line: We can view or categorize categories.
local evt = events.new(typ, key, ...) -- Initialize and finalize a new event.
local evt = events.add_new(evt) -- Add an error, warning or category in the lists. S170626rev
local res, evt = events.form(evt, c) -- Format an event as an error, warning or category.
events.one_event = evt
return res, evt
end -- local res, evt = events.add_record(typ, key, ... )
 
function events.form(evt, c) -- Format an event as an error, warning or category.
local evt = evt or events.one_event
evt.res = tostring(evt.res) .. "? form " .. viewers.form9tests(".form evt.key=%1, evt.res=%2, ", evt.key, evt.res )
local evt = mw.clone(evt) -- do not disturb input event
if type(evt) ~= "table" then
evt.res = lua_table.rough_view(evt)
return evt.res, evt
end
if (evt.typ ~= "cat") and (evt.typ ~= "wng") and (evt.typ ~= "err") then
evt.res = lua_table.rough_view(evt)
return evt.res, evt
end
evt.tableStyle = evt.tableStyle or "" -- Could change the style of the wikitext. Not available on 20160916
if type(evt.name) ~= "string" then evt.name = ""
elseif evt.name ~= "" then evt.name = evt.name .. "_" end
evt.idargs = evt.name .. tostring( viewers.form9user( tostring(evt.key), lua_table.to_list( evt.vals ) ) )
-- Each type of event formats its own type of wikitext
evt.content_wkt = viewers.form9content(evt.key, lua_table.to_list( evt.vals ) )
evt.page_wkt = viewers.form9page(evt.key, lua_table.to_list( evt.vals ) )
evt.user_wkt = viewers.form9user(evt.key, lua_table.to_list( evt.vals ) )
evt.res = "" -- multilingual
if evt.typ == "err" then evt.res = viewers.styles_color_error(evt.user_wkt) end
if evt.typ == "wng" then evt.res = viewers.styles_color_warning(evt.user_wkt) end
evt.ccc = c or evt.catview or events.catview or ":"
evt.content_catspace = mw.site.namespaces.Category.name -- name: Local namespace name.
if evt.typ == "cat" then -- Format a category to display or activate
evt.res = events.form_cat(evt)
if viewers.is_in("_i_cat", key) then -- If needed, add a second "Category:Module with internal error"
res = res .. events.add_cat("versions_with_internal_error")
end
if viewers.is_in("_u_cat", key) then -- If needed, add a second "Category:Module with user error"
res = res .. events.add_cat("versions_with_user_error")
end
end
events.one_event = evt
return evt.res, evt
end -- function events.form(evt, c)
 
-- if case.code == langs.content_lang then case.content = case.count ; total_stat.content = total_stat.content + case.count end
-- if case.code == langs.page_lang then case.page = case.count ; total_stat.page = total_stat.page + case.count end
-- if case.code == langs.user_lang then case.user = case.count ; total_stat.user = total_stat.user + case.count end
events.get_vals = {}
modes.known_arguments = modes.known_arguments or p.known_arguments or {}
events.all_kinds_test_group = {
--- { ["typ"] = "cat", ["need"] = 0, ["prop_default"] = "España", ["key"] = "p_authors_birthyear_cat", ["vals"] = { modes.known_arguments["birthyear"], langs.page_lang, events.one_event.vals[3]},
-- ["wikibase"] = "England", },
{ ["typ"] = "err", ["need"] = 0, ["prop_default"] = "Madrid", ["key"] = "versions_module_with_error_err", ["vals"] = {},
["wikibase"] = "England in the UK and Europe.svg", },
{ ["typ"] = "err", ["need"] = 1, ["prop_default"] = "Paris", ["key"] = "versions_module_with_error_err", ["vals"] = {},
["wikibase"] = "St Paul Cathedral.png", },
{ ["typ"] = "err", ["need"] = 2, ["prop_default"] = "England", ["key"] = "versions_module_with_error_err", ["vals"] = {},
["wikibase"] = "España", },
-- { ["typ"] = "cat", ["need"] = "3", ["prop_default"] = "France", ["key"] = "p_authors_birthyear_cat", ["vals"] = { modes.known_arguments["birthyear"],
-- events.one_event.vals[2], events.one_event.vals[3]},
-- ["wikibase"] = "Flag_of_Spain.svg", },
-- { ["typ"] = "cat", ["need"] = 0, ["prop_default"] = "España", ["key"] = "p_authors_deathyear_cat", ["vals"] = { modes.known_arguments["deathyear"],
-- events.one_event.vals[2], events.one_event.vals[3]},
-- ["wikibase"] = "Panorama_Madrid_Ayuntamiento_20090417.jpg", },
{ ["typ"] = "cat", ["need"] = 1, ["prop_default"] = "val", ["key"] = "versions_err_module_miss_i18n_cat", ["vals"] = {},
["wikibase"] = "Madrid", },
{ ["typ"] = "err", ["need"] = 1, ["prop_default"] = "España", ["key"] = "modes_no_known_arguments_err", ["vals"] = {},
["wikibase"] = "France", },
{ ["typ"] = "cat", ["need"] = 2, ["prop_default"] = "Paris", ["key"] = "modes_no_known_arguments_i_cat", ["vals"] = {},
["wikibase"] = "flag of France.svg", },
{ ["typ"] = "err", ["need"] = 3, ["prop_default"] = "Madrid", ["key"] = "modes_no_source_arguments_err", ["vals"] = {},
["wikibase"] = "Tour Eiffel", },
{ ["typ"] = "cat", ["need"] = 1, ["prop_default"] = "England", ["key"] = "modes_no_source_arguments_cat", ["vals"] = {},
["wikibase"] = "Paris", },
{ ["typ"] = "cat", ["need"] = 1, ["prop_default"] = "España", ["key"] = "versions_err_module_miss_i18n_cat", ["vals"] = {},
["wikibase"] = "England", },
-- { ["typ"] = "err", ["need"] = 0, ["prop_default"] = "France", ["key"] = "modes_too_unnamed_arguments_err", ["vals"] = { events.one_event.vals[1], events.one_event.vals[2]},
-- ["wikibase"] = "England in the UK and Europe.svg", },
{ ["typ"] = "cat", ["need"] = 3, ["prop_default"] = "España", ["key"] = "versions_with_usage_error_cat", ["vals"] = {},
["wikibase"] = "St Paul Cathedral.png", },
{ ["typ"] = "err", ["need"] = 2, ["prop_default"] = "Madrid", ["key"] = "modes_value_re_defined_err", ["vals"] = { modes.known_arguments["keyword"], },
["wikibase"] = "España", },
{ ["typ"] = "cat", ["need"] = 0, ["prop_default"] = "Madrid", ["key"] = "versions_with_usage_error_cat", ["vals"] = {},
["wikibase"] = "Flag_of_Spain.svg", },
{ ["typ"] = "err", ["need"] = 1, ["prop_default"] = "England", ["key"] = "modes_value_re_defined_err", ["vals"] = { modes.known_arguments["keyword"], },
["wikibase"] = "Panorama_Madrid_Ayuntamiento_20090417.jpg", },
{ ["typ"] = "cat", ["need"] = 1, ["prop_default"] = "val", ["key"] = "versions_with_usage_error_cat", ["vals"] = {},
["wikibase"] = "Madrid", },
} -- mw.wikibase.description France
--[[ Guide line NOWNOW CentralManual need=0=no event need=1=depend keyword+default event need=2=permit default need=3=enforce default
And ["prop_default"] depends of need in function datas.one_arg_properties(
cats = cats .. events.add_cat("versions_err_module_miss_i18n_cat")
-- Save as ModuleCentralizer.lua ModuleCentralizer all_kinds_test list type=t key=k argument=i result=r to debug.lua
-- function events.all_kinds_test() Test: toutes les sortes d'événements (err, wng, cat) NOWNOW
local evt = events.new(typ, key, ...) -- Initialize and finalize a new event.
local evt = events.add_new(evt) -- Add an error, warning or category in the lists. S170626rev
-- And ["prop_default"] depends of need in function modes.one_arg_check_need()
if not a.initial then -- If initial is undefined, enforce it. This property (Q29882054) exist but is not used.
-- https://www.wikidata.org/wiki/Q29882054 La dernière modification de cette page a été faite le 2017-10-21 à 05:18:03.
--]]
 
function events.add_new_test(t) -- Test: all kinds of events (err, wng, cat)
local memo = viewers.save_configs("events.add_new_test") -- Save global configuration before eventual changes.
local evt = events.new(evt.typ, evt.key, evt.vals) -- Initialize and finalize a new event.
-- local vals = lua_table.to_list( ... ) )
local new_evt = viewers.form9tests( tostring(evt.key), lua_table.to_list( evt.vals ) )
local evt = events.add_new(evt) -- Add an error, warning or category in the lists. S170626rev
viewers.restore_configs(memo, "events.add_new_test") -- Restore global configurations after eventual changes.
return evt
end -- function events.all_kinds_test(t)
 
function events.all_kinds_test(t) -- Test: all kinds of events (err, wng, cat)
local memo = viewers.save_configs("events.all_kinds_test") -- Save global configuration before eventual changes.
events.all_kinds_trck = "\n* events.all_kinds_trck: "
local t = t or "\n* <b>events.all_kinds_test(t)</b> -- Test: all kinds of events (err, wng, cat): "
t = t .. events.all_kinds_trck
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = events.all_kinds_test_group, -- Use default cases.
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",
headers_class = "wikitable alternative center sortable",
headers = " type; key; need; res",
form_one_case = function(case) -- Convert a case from test_group to rowGroup.
case.res = events.add_record(case.typ, case.key, case.vals ) -- Add a new error, warning or category in a list. function events.add_record(
return { case.typ, case.key, case.need, case.res, }
end,
-- { ["typ"] = "cat", ["key"] = "modes_auto_val_warning_wng", ["need"] = 2, ["arg1"] = "langs.user_translations", ["prop_default"] = "France", ["wikibase"] = "flag of France.svg", },
rowGroup = {},
-- track_on = true, one_arg_properties mw.wikibase.description
}
t = t .. tableview.new(tab_view) -- Formats a table view with lines and columns.
t = t .. viewers.ta("#test_group", lua_table.level_count(tab_view.test_group) ) -- function tableview.new( nil bug170602
t = t .. viewers.ta("#rowGroup", lua_table.level_count(tab_view.rowGroup) ) -- function tableview.new( nil bug170602
viewers.restore_configs(memo, "events.all_kinds_test") -- Restore global configurations after eventual changes.
return t
end -- function events.all_kinds_test(t)
 
function events.add_cat_group(groupCat, groupList) -- Add some categories in the actual table of events. Separated by ";".
-- catGroup("Country %1", "France,Italia") -> [[Category:Country France]] [[Category:Country Italia]]
if type(groupCat) ~= "string" then groupCat = "%1" end
if type(groupList) ~= "string" then return "" end
local cats = ""
for i, str in mw.text.gsplit(groupList, ";", true) do
local wkt = viewers.form9user(groupCat, str)
cats = cats .. events.add_cat(groupCat, wkt)
end
local res, evt = events.add("catGroup", groupCat, cats) -- Add an event to a group.
evt.trc = evt.trc .. viewers.form9user("\n* add_cat evt.typ=%1, evt.key=%2, ", evt.typ, evt.key)
events.one_event = evt
return res, evt
end -- function events.add_cat_group(groupCat, groupList)
 
function events.select_typ(typ) -- Select events by one type
local is = {}
for i, evt in pairs(events.test_group) do
if evt.typ == typ then table.insert( is, evt.idargs ) end
end
return is
end
 
function events.sort_typ() -- Sort events by type in wng, err, cat.
local wng, err, cat = {}, {}, {}
for i, evt in pairs(events.test_group) do
if evt.typ == "wng" then table.insert( wng, evt ) end
if evt.typ == "err" then table.insert( err, evt ) end
if evt.typ == "cat" then table.insert( cat, evt ) end
end
return wng, err, cat
end -- function events.sort_typ()
 
function events.selector( tab_view, evt )
local evt = evt or events.one_event
if type(evt) ~= "table" then
evt = { -- options for tableview.new() -- Formats a table with lines and columns.
headers = "typ;key;selector-name;wkt",
style = "",
typ = "err",
rowGroup = {},
}
else
evt.headers = evt.headers or "typ;key;else-name;wkt"
evt.tableStyle = evt.tableStyle or ""
evt.name = evt.name or "_"
evt.typ = evt.typ or "nil"
end
if (type(tab_view) == "table") and (type(tab_view.typ) == "string") and (tab_view.typ == evt.typ) then
table.insert( tab_view.test_group, { evt.typ, evt.key, evt.name, evt.wkt } )
elseif (type(tab_view) == "table") and (type(tab_view.typ) == "string") and (tab_view.typ == "v") then
table.insert( tab_view.test_group, { evt.typ, evt.key, evt.name, evt.wkt } )
else
tab_view = {}
table.insert( tab_view.test_group, { evt.typ, evt.key, evt.name, evt.wkt } )
end
events.one_event = evt
end -- function events.selector( tab_view, evt )
 
function events.all_kinds_test_test(t) -- Test: all kinds of events (err, wng, cat)
local memo = viewers.save_configs("events.all_categories_test") -- Save global configuration before eventual changes.
local t = t or "\n* <b>events.all_kinds_test()</b> Test: all kinds of events (err, wng, cat)"
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = nil, -- Use default cases.
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.
return { evt.typ, evt.key, evt.idargs, evt.res }
end
t = t .. tableview.new(tab_view) -- Form a table view with lines and columns.
viewers.restore_configs(memo, "events.all_kinds_test_test") -- Restore global configurations after eventual changes.
return t --, errors -- langs_missing_translations_title
end -- function events.all_kinds_test_test(t)
 
events.errors_list = {} -- Deprecated: Table to collect errors and warnings
events.erron = true -- Activated or not errors. Errores activado o no. Erreurs activées ou non.
events.categories_list = {} -- Table to collect all categories to generate in wikitext
 
function events.errors_lister(title, v1, v2, v3, v4, v5, v6, v7, v8, v9)
local res, msgref = "", ""
local mwtitle = mw.title.getCurrentTitle()
local page = tostring(mwtitle.nsText) .. ":" .. tostring(mwtitle.text)
if type(title) ~= "string" then title = "modes_error_list_header_err" end
res = res .. '\n*' .. viewers.form9user(title, page, v1, v2, v3, v4, v5, v6, v7, v8, v9) -- .. ' - ' .. page
local n = 0
for k, wng in ipairs(events.errors_list) do
msgref = viewers.form9user(wng.ref, wng.v1, wng.v2, wng.v3, wng.v4, wng.v5, wng.v6, wng.v7, wng.v8, wng.v9) -- texte traduit ou direct
if wng.typ == "wng" then
res = res .. '<br>⦁ ' .. viewers.styles_color_warning(msgref)
end
end
for k, wng in ipairs(events.errors_list) do
msgref = viewers.form9user(wng.ref, wng.v1, wng.v2, wng.v3, wng.v4, wng.v5, wng.v6, wng.v7, wng.v8, wng.v9) -- texte traduit ou direct
if wng.typ == "err" then
res = res .. '<br>⦁ ' .. viewers.styles_color_error(msgref)
n = n + 1
end
end
if n > 0 then
events.add_cat("versions_module_with_error_err")
end
return res
end -- function events.errors_lister(title, v1, v2, v3, v4, v5, v6, v7, v8, v9)
 
function events.gener_categories(known_arguments) -- Only for this library, form categories without activate them
local known_arguments = known_arguments
if type(known_arguments) ~= "table" then known_arguments = modes.known_arguments end
if known_arguments.birthyear then
events.add_cat("p_authors_birthyear_cat", known_arguments.birthyear)
end
if known_arguments.deathyear then
events.add_cat("p_authors_deathyear_cat", known_arguments.deathyear)
end
if known_arguments.description then
-- events.add_cat("p_authors_deathyear_cat", known_arguments.description)
end
return
end -- function events.gener_categories(known_arguments)
 
function events.categories_lister(c) -- Categorize categories, or view categories if c=":".
local res = ""
modes.options_to_cat_view()
-- c can replace cat_view to enforce the documentation or the categorisation
c = c or modes.cat_view or ""
for k, evt in pairs(events.list_all_events) do
if (evt.typ == "cat") then
local keyuser = viewers.form9user(evt.key)
local keycontent = viewers.form9content(evt.key)
res = res .. events.form_cat(evt, keyuser, keycontent, c)
end
end
return res
end -- function events.categories_lister(c)
 
-- cut_libraries
Ligne 7 534 ⟶ 7 211 :
versions.i18n = {} -- Translations for versions library
versions.i18n.br = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Principaux textes, erreurs et catégories des outils
versions_module_with_error_err = "Module avec erreur",
Ligne 7 590 ⟶ 7 265 :
} -- versions.i18n.br
versions.i18n.de = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Principaux textes, erreurs et catégories des outils
versions_module_with_error_err = "Modul mit Fehler",
Ligne 7 646 ⟶ 7 319 :
} -- versions.i18n.de
versions.i18n.en = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Main string, errors and categories of tools
versions_module_with_error_err = "Module with error",
Ligne 7 677 ⟶ 7 348 :
versions_module_miss_i18n_none_err = "OK, none missing translations.",
versions_module_miss_i18n_trad_err = "Internal Error: Module missing i18n translation for the argument <b>i18n.%1.%2</b>.",
versions_err_module_miss_i18n_cat = "Module missing i18n translation",
versions_err_module_miss_i18n_cat = "Module with internal error",
versions_module_miss_i18n_mini_err = "Error: I18n table has only <b>1%</b> translations.",
Ligne 7 698 ⟶ 7 370 :
} -- versions.i18n.en
versions.i18n.es = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Textos principales, errores y categorías de instrumentos
versions_module_with_error_err = "Módulo con error",
Ligne 7 754 ⟶ 7 424 :
} -- versions.i18n.es
versions.i18n.fr = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Principaux textes, erreurs et catégories des outils
versions_module_with_error_err = "Module avec erreur",
Ligne 7 810 ⟶ 7 478 :
} -- versions.i18n.fr
versions.i18n.hu = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Fő szövegek, hibák és szerszámkategóriák
versions_module_with_error_err = "A modul hibás",
Ligne 7 866 ⟶ 7 532 :
} -- versions.i18n.hu
versions.i18n.vi = {
["docfunc"] = "docfunc",
["dockey"] = "dockey",
-- Các văn bản, lỗi và danh mục chính của công cụ
versions_module_with_error_err = "Mô-đun có lỗi",
Ligne 7 991 ⟶ 7 655 :
headers = " insub; sub; sought; known; errors ",
headers_class = "wikitable alternative center sortable",
-- rowGrouptrack_on = {}true,
-- track_on == "details",
}
--
Ligne 8 202 ⟶ 7 865 :
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.",
["boxviews"] = "The <b>boxviews</b> library easy formats boxes based on css options",
["datas"] = "The <b>datas</b> library formats some viewers for tables(in lines and columns), luatables...",
["drop_box"] = "The <b>drop_box</b> library formats Drop-boxes as objects, inside the viewers library",
Ligne 8 398 ⟶ 8 060 :
end
 
function versions.setup_central_libraries(bindable_libraries, opt) -- FAMLTVQDR 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 410 ⟶ 8 072 :
args = central_library.new("args", args) -- Lock in _G and package.loaded
table.insert(sorted_bind_libraries, args) -- Record all libraries
boxviews = central_library.new("boxviews", boxviews) -- Lock in _G and package.loaded
table.insert(sorted_bind_libraries, boxviews) -- Record all libraries
central_library = central_library.new("central_library", central_library) -- Lock in _G and package.loaded
table.insert(sorted_bind_libraries, central_library) -- Record all libraries
Ligne 8 478 ⟶ 8 138 :
 
-- - - - ------------------ - - - - ------------------ - - - - -----------------------------
-- TacticGuideline for modules, arguments, options and default values 20180908.
-- In all cases the main module protects all original tables, including for itself.
-- Permit modules without versions for many existing modules. Modules are also simply tables for data-modules or PageData in Json.
Ligne 8 536 ⟶ 8 196 :
local result_cases = result_cases or versions.args_changes or {}
local tests_cases = {
["birthyear"] = { ["typ"] = "dat", ["need"] = "noevent"0, ["keyword"] = "birthyear", ["prop"] = "P569", ["format"] = "year", },
["deathyear"] = { ["typ"] = "dat", ["need"] = "noevent"0, ["keyword"] = "deathyear", ["prop"] = "P570", ["format"] = "year", },
["lastname"] = { ["typ"] = "dat", ["need"] = "noevent"0, ["keyword"] = "lastname", ["prop"] = "P734", },
["firstname"] = { ["typ"] = "dat", ["need"] = "noevent"0, ["keyword"] = "firstname", ["prop"] = "P735", },
}
local tab_view = { -- Group datas and options for a table view with lines and columns.
Ligne 8 548 ⟶ 8 208 :
headers = "module; arg; change; results; errors", -- "OK or error/s"
rowGroup = {},
-- ccc = {}, -- to remember
-- track_on == "details",
}
-- Runs tests cases and formats a table view with lines and columns.s
Ligne 8 643 ⟶ 8 303 :
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 675 ⟶ 8 333 :
return res
end -- function versions.tasks_changes_report(t)
 
function modes.get_one_arg(known_arguments, keyword) -- Gets versatile adaptations for one argument
local memo = viewers.save_configs("modes.get_default_args") -- Save global configuration before eventual changes.
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments = { }
local get_keyword = tostring(keyword) -- Select the argument to use
local one_argument = {} -- To capture the argument to use
-- ["QITEM"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "QITEM", ["prop"] = "QITEM", ["prop_default"] = "Q307", },
-- keep Galilée (Q307), avoid Victor Hugo (Q535), Rudyard Kipling (Q34743),
-- 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)
-- ["QITEM"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "QITEM", ["prop"] = "QITEM", prop_default = "Q34743", },
for key, one_arg in pairs(known_arguments) do -- DODO
if type(one_arg) == "table" then -- Checks for abnormal structure of known_arguments
if one_arg["keyword"] == one_arg[get_keyword] then -- This argument is the one to use
-- Tactic .is_in(
if one_arg["Tactic"] and ( type(one_arg["Tactic"] == "string") ) then -- If the argument need a Tactic
if viewers.is_in_sp(one_arg["prop_default"], one_arg["Tactic"], ";") then -- Which Tactic to use : enforce prop_default value
-- versatile adaptations
if type(one_arg.default_item == "string") then datas.prop_default = one_arg.default_item end -- versatile for datas like "Q34743" -- Rudyard Kipling **
-- use one_arg["prop_default"]-- DODO
-- end
end -- activate_known_arguments
one_argument = one_arg
end
end
end
end
table.sort(arguments, function (a, b) return ( tostring(a.keyword) < tostring(b.keyword) ) end ) -- alphabetic sort of translated arguments
modes.arguments = arguments
viewers.restore_configs(memo, "modes.get_default_args") -- Restore global configurations after eventual changes.
return arguments, counts, tt -- With one_arg.val and one_arg.src
end -- local arguments = modes.get_default_args(known_arguments) -- Gets default arguments values
 
-- function versions.init(frame, mode_name, known_arguments, options_for_modes, QITEM)
function versions.init(frame, Central_version, mode_name, known_arguments, options_for_modes, QITEM) -- FAMLTVQDR
-- Initializes translations, bind_libraries, bind_sub_modules, get arguments, modes, options.
-- Imports arguments from wikidata, module and template with increasing priorities.
Ligne 8 694 ⟶ 8 384 :
ARGS.add(ARGS, 1, "versions.init before import_arguments") -- ARGS.t
-- res = res .. langs.init_content_page_user_lang() -- content_lang, page_lang, user_lang, "versions.init")
local mix = modes.init_args_mode_options(mix, mode_name, args_template) -- Import and mix args mode and options -- S170710mix
-- ["QITEM"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "QITEM", ["prop"] = "QITEM", prop_default = "Q34743", },
-- like function modes.get_default_args(known_arguments) -- Gets default arguments values
local mix = mix or {}
modes.mix = mix -- To easy get, track and test the init_args_mode_options process
modes.mix = modes.init_args_mode_options(mix, mode_name, args_template) -- Before known_arguments : Import and mix args mode and options
local mix = modes.init_args_mode_options(mix, mode_name, args_template) -- S170703amo MAMO.t
-- ["QITEM"] = { ["typ"] = "dat", ["need"] = "noevent", ["keyword"] = "QITEM", ["prop"] = "QITEM", prop_default = "Q34743", },
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {}
for key, one_arg in pairs(known_arguments) do
local argskwn = known_arguments[key]
if type(one_arg) == "table" then
if type(one_arg.default_item == "string") then datas.prop_default = one_arg.default_item end -- "Q34743" -- Rudyard Kipling **
end
end
modes.mix = modes.init_args_mode_options(mix, mode_name, args_template) -- And after known_arguments : Import and mix args mode and options
-- res = res .. langs.init_content_page_user_lang() -- content_lang, page_lang, user_lang, "versions.init")
langs.main_i18n_complete = true -- Unmask all views after enough init.
Ligne 8 772 ⟶ 8 457 :
headers = "versions_versions_management_headers", -- "sought; versions; process; comments",
headers_class = "wikitable alternative center sortable",
-- rowGrouptrack_on = {}true,
-- track_on == "details",
}
function tab_view.form_one_case(vers_test) -- Convert a case from test_group to rowGroup.
Ligne 9 197 ⟶ 8 881 :
 
-- cut_libraries
 
 
-- - - - ------------------ - - - - ---------------------------------
-- - - - ------------------ - - - - ---------------------------------
-- The Library:viewers supports Lua-coders sub-tasks and inter-wikis central modules.
-- - - - ------------------ - - - - ---------------------------------
-- - - - ------------------ - - - - ---------------------------------
 
 
-- These Module:Centralizer/I18N translations for viewers library update and complete Module:Centralizer translations.
Ligne 9 212 ⟶ 8 904 :
-- Ne pas traduire ces noms de bibliothèques
viewers_section_title_library_activity = "Library:activity",
viewers_section_title_library_boxviews = "Library:boxviews",
viewers_section_title_library_datas = "Library:datas",
viewers_section_title_library_langs = "Library:langs",
Ligne 9 248 ⟶ 8 939 :
-- Übersetzen Sie diese Bibliotheken nicht
viewers_section_title_library_activity = "Library:activity",
viewers_section_title_library_boxviews = "Library:boxviews",
viewers_section_title_library_datas = "Library:datas",
viewers_section_title_library_langs = "Library:langs",
Ligne 9 284 ⟶ 8 974 :
-- Do not ranslate these libraries names
viewers_section_title_library_activity = "Library:activity",
viewers_section_title_library_boxviews = "Library:boxviews",
viewers_section_title_library_datas = "Library:datas",
viewers_section_title_library_langs = "Library:langs",
Ligne 9 318 ⟶ 9 007 :
-- No traduzca estos nombres de bibliotecas
viewers_section_title_library_activity = "Library:activity",
viewers_section_title_library_boxviews = "Library:boxviews",
viewers_section_title_library_datas = "Library:datas",
viewers_section_title_library_langs = "Library:langs",
Ligne 9 354 ⟶ 9 042 :
-- Ne pas traduire ces noms de bibliothèques
viewers_section_title_library_activity = "Library:activity",
viewers_section_title_library_boxviews = "Library:boxviews",
viewers_section_title_library_datas = "Library:datas",
viewers_section_title_library_langs = "Library:langs",
Ligne 9 390 ⟶ 9 077 :
-- Ne fordítsa le ezeket a könyvtárak nevét
viewers_section_title_library_activity = "Library:activity",
viewers_section_title_library_boxviews = "Library:boxviews",
viewers_section_title_library_datas = "Library:datas",
viewers_section_title_library_langs = "Library:langs",
Ligne 9 426 ⟶ 9 112 :
-- Không dịch các tên thư viện này
viewers_section_title_library_activity = "Library:activity",
viewers_section_title_library_boxviews = "Library:boxviews",
viewers_section_title_library_datas = "Library:datas",
viewers_section_title_library_langs = "Library:langs",
Ligne 9 488 ⟶ 9 173 :
function viewers.phab_task(task, comment) -- Forms a link to a Phabricator task.
local t = "" -- example: "[[phab:T135845|T135845 Convert]]"
if ( type(task) ~= "string" ) then task = "" end
if ( type(comment) ~= "string" ) then comment = "" end
-- The task id is a string with "T" and a number. We check this syntax:
if ( type(task) == "string" ) and ( string.find("T", "%s", 1, true) == 1 ) and tonumber( string.sub( s, 2, -1 ) ) then task = task else task = "T000" end
t = "[[phab:" .. task .. "|" .. task .. " " .. comment .. "]]"
return t -- replace anywhere : "[[phab:" by "viewers.phab_task(task, comment)" then update all
end -- t = t .. ;viewers.phab_task(task, comment) -- Forms a link to a Phabricator task.
Ligne 9 642 ⟶ 9 326 :
end -- function viewers.date_to_part(date, part)
 
function viewers.boxviews.form(txt, css) -- Make an easy box builder based on css options -- S170723vbv
-- 20170807 restructure this for a table of box elements s[n]bg, s[n]fs, s[n]tc. S170906tbe
-- 20170807 restructure this in a hierarchic structure of objects able to build a box, a table, a circular or a spiral graph.
-- 20170807 restructure example : table4 = tab.cols[2].style -- style of the column 2 of the table4.
-- 20170807 restructure example : box7 = box.row[3].cols[1].spir[11].curv[2].style S170910ssb
-- style of the curve 2 of 11th petal of the flower in the column 1 of the row 3 of the box7. S170910ssb
local t = "" -- see ta1
local txt = tostring(txt)
-- local css = mw.clone(css)
if type(css) ~= "table" then css = {} end -- css is a table of options
local actual_options = mw.clone(drop_box.css_options) -- protect Conventional css parameters :
-- See -- https://en.wikisource.org/wiki/Template:drop_box#Parameters
local dropit = drop_options or {} -- protect Conventional css parameters : See -- https://en.wikisource.org/wiki/Template:drop_box#Parameters
if (type(dropit) == "table") then
for key, val in pairs(dropit) do
actual_options[key] = val
end
end
if (type(dropit) == "table") then
for key, val in pairs(dropit) do
actual_options[key] = val
txt = string.gsub(txt, "<"..key..">", val)
end
end
return t, css
end
 
function viewers.boxview_test(t) -- Tests: Make an easy box builder -- S170723vbv
local t = "\n* viewers.boxview_test(): TO DO LATER ... Tests: Make an easy box builder "
-- if 1 then return t end
local css = drop_box.css_options
-- bg1 = "#FFFFFF", -- bg1 : the background-color for the heading
-- fs1 = "100%", -- font-size: 100%;
-- fw1 = "left", -- fw1 : the font-weight for the heading
-- ta1 = "left", -- ta1 : the text-align for the heading
-- tc1 = "black", -- tc1 : the text-color for the heading
-- local css = mw.clone(css)
local titl = mw.clone(css) ; titl.ta1 = "center" ; titl.headType = "h2"
local descr = mw.clone(css) ; descr.ta2 = "left"
local imgcss = mw.clone(css) ; imgcss.border_radius = "3px 3px 3px 3px" ; imgcss.margin_all = "5px"
local link1 = mw.clone(css) ; link1.ta1 = "left" ; link1.ta1 = "left" ; link1.ta1 = "left"
local linkdatas = mw.clone(css) ; linkdatas.ta1 = "left" ; linkdatas.ta1 = "left" ; linkdatas.ta1 = "left"
local links = mw.clone(css) ; links.ta1 = "" ; links.ta1 = "" ; links.ta1 = ""
local boxcss = mw.clone(css) ; links.ta1 = "" ; links.ta1 = "" ; links.ta1 = ""
if type(css2) ~= "table" then css2 = {} end -- css is a table of options
local t = t .. "\n* viewers.boxview_test(): "
local txt = "\n* viewers.boxview_test(): headType=<b><headType></b>, ta1=<b><ta1></b>, ta2=<b><ta2></b>, imgcss=<b><imgcss></b> "
-- if 1 then return t .. txt end
local txt = viewers.boxviews.form(txt, titl)
local txt = viewers.boxviews.form(txt, descr)
local txt = viewers.boxviews.form(txt, link1)
local txt = viewers.boxviews.form(txt, imgcss)
if 1 then return t .. txt end
local box_link2 = viewers.boxviews.form(txt, link2)
local box_link3 = viewers.boxviews.form(txt, link3)
local box_link4 = viewers.boxviews.form(txt, link4)
local box_links = viewers.boxviews.form(box_link1 .. box_link2 .. box_link3 .. box_link4, links)
local box_img = viewers.boxviews.form("Flag_of_France.svg", imgcss)
local box_content = box_links .. box_title .. box_img
local box_test = viewers.boxviews.form(box_content, boxcss)
return t .. txt
end -- function viewers.boxview_test(txt, css)
 
function mw.text.sortCommaList(list, sep1, sep2, sep3) -- Sort without repeat a list with separators like "Central01;versions 2.4;tools;two words"
Ligne 9 753 ⟶ 9 375 :
return output -- .. t
end -- function viewers.simple_list(list, sep1, sep2, sep3)
 
function viewers.simple_list_test(t) -- Formats whole the result for users and MediaWiki tests cases. S170801rtc
local memo = viewers.save_configs("viewers.simple_list_test") -- Save global configuration before eventual changes.
t = t or "\n* viewers.simple_list_test(t) Formats whole the result for users and MediaWiki tests cases."
local t, tt = t or "\n* viewers.simple_list_test(t) Tests: Formats whole the result for users and MediaWiki tests cases.", "-"
local tt, errors = tests_groups.errors_init(tests_groups.allstatus)
t = t .. "\n* ".. (tt or "*tt*")
tests_groups.gettestsgroups_recursive_limit = 11 -- To protect against unsought loops in recursive testsGroups.
tests_groups.main_groupname = "mathroman.testsGroups"
tests_groups.main_groupname = "tests_groups.main_tests_groups"
local kept_groups, tt = tests_groups.gettestsgroups(tests_groups.main_groupname) -- Get groups of tests cases for MW and users.
tests_groups.kept_groups = kept_groups
t = t .. "\n* ".. (tt or "-tt-")
local result_cases = {}
local result_cases = tests_groups.getcases(kept_groups) -- Run testcases for MediaWiki.
tests_groups.result_cases = result_cases
local mw_cases, tt = tests_groups.getTestProvider(result_cases, n)
t = t .. "\n* :tests_groups.autotests_group"
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = tests_groups.autotests_group, -- tests_groups.autotests_group = { -- events.test_group
tests_title = "tests_groups_getTestProvider_tests_title", -- Implement getTestProvider in central modules
headers = "tests_groups_testcase_tests_headers", -- "Digital number; Roman value; Correct; Error(s)"
headers = "case.name; args{}; expect{}; result{}; errors in result{} from expect{}", -- OK or error/s
keys = "name;args;expect;result;errors",
rowGroup = {},
-- track_on == "details",
}
-- Runs tests cases and formats a table view with lines and columns.s
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
case = tests_groups.run_one_case(case) -- Run one case for users and MediaWiki tests cases.getTestProvider_tests
case.res1 = case.result[1] or "res1" -- DEBUG : mathroman.int2roman() can fail without blocking page.
case.err2 = case.result[case.errorsKey] or "err2" -- DEBUG : mathroman.int2roman() can fail without blocking page.
case.errors = case.errors or status.OK
case.errors = viewers.ta("case.res1", case.res1) .. viewers.ta("case.err2", case.err2) .. viewers.ta("case.errors", case.errors)
-- headers = "case.name; args{}; expect{}; result{}; errors in result{} from expect{}", -- OK or error/s
return { case.name, lua_table.rough_view(case.args), lua_table.rough_view(case.expect), lua_table.rough_view(case.result), case.errors }
end -- errors in result
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
t = t .. "\n* :tests_groups.autotests_group end"
-- Counts of selected and sorted sub-tasks: , #test_group = 43 , #rowGroup = 0
t = t .. "\n* :viewers.simple_list_test(txt) end"
viewers.restore_configs(memo, "viewers.simple_list_test") -- Restore global configurations after eventual changes.
return t
end -- t = t .. viewers.simple_list_test(t)
 
function viewers.simple_list_test(t) -- Test of : Sort without repeat a list with separators like "Central01;versions 2.4;tools;two words"
local memo = viewers.save_configs("viewers.simple_list_test") -- Save global configuration before eventual changes.
local t = t or ""
t = t .. "\n* Test <b>viewers.simple_list(list, sep1, sep2, sep3)</b>: "
t = t .. '\n* Remove repeats in a string list with separators. Can also sort.'
local function simpleList_test1(t, input, sep1, sep2, sep3, sep4)
local output = tostring( viewers.simple_list(input, sep1, sep2, sep3, sep4) )
t = t .. viewers.table_row() .. viewers.table_dat(viewers.value(input)) .. viewers.table_dat(viewers.value(sep1)) .. viewers.table_dat(viewers.value(sep2))
t = t .. viewers.table_dat(viewers.value(sep3)) .. viewers.table_dat(viewers.value(sep4)) .. viewers.table_dat(viewers.value(output))
return t
end
t = t .. viewers.table_head() .. viewers.table_col("input") .. viewers.table_col("sep1") .. viewers.table_col("sep2") .. viewers.table_col("sep3") .. viewers.table_col("sep4") .. viewers.table_col("output")
t = simpleList_test1(t, "abc;def;abc", ";", "-", "|")
t = simpleList_test1(t, "xyz;def;abc", ";", "sort")
t = simpleList_test1(t, "abc-def=abc", "-", "=")
t = simpleList_test1(t, "abc - def = abc", "-", "=", "sort")
t = simpleList_test1(t, "abc - def = abc", "-", "=", "sort", "trim")
t = simpleList_test1(t, ";;", ";", ";", ",")
t = simpleList_test1(t, "abc/def;abc", ";", "/")
t = simpleList_test1(t, "abc;def/abc/def;abc;def;abc", ";", "/", "-")
t = simpleList_test1(t, "abc;def;abc", ";", ";", "")
t = t .. viewers.table_end()
viewers.restore_configs(memo, "viewers.simple_list_test") -- Restore global configurations after eventual changes.
return t
end -- viewers.simple_list_test(t)
-- for _test1 search also _test1 simpleList_test1 date_to_part_test1
 
function viewers.form_one_case(case) -- Convert a case from test_group to rowGroup.
case = tests_groups.run_one_case(case) -- Run one case for users and MediaWiki tests cases.getTestProvider_tests
case.res1 = case.result[1] or "res1" -- DEBUG : mathroman.int2roman() can fail without blocking page.
case.err2 = case.result[case.errorsKey] or "err2" -- DEBUG : mathroman.int2roman() can fail without blocking page.
Ligne 9 906 ⟶ 9 456 :
end
end
t = string.gsub(t, p.version.versionName, langs.Central_version or Central.Central_version_nameCentral_version or "versionName")
return t
end -- function viewers.trans9vars(translations, key, ...)
Ligne 9 918 ⟶ 9 468 :
end
 
function viewers.form9en(ref, ...) -- Replace %1 to %9 by arguments. Always in english for tests_groups.
if not langs.main_i18n_complete then return "" end -- Avoid to fail in init phase.
local t, n = "", 0
Ligne 10 002 ⟶ 9 552 :
-- 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 075 ⟶ 9 624 :
-- headers_class = "wikitable alternative center sortable",
rowGroup = {},
-- track_on == "details"true,
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 10 101 ⟶ 9 650 :
end
 
function viewers.doc_section(selector, section, style, mask_sections) -- Formats the titleBegin of asection groupin of drop_boxviewers.newdoc_page(), typicaly for each libraryviewers.doc_module()... -- To bypass a persistent bug
local rest = ""
local selector, section, style, mask_sections = selector, section, style, mask_sections
local localsectionsection = viewers.form9user(section) -- like viewers_section_title_page or viewers_section_title_internal function viewers.form9user(
if mask_sections then return rest end
if selector == "never" then return rest end
local select = (selector == true) or (selector == title) or viewers.is_in_sp(selector, "allwaysview alltestsview enforcerun failinref nocontent")
if not select then style = "h3" end
if type(style) ~= "string" then style = "h3" end
local n = tonumber( string.sub(style, 2, 2) )
-- viewers_section_title_page = "Tests of this page",
style = "" ; for i = 1, n do style = style .. "=" end
-- viewers_section_title_module = "Tests of this module",
t = t .. "\n" .. style .. section .. " " .. style .. "\n" -- style OK
-- viewers_section_title_internal = "Internal tests",
-- t = t .. "\n* ModuleCentralizer only tests sections doc_section"
if localsection == "viewers_section_title_page" then localsection = "Tests of this page" end -- To bypass a persistent bug
return t
if localsection == "viewers_section_title_module" then localsection = "Tests of this module" end -- To bypass a persistent bug
end -- res = res .. viewers.doc_section(selector, "viewers_section_title_page", "h2", mask_sections) -- example
if localsection == "viewers_section_title_internal" then localsection = "Internal tests" end -- To bypass a persistent bug
res = res .. "<b>" .. viewers.styles_color_normal(localsection) .. "</b>"
return res
end -- if not mask_sections then res = res .. viewers.doc_section(selector, "viewers_section_title_module", "h2") end -- typical use
 
function drop_box.dh( opt )
Ligne 10 125 ⟶ 9 670 :
return val
end
dh = drop_box.dh
 
function drop_box.html(title, content_or_func) -- Builds the drop box at the html level.
Ligne 10 228 ⟶ 9 774 :
end
end
local dropbox_title = 'Drop-down- box'drop_box --from https://fr.wikisource.org/wiki/Modèle:Boîte déroulante for= drop_box from template on 20180505 OK.form
-- p_template_drop_box_name = 'Boîte déroulante', -- 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
--[ [
-- local dropbox_title = viewers.form9content("p_template_drop_box_name")
t = t .. mw.getCurrentFrame():expandTemplate{ title = dropbox_title, args = {
["label"] = d.label, ["titre"] = d.title, ["contenu"] = d.content,
Ligne 10 247 ⟶ 9 795 :
 
function drop_box.new(selector, title, content_or_func, ...) -- Formats a drop_box for a doc or a group of tests. Take apart dropit options.
-- From 20180503 a bug (in Module:Centralizer or MediaWiki) some Dropboxes display twice : modes.get_args_reportactivate_known_arguments_report.
-- From 20180503 a bug (in Module:Centralizer or MediaWiki) See CentralManual display twice : modes.get_args_reportactivate_known_arguments_report.xml
-- selector = "allwaysview" -- To allways display one view. -- selector = "enforcerun" -- To debug one box with INTERNAL ERROR.
local memo = viewers.save_configs("drop_box.new") -- Save global configuration before eventual changes.
Ligne 10 458 ⟶ 10 006 :
t = t .. viewers.table_row()
for col, val in ipairs(columns_i) do
t = t .. viewers.table_dat(val or tostring(val) or "-") -- each value in columns of row_i
end
end
Ligne 10 469 ⟶ 10 017 :
 
function tableview.new(tab_view) -- Formats a table with lines and columns. S170610tvf
local memo = viewers.save_configs("tableview.newform_whole_view") -- Save global configuration before eventual changes.
if type(tab_view) ~= "table" then tab_view = {} end -- tab_view must be a table
tab_view.t = (tab_view.t or "") .. viewers.ta("tableView: ", "start")
Ligne 10 480 ⟶ 10 028 :
if tab_view.track_on then t = t .. tab_view.t end
-- Counts of selected and sorted sub-tasks: , #test_group = 43 , #rowGroup = 0
viewers.restore_configs(memo, "tableview.newform_whole_view") -- Restore global configurations after eventual changes.
return t, err, tab_view
end -- t, err, tab_view = function tableview.new(tab_view)
Ligne 10 489 ⟶ 10 037 :
res = res .. drop_box.new(selector, "datas.available_props_report(t) Reports availables datas properties **", datas.available_props_report)
-- res = res .. drop_box.new(selector, "modes_known_arguments_report_title", modes.known_arguments_report)
res = res .. drop_box.new(selector, "modes_get_args_report_title", modes.get_args_reportactivate_known_arguments_report)
res = res .. drop_box.new(selector, "modes_used_options_list_title", modes.used_options_list )
res = res .. drop_box.new(selector, "modes_list_all_args_main_title", modes.list_all_args_main)
Ligne 10 501 ⟶ 10 049 :
function viewers.doc_module(selector, mask_sections) -- Formats some Dropboxes of tests to document a module.
local res = ""
if not mask_sections then res = res .. viewers.doc_section(selector, "viewers_section_title_module", "h2") end -- function viewers.doc_section(selector,
res = res .. drop_box.new(selector, "p.Init_central_module_tests_title **", p.Init_central_module_tests) -- doc link
res = res .. drop_box.new(selector, "modes_args_unknown_report_title", modes.args_unknown_report)
res = res .. drop_box.new(selector, "versions_support_desk_title", versions.form_support_desk_report)
Ligne 10 520 ⟶ 10 069 :
res = res .. drop_box.new(selector, "activity_MW_Versions_report_title", activity.MW_Versions_report)
res = res .. drop_box.new(selector, "activity_central_functions_report_title", activity.central_functions_report)
res = res .. drop_box.new(selector, "activity_check_html_bold_tags_title", activity.check_html_bold_tags)
-- if 1 then return res end -- try to find : {{Centralizer|tests|itemid=Q535}} Erreur Lua : not enough memory
-- activity_check_html_bold_tags_title = "activity.check_html_bold_tags() Report imbalances of beginnings and ends of bold in code.",
--
if not mask_sections then res = res .. viewers.doc_section(selector, "Library:datas", "h3") end -- .get_item(
res = res .. drop_box.new(selector, "datas_get_item_report_titledatas.get_item() Report datas from mw.wikibase **", datas.get_item_report)
-- res = res .. drop_box.new(selector, "datas_update_Special_PageData_title", datas.update_PageData)
--
-- if not mask_sections then res = res .. viewers.doc_section(selector, "Library:events", "h3") end
-- resfunction = res .. drop_boxevents.new(selector, "modes.get_args_datasall_kinds_test(t) -- Test: all eventskinds (err,of wng, cat) **", modes.get_args_datas) -- Test: oneventevents (err, wng, cat)
-- res = res .. drop_box.new(selector, "events_all_kinds_tests_title", events.all_kinds_test) -- 5 empty rows
-- res = res .. drop_box.new(selector, "langs_selectLang_tests_title", langs.select_lang_test) -- lang %1 %2 %3
--
if not mask_sections then res = res .. viewers.doc_section(selector, "Library:langs", "h3") end
-- res = res .. drop_box.new(selector, "langs_selectLang_tests_title", langs.select_lang_test) -- lang %1 %2 %3
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 561 ⟶ 10 108 :
if not mask_sections then res = res .. viewers.doc_section(selector, "Library:modes", "h3") end -- function viewers.doc_section(
-- if not mask_sections then res = res .. viewers.doc_section(selector, "viewers_section_title_library_modes", "h3") end
-- res = res .. drop_box.new(selector, "modesdatas.get_item() InitReport Framedatas Argsfrom Mode Librariesmw.wikibase **", pdatas.Init_central_module_testsget_item_report)
res = res .. drop_box.new(selector, "modes_get_args_datas_tests_titlemodes_known_arguments_report_title", modes.get_args_datas_testsknown_arguments_report)
res = res .. drop_box.new(selector, "modes_Init_args_datas_tests_title p.teststests **modes_get_args_report_title", modes.Init_mode_args_datas_testsactivate_known_arguments_report)
-- end -- t = t .. modes.get_args_datas(t)
-- res = res .. drop_box.new(selector, "modes_known_arguments_report_title", modes.known_arguments_report)
res = res .. drop_box.new(selector, "modes_get_args_report_title", modes.get_args_report)
res = res .. drop_box.new(selector, "modes_used_options_list_title", modes.used_options_list)
-- res = res .. drop_box.new(selector, "modes.bind_known_arguments_one_lib_report(t) Report the binding of one library known args. **", modes.bind_known_arguments_one_lib_report)
Ligne 10 573 ⟶ 10 117 :
-- res = res .. drop_box.new(selector, "versions_bind_arguments_tests_title", versions.bind_arguments_tests)
res = res .. drop_box.new(selector, "modes_options_uses_tests_title", modes.options_from_mode_tests)
-- res = res .. drop_box.new(selector, "modes_options_uses_tests_title", modes.options_from_mode_tests,
-- d.bg1="yellow", d.border_color="red", d.border_radius="10px 10px 10px 10px", image="Sanscrit dha.svg", } ) -- , cssview=true
-- arguments list
-- res = res .. drop_box.new(selector, "modes_all_categories_list_title", modes.all_categories_list) -- n = 0
Ligne 10 578 ⟶ 10 124 :
-- arguments support
-- res = res .. drop_box.new(selector, "modes_multiple_selection_tests_title", modes.multiple_selection_tests)
res = res .. drop_box.new(selector"never", "modes_multiple_values_tests_title", modes.multiple_values_tests)
res = res .. drop_box.new(selector, "modes_levenshtein_similar_tests_title", modes.levenshtein_similar_tests)
res = res .. drop_box.new(selector, "modes_namespaces_page_list_title", modes.namespaces_page_list)
res = res .. drop_box.new(selector, "modes_recursive_normal_tests_title", modes.recursive_normal_tests) -- only errors
-- res = res .. drop_box.new(selector, "modes_recursive_normal_tests_title", modes.recursive_normal_tests) -- only errors
-- res = res .. drop_box.new(selector, "modes_namespaces_page_list_title", modes.recursive_normal_tests) -- only errors
-- function tab_view.form_one_case)
-- "enforcerun"
-- res = res .. viewers.doc_section(selector, "Library:tests_groups", "h3") -- S170801rtc todo
-- res = res .. drop_box.new(selector, "tests_groups_recursive_tests_title", tests_groups.recursive_tests (t)
-- res = res .. drop_box.new(selector, "tests_groups_getTestProvider_title", viewers.simple_list_test )
--
if not mask_sections then res = res .. viewers.doc_section(selector, "Library:versions", "h3") end
-- if not mask_sections then res = res .. viewers.doc_section(selector, "viewers_section_title_library_versions", "h3") end
Ligne 10 593 ⟶ 10 138 :
res = res .. drop_box.new(selector, "versions_all_G_and_loaded_list_title", versions.all_G_and_loaded_list)
-- res = res .. drop_box.new(selector, "versions_central_changes_title", versions.central_changes) --RIC mw.loadData(
-- res = res .. drop_box.new(selector, "versions_deprecated_function_tests", viewers.simple_list_test)
-- res = res .. drop_box.new(selector, "versions_bind_modules_tests_title", versions.bind_modules_test )
res = res .. drop_box.new(selector, "versions_sort_central_modules_title", versions.sort_central_modules_report ) -- S170606cmr
Ligne 10 604 ⟶ 10 148 :
res = res .. drop_box.new(selector, "langs_form99user_tests_title", viewers.form99user_test )
res = res .. drop_box.new(selector, "viewers_parts_of_date_tests_title", viewers.parts_of_date_tests)
res = res .. drop_box.new(selector, "viewers_simpleList_tests_title", viewers.simple_list_test )
-- res = res .. drop_box.new(selector, "viewers.boxviews.form() Tests: Make an easy box builder **", viewers.boxview_test) -- S170723vbv
res = res .. drop_box.new("never", "viewers_table_tab_options_title", viewers.table_test )
res = res .. drop_box.new(selector, "viewers_save_restore_balance_title", viewers.save_restore_balance_report) -- to_debug_on_20170507
Ligne 10 653 ⟶ 10 195 :
 
p.options_for_modes = { -- module options_for_modes
["read"] = " box1 catview ",
["doc"] = " nobox1 noerr nocatview ",
["edit"] = " box1 catview docdef docline docsrc docdata docview : ",
["tests"] = " box1 catview docdef docline docsrc docdata docview : tests ",
}
function p.box_read(prop, title) -- Draw the main box one. -- ric (p.box_read)
-- 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)
datas.QITEM = mw.wikibase.getEntityIdForCurrentPage() -- use props.QITEM Returns the Item id as string, like "Q42"
local QITEM = datas.QITEM or datas.default_item or "Q307" -- Keep Galilée (Q307)
datas.prop, datas.props = datas.get_item(modes.known_arguments, QITEM) -- Get datas from mw.wikibase for the page.
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang()
local prop = datas.prop
local res = "(p.box_read) "
local flag = viewers.form_image("Flag_of_England.svg", 50)
-- local flag = viewers.form_image(viewers.form9user("flag_of_country"), 50)
-- known_arguments_country = "England", -- English
-- known_arguments_flag = "Flag_of_England.svg", -- English
-- known_arguments_monument = "St_Pauls_aerial_%28cropped%29.jpg", -- English St Paul's Cathedral
-- known_arguments_town = "London", -- English
local image = viewers.form_image(prop.image, 50)
local birthyear_deathyear = " ( " .. (prop.birthyear or "birthyear") .. " - " .. (prop.deathyear or "deathyear") .. " ) "
local phabtask = " - [[d:" .. QITEM .. "|Datas]] "
res = res .. "<br/><center><b>firstname: " .. (prop.firstname or "firstname") .. "</b>, "
res = res .. "<b>sitelink: " .. prop.sitelink .. phabtask .. "</b></center>"
res = res .. "<br/><center>Labels in langs: <b>" .. prop.labelbylang .. "</b>, user: <b>" .. prop.labeluser .. "</b>, content: <b>" .. prop.labelcontent .. "</b>, page: <b>" .. prop.labelpage .. "</b>"
res = res .. "<br/><center><b>description: " .. prop.description .. birthyear_deathyear .. "</b></center>"
res = res .. " <br/><center>" .. flag .. " * used languages: user:<b>" .. langs.user_lang .. "</b>, content:<b>" .. langs.content_lang .. "</b>, page:<b>" .. langs.page_lang .. "</b> * " .. image .. "</center>"
-- res = res .. "<br/><center>languages:<b>" .. langs.main_i18n_languages_list() -- List available translations languages
res = '<div style="border-radius:0.7em; margin-right:5px; box-shadow:0.2em 0.3em 0.2em #B7B7B7; background-color:#F1F1DE; padding:0.3em; width=90%; overflow-x:hidden; ">' .. res .. '</div>'
return res
end -- function p.box_read(known_arguments, title)
 
-- Display the documentation in an infobox, similar to edit-boxs
function viewers.doc_group(selector, mask_sections) -- Formats all results of this module and its sub-modules.
-- Affichage de documentation dans un cadre (box), semblable aux boites d'edition
local res = ""
function p.box_edit(known_arguments)
res = res .. viewers.doc_page(selector, mask_sections) -- included in viewers.doc_group -- mask for time limit
-- read = " box1 ",
res = res .. viewers.doc_module(selector, mask_sections) -- included in viewers.doc_group -- mask for time limit
-- edit = " box1 docdef docline docsrc docdata catview docview : ",
res = res .. viewers.doc_internal(selector, mask_sections) -- included in viewers.doc_group -- mask for time limit
-- doc = " nobox1 noerr nocatview ",
res = res .. versions.running_times(false, "") -- always wiew in tests
-- tests = " box1 docdef docline docsrc docdata catview docview : tests ",
local res, props = "", datas.props
if type(known_arguments) ~= "table" then known_arguments = modes.known_arguments end -- optional arguments
langs.init_content_page_user_lang(modes.args_source.contentlang, modes.args_source.pagelang, modes.args_source.userlang)
-- res = res .. "<center><small>" .. viewers.discreet_main_version() .. viewers.ta("contentlang", langs.content_lang) .. viewers.ta("pagelang", langs.page_lang) .. viewers.ta("userlang", langs.user_lang)
res = res .. "<center>" .. viewers.discreet_main_version() .. viewers.ta("content", langs.content_lang) .. viewers.ta("page", langs.page_lang) .. viewers.ta("user", langs.user_lang)
res = res .. " - [https://fr.wikisource.org/wiki/MediaWiki:Scribunto/Central_modules_reference_manual User manual]"
res = res .. " - viewers.phab_task('T135845', 'Convert')"
res = res .. " - viewers.phab_task('T198107', 'Begin to use')" .. "</center>"
res = res .. viewers.styles_color_error("<center><b>" .. viewers.form9user("modes_delete_docbox_wng") .. "</b><br/></center>")
res = res .. drop_box.form(drop_box.new_title(), versions.form_support_desk_report() )
if modes.option("debug") then res = res .. "\n*" .. viewers.ta("modes.cat_view", modes.cat_view) .. viewers.ta("modes.template_options", modes.template_options) .. viewers.ta("modes.mode_options", modes.mode_options) end
local lnk = props.QITEM
if modes.option("docdata") then res = res .. "\n*" .. modes.generDoc(" docdef docline ", datas.args_wikidata, datas_link) end
res = res .. ", " .. viewers.form9user(" (%1 properties)", (datas.propss_count_all or "") ) -- datas_structured_data_txt
if modes.option("docview") then res = res .. "\n*" .. modes.generDoc("", known_arguments, "Arguments") end
if not modes.option("noerr")then res = res .. "\n*" .. events.errors_lister() end
local t = "" -- Formats events views
-- local wng, err, cat = events.sort_typ() -- Sort events by type in wng, err, cat.
 
-- if one_event.typ == "wng" then one_event.res = viewers.styles_color_warning(one_event.user_wkt) end
-- if new_one_event then table.insert(events.all_events_group, one_event) end
for key, one_event in pairs(events.all_events_group) do
if one_event.typ == "wng" then
one_event.res, one_event = events.formats(one_event)
if one_event.res then t = t .. "<br>* " .. tostring(one_event.res) end
end
end
--
for key, one_event in pairs(events.all_events_group) do
if one_event.typ == "err" then
one_event.res, one_event = events.formats(one_event)
if one_event.res then t = t .. "<br>* " .. tostring(one_event.res) end
end
end
--
for key, one_event in pairs(events.all_events_group) do
if one_event.typ == "cat" then
one_event.res, one_event = events.formats(one_event)
if one_event.res then t = t .. "<br>* " .. tostring(one_event.res) end
end
end
t = t .. langs.main_i18n_languages_list() -- List available translations languages
res = res .. t
res = '<div style="border-style: solid; border-width: 1px; background-color:#FAFAFA; padding:0.3em; width=90%; overflow-x:hidden; ">' .. res .. '</div>'
-- local result = "\n------ " -- This code interact with drop_box and debug the bug T20151215 2016-11-13 17:57.
-- result = result .. '<div class="CentralDocBox" style=" width=90%; border: 1px solid #AAAAAA; margin:1em; background-color:#F1F1F1; padding:0.3em; ">' .. res .. '</div>'
-- result = result .. "\n* " .. events.categories_lister(":")
return res
end -- function p.box_edit(known_arguments)
end -- res = res .. viewers.doc_group(selector, mask_sections) -- Formats all results of this module and its sub-modules.
 
function p.form_result(known_arguments, main_module) -- Formats all results of this module and its sub-modules.
local res = ""
local memo = viewers.init_configs("p.form_result") -- Initialize global configurations and save them before eventual changes.
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- for A in FAMLTVQDR Arguments definitions at module level p.known_arguments - = {...}
datas.default_item = datas.default_item or "Q34743" -- Rudyard Kipling
datas.default_item = datas.default_item or "Q307" -- Keep Galilée (Q307)
main_module = main_module or versions.main_module
if type(known_arguments) ~= "table" then known_arguments = modes.known_arguments end -- optional arguments
res = res .. viewers.ta("modes.mode_name", modes.mode_name) .. viewers.ta("modes.options", modes.options)
-- if modes.option("box1") then res = (res or "") .. (p.box_read(props) or "") end -- ric (p.box_read)
if modes.option("box1") then res = res .. p.box_read(prop, title) end -- Draw the main box one. -- ric (p.box_read)
if modes.option("box1") or modes.option("catview")
then res = res .. " catview = " .. events.categories_lister(":") end -- Display categories
Ligne 10 682 ⟶ 10 301 :
res = res .. "\n* datas.default_item = <b>" .. datas.default_item .. "</b>, datas.default_name = <b>" .. datas.default_item .. "</b>\n"
res = res .. p.box_edit(modes.known_arguments)
elseif modes.option("read") or (modes.known_arguments.mode == "read") then -- (box_edit)
res = res .. "\n* datas.default_item = <b>" .. datas.default_item .. "</b>, datas.default_name = <b>" .. datas.default_item .. "</b>\n"
res = res .. p.box_read(modes.known_arguments)
Ligne 10 690 ⟶ 10 309 :
if modes.option("tests") then -- or (modes.known_arguments.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 10 854 ⟶ 10 473 :
p.i18n.br = { -- Translations in breton
-- Arguments to import, do not translate. Arguments à importer, ne pas traduire.
["modules_guide"] = { ["typ"] = "ctr", ["need"] = "noevent"0, ["keyword"] = "modules_guide", ["modules_guide_defaultprop_default"] = "Centralizer", },
['p_template_drop_box_name'] = 'Boîte déroulante', -- Modèle:Boîte déroulante for drop_box.form
['c'] = 'c',
Ligne 10 912 ⟶ 10 531 :
p.i18n.en = { -- Translations in English
-- Arguments to import, do not translate.
["modules_guide"] = { ["typ"] = "ctr", ["need"] = "noevent"0, ["keyword"] = "modules_guide", ["modules_guide_defaultprop_default"] = "Centralizer", },
['p_template_drop_box_name'] = 'Drop-downBoîte boxdéroulante', -- Modèle:Boîte déroulante for drop_box.form
['c'] = 'c',
['mode'] = 'mode',
Ligne 10 969 ⟶ 10 588 :
p.i18n.es = { -- Translations in espagnol
-- Importar estos argumentos. No traducir.
["modules_guide"] = { ["typ"] = "ctr", ["need"] = "noevent"0, ["keyword"] = "modules_guide", ["modules_guide_defaultprop_default"] = "Centralizer", },
['p_template_drop_box_name'] = 'CajaBoîte desplegabledéroulante', -- Modèle:Boîte déroulante for drop_box.form
['c'] = 'c',
['mode'] = 'mode',
Ligne 11 027 ⟶ 10 646 :
p.i18n.fr = { -- Translations in français
-- Arguments to import, do not translate. Arguments à importer, ne pas traduire.
["modules_guide"] = { ["typ"] = "ctr", ["need"] = "noevent"0, ["keyword"] = "modules_guide", ["modules_guide_defaultprop_default"] = "Centralizer", },
['p_template_drop_box_name'] = 'Boîte déroulante', -- Modèle:Boîte déroulante for drop_box.form
['c'] = 'c',
Ligne 11 086 ⟶ 10 705 :
p.i18n.vi = {
-- Arguments to import, do not translate. Arguments à importer, ne pas traduire.
["modules_guide"] = { ["typ"] = "ctr", ["need"] = "noevent"0, ["keyword"] = "modules_guide", ["modules_guide_defaultprop_default"] = "Centralizer", },
['p_template_drop_box_name'] = 'HộpBoîte thả xuốngdéroulante', -- Modèle:Boîte déroulante for drop_box.form
['c'] = 'c',
['mode'] = 'mode',
Ligne 11 151 ⟶ 10 770 :
-- - - - ------------------ - - - - ---------------------------------
 
p.known_arguments = { -- Table of the definitions of all known arguments at module level. FAMLTVQDR-- ric (p.box_read)
-- 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.
[1] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = 1, ["syn"] = "mode", ["1_default"] = "read", }, -- for {{Centralizer|doc|... default mode
-- Tactic to integer i18n translations following a list of sub-modules: modules_guide with their own translations.
[2] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = 2, ["syn"] = "dockey"}, -- for {{Centralizer|doc|...
-- Tactic to integer default arguments values: defaults values are always from Centralizer.
[3] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = 3, ["syn"] = "docitem"}, -- for {{Centralizer|doc|...
-- Tactic for default arguments values: each main_module can replace any option of any argument from Centralizer.
-- Guideline to integer i18n translations following a list of sub-modules: modules_guide with their own translations.
-- Tactic for these changes: Centralizer is always protected against any change.
-- Guideline to integer default arguments values: defaults values are always from Centralizer.
-- Guideline for default arguments values: each main_module can replace any option of any argument from Centralizer.
-- Guideline for these changes: Centralizer is always protected against any change.
--
-- Special arguments to modify the fonctions and outputs of this module.
-- Arguments speciaux pour modifier le fonctionnement et les sorties de ce module.
["itemidmodules_guide"] = { ["typ"] = "configctr", ["need"] = 0, ["keyword"] = "itemidmodules_guide", ["prop_default"] = "Q307Centralizer", }, -- Galilée
["category"] = { ["typ"] = "ctr", ["need"] = 0, ["keyword"] = "category"},
-- datas.entity = mw.wikibase.getEntity(datas.QITEM or datas.default_item or "Q34743" ) -- Rudyard Kipling
["debug"] = { ["typ"] = "opt", ["need"] = 0, ["keyword"] = "debug"},
["c"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "c"},
["docfunc"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "docfunc"},
["docitem"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "docitem"},
["dockey"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "dockey"},
["itemid"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "itemid"}, -- Property:P2959 points to a double of the item.
["mode"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "mode"},
["options"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "options"},
["knownversions"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "knownversions"},
["soughtversions"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "soughtversions"},
["contentlang"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "contentlang"},
["pagelang"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "pagelang"},
["userlang"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "userlang"},
["known_arguments_country"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "known_arguments_country", ["prop"] = "P18", },
["known_arguments_flag"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "known_arguments_flag", ["prop"] = "P18", },
["known_arguments_monument"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "known_arguments_monument",["prop"] = "P18", },
["known_arguments_town"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "known_arguments_town", ["prop"] = "P18", },
--
-- 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.
["modeimage"] = { ["typ"] = "configdat", ["keywordneed"] = "mode"0, ["propkeyword"] = "modes.options_for_modesimage", ["prop_defaultprop"] = "readP18", }, -- Mode read as default
["imagecountry"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "imagecountry", ["prop"] = "P18P27", },
["countrybirthyear"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "countrybirthyear", ["prop"] = "P27P569", ["format"] = "year", },
["birthyeardeathyear"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "birthyeardeathyear", ["prop"] = "P569P570", ["format"] = "year", },
["deathyearlastname"] = { ["typ"] = "dat", ["keywordneed"] = "deathyear"0, ["propkeyword"] = "P570lastname", ["formatprop"] = "yearP734", },
["lastnamelastname2"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "lastname", ["prop"] = "P734", ["syn"] = 2, },
["lastname2firstname"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "lastnamefirstname", ["prop"] = "P734P735", },
["firstnamefirstname2"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "firstname", ["prop"] = "P735", ["prop_defaultsyn"] = "Galilée"2, },
["firstname2initial"] = { ["typ"] = "dat", ["keywordneed"] = "firstname"0, ["propkeyword"] = "P735initial", ["prop_defaultprop"] = "GaliléeP735", },
["initialtitle"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "initiallabel", ["prop"] = "P735", ["syn"] = 2, },
["titlepersonlang"] = { ["typ"] = "dat", ["keywordneed"] = "label"0, ["propkeyword"] = "P735personlang", ["prop_defaultprop"] = "labelP1412", },
["personlangdescription"] = { ["typ"] = "dat", ["keywordneed"] = "personlang"0, ["propkeyword"] = "P1412description", ["prop_defaultprop"] = "endescription", },
["descriptionlabel"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "descriptionlabel" , ["prop"] = "descriptionlabel", ["prop_default"] = "Aristote", },
["labellabelcontent"] = { ["typ"] = "dat", ["keywordneed"] = "label" 0, ["propkeyword"] = "labellabelcontent", ["prop_defaultprop"] = "labellabelcontent", },
["labelcontentlabelpage"] = { ["typ"] = "dat", ["keywordneed"] = "labelcontent"0, ["propkeyword"] = "labelcontentlabelpage", ["prop_defaultprop"] = "Q307labelpage", }, -- Galilée
["labelpagelabeluser"] = { ["typ"] = "dat", ["keywordneed"] = "labelpage"0, ["propkeyword"] = "labelpagelabeluser", ["prop_defaultprop"] = "Q307labeluser", }, -- Galilée
["labeluserlabelbylang"] = { ["typ"] = "dat", ["keywordneed"] = "labeluser"0, ["propkeyword"] = "labeluserlabelbylang", ["prop_defaultprop"] = "Q307labelbylang", }, -- Galilée
["labelbylangQITEM"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "labelbylangQITEM", ["prop"] = "labelbylangQITEM", ["prop_default"] = "Q307", }, -- Galilée
["QITEM"] = { ["typ"] = "dat", ["keyword"] = "QITEM", ["prop"] = "QITEM", ["prop_default"] = "Q307", }, -- Galilée
["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", ["keywordneed"] = "sitelink"0, ["propkeyword"] = "sitelink", ["prop_defaultprop"] = "sitelink", },
["uri"] = { ["typ"] = "dat", ["keywordneed"] = "uri"0, ["propkeyword"] = "uri", ["prop_defaultprop"] = "uri", },
["sex"] = {["keyword"] = "sex", ["typ"] = "dat", ["need"] = "default"0, ["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"0,
["arg_values"] = "region_values", ["key_values"] = "other;china;india;century", ["prop"] = "uri", }, -- wiki_selectors
["rights"] = {["keyword"] = "rights", ["typ"] = "dat", ["need"] = "default"0,
["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
["known_arguments_monument"] = { ["typ"] = "dat", ["need"] = "noevent"0, ["keyword"] = "known_arguments_monument", ["prop"] = "P18", ["prop_default"] = "St Paul Cathedral.png", },
["labelbylang"] = { ["typ"] = "dat", ["need"] = "noevent"0, ["keyword"] = "labelbylang", ["prop"] = "P18", ["prop_default"] = "en", },
-- mw_wikibase_country = "England", -- English
-- mw_wikibase_flag = "England in the UK and Europe.svg", -- English
-- mw_wikibase_monument = "St Paul Cathedral.png", -- English St Paul's Cathedral
-- mw_wikibase_town = "London", -- English
-- known_arguments_monument = "Tour Eiffel", -- French
-- known_arguments_town = "Paris", -- French
} -- #p.known_arguments - = 29 on 2018-01-15
 
function p.form_support_desk_report(t) return versions.form_support_desk_report(t) end
Ligne 11 218 ⟶ 10 852 :
t = t .. "\n* " .. viewers.ta("Main module Description", version.mainDescription) .. viewers.ta("function", version.functionDescription) .. viewers.ta("task", version.taskDescription)
t = t .. "\n* MediaWiki_version: " .. versions.MediaWiki_version() -- Formats MediaWiki_version, in error color if it changes.
t = t .. "\n*" .. langs.list_MediaWiki_languagesmain_i18n_languages_list() -- Lists available translations in available languages.
t = t .. "\n* Start versions from the main module: " .. (versions.bind_verif_modules_report_start or " bind_verif_modules_report_start missing ")
t = t .. versions.versions_management_report()
Ligne 11 227 ⟶ 10 861 :
return t, details
end
 
-- Display the documentation in an infobox, similar to edit-boxs
-- Affichage de documentation dans un cadre (box), semblable aux boites d'edition
function p.box_edit(known_arguments)
-- read = " box1 ",
-- edit = " box1 docdef docline docsrc docdata catview docview : ",
-- doc = " nobox1 noerr nocatview ",
-- tests = " box1 docdef docline docsrc docdata catview docview : tests ",
local res, props = "", datas.props
if type(known_arguments) ~= "table" then known_arguments = modes.known_arguments end -- optional arguments
langs.init_content_page_user_lang(modes.args_source.contentlang, modes.args_source.pagelang, modes.args_source.userlang)
-- res = res .. "<center><small>" .. viewers.discreet_main_version() .. viewers.ta("contentlang", langs.content_lang) .. viewers.ta("pagelang", langs.page_lang) .. viewers.ta("userlang", langs.user_lang)
res = res .. "<small>(box_edit)</small> <center>" .. viewers.discreet_main_version() .. viewers.ta("content", langs.content_lang) .. viewers.ta("page", langs.page_lang) .. viewers.ta("user", langs.user_lang)
res = res .. " - [https://fr.wikisource.org/wiki/MediaWiki:Scribunto/Central_modules_reference_manual User manual]"
res = res .. viewers.phab_task('T135845', 'Convert') .. "-*-" .. viewers.phab_task('T198107', 'Begin to use') .. " </center>"
res = res .. viewers.styles_color_error("<center><b>" .. viewers.form9user("modes_delete_docbox_wng") .. "</b><br/></center>")
res = res .. drop_box.form(drop_box.new_title(), versions.form_support_desk_report() )
if modes.option("debug") then res = res .. "\n*" .. viewers.ta("modes.cat_view", modes.cat_view) .. viewers.ta("modes.template_options", modes.template_options) .. viewers.ta("modes.mode_options", modes.mode_options) end
local lnk = props.QITEM
if modes.option("docdata") then res = res .. "\n*" .. modes.generDoc(" docdef docline ", datas.args_wikidata, datas_link) end
res = res .. ", " .. viewers.form9user(" (%1 properties)", (datas.propss_count_all or "") ) -- datas_structured_data_txt
if modes.option("docview") then res = res .. "\n*" .. modes.generDoc("", known_arguments, "Arguments") end
if not modes.option("noerr")then res = res .. "\n*" .. events.errors_lister() end
local t = "" -- Formats events views
-- local wng, err, cat = events.sort_typ() -- Sort events by type in wng, err, cat.
 
-- if evt.typ == "wng" then evt.res = viewers.styles_color_warning(evt.user_wkt) end
-- if new_evt then table.insert(events.list_all_events, evt) end
for key, evt in pairs(events.list_all_events) do
if evt.typ == "wng" then
evt.res, evt = events.form(evt)
if evt.res then t = t .. "<br>* " .. tostring(evt.res) end
end
end
--
for key, evt in pairs(events.list_all_events) do
if evt.typ == "err" then
evt.res, evt = events.form(evt)
if evt.res then t = t .. "<br>* " .. tostring(evt.res) end
end
end
--
for key, evt in pairs(events.list_all_events) do
if evt.typ == "cat" then
evt.res, evt = events.form(evt)
if evt.res then t = t .. "<br>* " .. tostring(evt.res) end
end
end
t = t .. langs.list_MediaWiki_languages() -- List available translations languages
res = res .. t
res = '<div style="border-style: solid; border-width: 1px; background-color:#FAFAFA; padding:0.3em; width=90%; overflow-x:hidden; ">' .. res .. '</div>'
-- local result = "\n------ " -- This code interact with drop_box and debug the bug T20151215 2016-11-13 17:57.
-- result = result .. '<div class="CentralDocBox" style=" width=90%; border: 1px solid #AAAAAA; margin:1em; background-color:#F1F1F1; padding:0.3em; ">' .. res .. '</div>'
-- result = result .. "\n* " .. events.categories_lister(":")
return res
end -- function p.box_edit(known_arguments)
 
function viewers.boxviews(datas, main_options) -- Formats a composite box from some basic boxes.
local main_options = main_options or "inH or inV;in1 or in3;left or centre or N or right"
local box1 = viewers.boxviews(box_default, datas[1], datas[1].options1)
local box2 = viewers.boxviews(box_default, datas[2], datas[2].options2)
local box3 = viewers.boxviews(box_default, datas[3], datas[2].options3)
local one_composite_box = viewers.boxviews(boxmain, box1, box2, box3, "options123")
return one_composite_box -- TODO LATER
end -- local one_composite box = viewers.boxviews(datas, main_options)
 
function p.box_read(prop, title) -- Draw the main box one. -- ric (box_read)
-- 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)
datas.QITEM = mw.wikibase.getEntityIdForCurrentPage() -- use props.QITEM Returns the Item id as string, like "Q42"
local QITEM = datas.QITEM or datas.default_item or "Q307" -- Keep Galilée (Q307)
datas.prop, datas.props = datas.get_item(modes.known_arguments, QITEM) -- Get datas from mw.wikibase for the page.
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang()
local prop = datas.prop
local res = "<small>(box_read)</small> "
local flag = viewers.form_image("Flag_of_England.svg", 50)
-- local flag = viewers.form_image(viewers.form9user("flag_of_country"), 50)
-- known_arguments_country = "England", -- English
-- known_arguments_flag = "Flag_of_England.svg", -- English
-- known_arguments_monument = "St_Pauls_aerial_%28cropped%29.jpg", -- English St Paul's Cathedral
-- known_arguments_town = "London", -- English
-- clé valeur type nécessaire mot-clé synonyme propriété par défault format source
-- image nil dat 0 image 0 P18
local image
if not prop["image"] then return nil end
local image = viewers.form_image(prop["image"]["val"], 50)
local birthyear_deathyear = " ( " .. (prop.birthyear or "birthyear") .. " - " .. (prop.deathyear or "deathyear") .. " ) "
local phabtask = " - [[d:" .. QITEM .. "|Datas]] "
res = res .. "<br/><center><b>firstname: " .. (prop.firstname or "firstname") .. "</b>, "
res = res .. "<b>sitelink: " .. prop.sitelink .. phabtask .. "</b></center>"
res = res .. "<br/><center>Labels in langs: <b>" .. prop.labelbylang .. "</b>, user: <b>" .. prop.labeluser .. "</b>, content: <b>" .. prop.labelcontent .. "</b>, page: <b>" .. prop.labelpage .. "</b>"
res = res .. "<br/><center><b>description: " .. prop.description .. birthyear_deathyear .. "</b></center>"
res = res .. " <br/><center>" .. flag .. " * used languages: user:<b>" .. langs.user_lang .. "</b>, content:<b>" .. langs.content_lang .. "</b>, page:<b>" .. langs.page_lang .. "</b> * " .. image .. "</center>"
-- res = res .. "<br/><center>languages:<b>" .. langs.list_MediaWiki_languages() -- List available translations languages
res = '<div style="border-radius:0.7em; margin-right:5px; box-shadow:0.2em 0.3em 0.2em #B7B7B7; background-color:#F1F1DE; padding:0.3em; width=90%; overflow-x:hidden; ">' .. res .. '</div>'
return res
end -- function p.box_read(known_arguments, title)
 
function p.form_tests_init(res, args_source)
Ligne 11 356 ⟶ 10 893 :
-- - - - ------------------ - - - - ---------------------------------
-- - - - ------------------ - - - - ---------------------------------
 
 
local versatile_arguments = {}
modes.versatile_arguments = versatile_arguments
 
-- FAMLTVQDR Tactic only once steps : Frame Mode-from-Frame Args Libraries Translations Versions QITEM Datas Results
-- { "20181220", "20181221", "NOW", "Rical", "S181220oso", "select only sub-functions in the right order in function p.Init_central_module()", },
-- function modes.Librairies_Versions_Args_Mode_Item_Datas_Results(known_arguments) for function Central.init(...
function p.Init_central_module(frame, mode_name, known_arguments, options_for_modes, QITEM) -- Activates known_arguments for phase = "mode" or "argument" or "QITEM" or "property"
-- { "20181220", "20181221", "NOW", "Rical", "S181220oso", "select only sub-functions in the right order in function p.init_central_module()", }, TODO
function p.init_central_module(frame, mode_name, known_arguments, options_for_modes, QITEM) -- FAMLTVQDR replaces function Central.init(...
-- Central.init(frame, mode_name, known_arguments, options_for_modes, QITEM) -- FAMLTVQDR Typical call
local res, t, phase = "", "", ""
local frame = frame or mw.getCurrentFrame() -- for F = Frame
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- for A in FAMLTVQDR Arguments definitions at module level p.known_arguments - = {...}
modes.actual_arguments = modes.actual_arguments or {} -- Groups activated arguments MUMU
for key, one_arg in pairs(known_arguments) do
modes.actual_arguments = modes.activate_known_arguments(known_arguments, "argument") -- Activates known_arguments for phase = mode or argument or QITEM or property
-- ["mode"] = { ["typ"] = "config", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
--
-- Initializes translations, bind_libraries, bind_sub_modules, get arguments, modes, options.
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang() -- for T = Translations
--
versions.bind_the_main_module() -- Bind the main module, all sub-modules and all their i18n.
versions.bind_all_sub_modules() -- Bind all sub-modules of the main module.
--
local bindable_libraries = bindable_libraries or versions.bindable_libraries or {} -- optional value from p.known_arguments - = {...}
versions.setup_central_libraries(bindable_libraries, opt) -- for L = Libraries Install central bindable libraries in package.loaded
--
modes.actual_arguments = modes.activate_known_arguments(known_arguments, "mode") -- Activates known_arguments for phase = mode or argument or QITEM or property
res = res .. "\n* Count in pairs(modes.actual_arguments) : " .. viewers.ta("n", lua_table.level_count(modes.actual_arguments) )
for key, one_arg in pairs(modes.actual_arguments) do
if type(one_arg) == "table" then
if one_arg["keyword"] and (one_arg["keyword"] == "mode") and modes.options_for_modes[modes.mode_name] then modes.mode_name = modes.mode_name
-- ["mode"] = { ["typ"] = "config", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
else modes.mode_name = one_arg["prop_default"] end -- prop_default = read -- for M = Mode
-- table.insert( versatile_arguments, mw.clone(one_arg) )
table.insert( versatile_arguments, (one_arg) )
end
end
-- todo : then in function p.Init_central_module() group only all sub-functions in the original order then delete duplicated one's
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang() -- for T = Translations
-- function versions.setup_central_libraries(
known_arguments = modes.get_args_datas(known_arguments) -- Applies the Tatic for (err, wng, cat) S181124Dng
--
modes.get_args(known_arguments) -- Interactions between arguments
modes.known_arguments = modes.import_arguments(known_arguments, 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
local bindable_libraries = bindable_libraries or versions.bindable_libraries or {} -- optional value from p.known_arguments - = {...}
versions.setup_central_libraries(bindable_libraries, opt) -- for L = Libraries Install central bindable libraries in package.loaded
-- function versions.init(frame, Central_version, mode_name, known_arguments, options_for_modes, QITEM) -- FAMLTVQDR
-- Initializes translations, bind_libraries, bind_sub_modules, get arguments, modes, options.
-- Imports arguments from wikidata, module and template with increasing priorities.
versions.bind_the_main_module() -- Bind the main module, all sub-modules and all their i18n.
langs.main_i18n_complete = false -- Mask any views to avoid failures until enough init.
local Central_version = Central_version or langs.Module_Central_version -- or p.Module_Central_version
versions.bind_all_sub_modules() -- Bind all sub-modules of the main module.
res = res .. modes.init_modes_translate_events(frame, Central_version, mode_name, known_arguments, options_for_modes, QITEM)
if type(langs) == "table" then langs.main_i18n = langs.main_i18n or versions.main_i18n or {} end -- Same pointers insure later same contents.
Ligne 11 391 ⟶ 10 938 :
local loaded_pack = versions.loaded_modules_and_libraries
versions.bind_reverse_i18n_translations(main_versions, loaded_pack) -- Bind all i18n translations from modules and their /I18N translations sub-modules
res = res .. "\n* Counts main_versions : " .. viewers.ta("n", lua_table.level_count(main_versions) )
ARGS = tracker.initadd({ ["name"] = "ARGS", limit = 2, }) -- Initialize a track and its track lines.
ARGS.add(ARGS, 1, "versions.init before import_arguments") -- ARGS.t
-- res = res .. langs.init_content_page_user_lang() -- content_lang, page_lang, user_lang, "versions.init")
local mix = mix or {}
modes.local mix = modes.init_args_mode_options(mix, modes.mode_name, args_templatemodes.actual_arguments) -- Before known_arguments : Import and mix args mode and options -- S170710mix
modes.actual_arguments = modes.activate_known_arguments(known_arguments, "QITEM") -- Activates known_arguments for phase = "mode" or "argument" or "QITEM" or "property"
-- ["QITEM"] = { ["typ"] = "dat", ["need"] = "noevent", ["keyword"] = "QITEM", ["prop"] = "QITEM", prop_default = "Q34743", },
res = res .. "\n* Count modes.actual_arguments QITEM : " .. viewers.ta("n", lua_table.level_count(modes.actual_arguments) )
modes.mix = modes.init_args_mode_options(mix, mode_name, args_template) -- And after known_arguments : Import and mix args mode and options
-- ["QITEM"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "QITEM", ["prop"] = "QITEM", prop_default = "Q34743", },
modes.actual_arguments = modes.activate_known_arguments(known_arguments, "property") -- Activates known_arguments for phase = "mode" or "argument" or "QITEM" or "property"
res = res .. "\n* Counts main_versions property : " .. viewers.ta("n", lua_table.level_count(modes.actual_arguments) )
-- res = res .. langs.init_content_page_user_lang() -- content_lang, page_lang, user_lang, "versions.init")
langs.main_i18n_complete = true -- Unmask all views after enough init.
--
res = res .. versions.detect_MediaWiki_changes()
local options_for_modes = options_for_modes or modes.options_for_modes or {} -- M in FAMLTVQDR or {} -- optional value from p.known_arguments - = {...}
modes.options_for_modes = options_for_modes
versions.memo_i18n = mw.clone(versions.main_i18n or langs.main_i18n)
-- versions.memo_i18n = (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.known_arguments, options_for_modes, QITEM or itemid)
datas.props = datas.get_item(known_arguments, QITEM) -- Get datas from mw.wikibase for the page.
langs.Central_version = Central_version or langs.Central_version or Central.Central_version_name
return res
end -- resmodes.actual_arguments = res ..function p.init_central_moduleInit_central_module(frame, mode_name, known_arguments, options_for_modes, QITEM) -- FAMLTVQDRActivates replacesknown_arguments functionfor Central.init(...phase
 
function p.Init_central_module_report(t) -- Reports known_arguments for phase = "mode" or "argument" or "QITEM" or "property"
local memo = viewers.save_configs("p.Init_central_module_report") -- Save global configuration before eventual changes.
local t = t or "\n* <b>p.Init_central_module_report(t)</b> Reports known_arguments for phase = mode or argument or QITEM or property. \n*"
modes.actual_arguments = modes.actual_arguments or {} -- Activated known_arguments depending of for phase = mode or argument or QITEM or property
t = t .. "\n* Size of initial modes.actual_arguments table : " .. lua_table.level_count(modes.actual_arguments) .. "\n*"
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = modes.actual_arguments, -- = sorted activity.phabricator_tasks_Group,
title_memo = "p_Init_central_module_report **", -- Activated known_arguments depending of phase
headers = "activity_phabricator_tasks_headers", -- "Importance; modified on; Task; Status; Title"
headers = "key; keyword; typ; bind; need; prop; prop_default; format; value",
headers_class = "wikitable alternative center sortable",
form_one_case = function(case) -- Convert a case from test_group to rowGroup.
-- ["QITEM"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "QITEM", ["prop"] = "QITEM", prop_default = "Q34743", },
-- ["mode"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "mode", ["prop_default"] = "read"},
-- ["label"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "label" , ["prop"] = "label", ["prop_default"] = "Aristote", },
return { case.key, case.keyword, case.typ, case.bind, case.need, case.prop, case.prop_default, case.format, case.value, }
end,
rowGroup = {},
-- track_on = true, allwaysview
-- res = res .. drop_box.new(selector, "p_Init_central_module_report **", p.Init_central_module_report) -- for phase = mode or argument or QITEM or property
}
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
t = t .. "\n* Size of the full modes.actual_arguments table : " .. lua_table.level_count(modes.actual_arguments) .. "\n*"
viewers.restore_configs(memo, "p.Init_central_module_report") -- Restore global configurations after eventual changes.
return t
end -- t = t .. function p.Init_central_module_report(t) -- FAMLTVQDR replaces function Central.init( code DODO
 
modes.init_arguments_group = {
{ ["typ"] = "config", ["keyword"] = 1, ["syn"] = "mode", ["prop_default"] = "read", }, -- Mode read as default
-- {{Centralizer|doc|dockey=versions_support_desk_title|docitem=Q535}}
-- res = res .. drop_box.new(selector, "p_Init_central_module_tests_title **", p.Init_central_module_tests) -- doc link
{ ["typ"] = "config", ["keyword"] = 2, ["syn"] = "dockey", ["prop_default"] = "activity_support_central_modules_title", ["docfunc"] = activity.begin_central_modules_support, }, -- Mode read as default
{ ["typ"] = "config", ["keyword"] = 3, ["syn"] = "docitem", ["prop_default"] = "QITEM", }, -- Mode read as default
{ ["typ"] = "config", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "edit", }, -- Mode read as default
{ ["typ"] = "config", ["keyword"] = "modemode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
{ ["typ"] = "dat", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
{ ["typ"] = "config", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
{ ["typ"] = "config", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "edit", }, -- Mode read as default
{ ["typ"] = "config", ["keyword"] = "modemode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
{ ["typ"] = "dat", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
{ ["typ"] = "config", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
{ ["typ"] = "config", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "edit", }, -- Mode read as default
{ ["typ"] = "config", ["keyword"] = "modemode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
{ ["typ"] = "dat", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
{ ["typ"] = "config", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
{ ["typ"] = "config", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "edit", }, -- Mode read as default
{ ["typ"] = "config", ["keyword"] = "modemode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
{ ["typ"] = "dat", ["keyword"] = "mode", ["prop"] = "modes.options_for_modes", ["prop_default"] = "read", }, -- Mode read as default
}
 
function p.Init_central_module_tests(t) -- For FAMLTVQDR.
local memo = viewers.save_configs("p.Init_central_module_tests") -- Save global configuration before eventual changes.
-- local versatile_arguments = mw.clone(known_arguments)
for i, one_arg in pairs(modes.init_arguments_group) do
one_arg["typ"] = tostring(one_arg["typ"])
one_arg.typ = tostring(one_arg["typ"])
one_arg.typ = tostring(one_arg["typ"])
one_arg.typ = tostring(one_arg["typ"])
one_arg.typ = tostring(one_arg["typ"])
one_arg.typ = tostring(one_arg["typ"])
one_arg.typ = tostring(one_arg["typ"])
one_arg.typ = tostring(one_arg["typ"])
one_arg.typ = tostring(one_arg["typ"])
one_arg.typ = tostring(one_arg["typ"])
one_arg.typ = tostring(one_arg["typ"])
one_arg.typ = tostring(one_arg["typ"])
one_arg.typ = tostring(one_arg["typ"])
table.insert(modes.versatile_arguments, one_arg)
end
local t = t or "\n* <b>p.Init_central_module</b> Tests : Initializes a central module"
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = modes.init_arguments_group,
form_one_case = function(case) -- Convert a case from test_group to rowGroup.
-- return { tostring(case.typ or "---"), tostring(case.keyword or "---"), tostring(case.prop or "---"), tostring(case.prop_default or "---"), }
local t = "\n* : " .. viewers.ta("tip", case.typ) .. viewers.ta("keyword", case.keyword) .. viewers.ta("prop", case.prop) .. viewers.ta("prop_default", case.prop_default) .. viewers.ta("tip", case.typ) .. viewers.ta("tip", case.typ)
return t
end,
title_memo = "p_Init_central_module_tests_title**", -- "lua_table.to_list() Return a list from a Lua table.",
headers = "p_Init_central_module_tests_headers**", -- "Tested case; Input table, rough_view; Output list",
headers = "type; keyword; prop; prop_default; syn; docfunc; ", -- "Tested case; Input table, rough_view; Output list",
headers_class = "wikitable alternative center sortable",
rowGroup = {},
-- track_on == "details",
}
-- res = res .. drop_box.new(selector, "p_Init_central_module_tests_title**", p.Init_central_module_tests)
-- res = res .. drop_box.new(selector, "modes_get_args_datas_tests_title", modes.get_args_datas_tests)
-- local t = tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
for i, case in pairs( tab_view.test_group ) do
if type(case) == "table" then -- t = t .. viewers.ta(k, tostring(var) ) end
t = t .. "\n* : " .. viewers.ta("i", i) .. viewers.ta("tip", case.typ) .. viewers.ta("keyword", case.keyword) .. viewers.ta("prop", case.prop) .. viewers.ta("prop_default", case.prop_default) .. viewers.ta("result", case.result)
end
end
viewers.restore_configs(memo, "p.Init_central_module_tests") -- Restore global configurations after eventual changes.
return t --, errors -- langs_missing_translations_title
end -- t = t .. p.Init_central_module_tests
-- res = res .. drop_box.new(selector, "p.Init_central_module_tests_title **", p.Init_central_module_tests) -- doc link
 
-- FAMLTVQDR Tactic only once steps : Frame Mode-from-Frame Args Libraries Translations Versions QITEM Datas Results
-- { "20181220", "20181221", "NOW", "Rical", "S181220oso", "select only sub-functions in the right order in function p.init_central_module()", },
-- function p.Init_central_module(frame, mode_name, known_arguments, options_for_modes, QITEM) -- FAMLTVQDR replaces function Central.init( code
function Central.init(frame, Central_version, mode_name, known_arguments, options_for_modes)
-- FAMLTVQDR for Args = p.known_arguments - = {...}, Datas = function datas.get_item(known_arguments, 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 = ""
local res = "\n* Central.init(frame, Central_version, mode_name, known_arguments, options_for_modes)<br>"
tracker.init_trakers() -- Initialize some trakers. To run in Central.init()
res = res .. p.init_central_module(frame, mode_name, known_arguments, options_for_modes, QITEM) -- FAMLTVQDR replaces function Central.init(...
modes.time1 = os.clock()
-- {{Centralizer|tests|itemid=Q535}} Erreur Lua dans Module:Centralizer à la ligne 1867 : bad argument #2 to 'getLabelByLang' (string expected, got nil).
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments = {...}
if 1 then return res end
local Central_version = Central_version or plangs.version.versionNameCentral_version --or optional value from pCentral.known_arguments - = {...}Central_version
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments - = {...}
-- ["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
-- res = res .. p.Init_central_module(frame, mode_name, known_arguments, options_for_modes, QITEM) -- FAMLTVQDR replaces function Central.init( code
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 ; versions.main_i18n = versions.memo_i18n
-- local datas = mw.clone(datas)
res = res .. modes.init_modes_translate_events(frame, langs.Central_version, mode_name, modes.known_arguments, options_for_modes, QITEM or itemid)
res = res .. modes.init_modes_translate_events(frame, Central_version, mode_name, modes.known_arguments, 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.known_arguments = modes.import_arguments(known_arguments, 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(known_arguments, QITEM) -- Get datas from mw.wikibase for the page.
modes.init_args_mode_options(mix, mode_name, modes.args_template) -- Import and mix args mode and options from template and invoke -- S170710mix
-- local datas = mw.clone(datas) modes.get_args_datas
modes.args_import = modes.import_arguments(known_arguments, args_source, content_translations, args_wikidata) -- function modes.import_arguments()
-- ["image"] = { ["typ"] = "dat", ["keyword"] = "image", ["prop"] = "P18", },
known_arguments = modes.get_args_datasactivate_known_arguments(known_arguments) -- AppliesInteractions the Tatic for (err, wng, cat)between S181124Dngarguments
modes.get_args(known_arguments) -- Interactions between arguments
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang()
res = res .. (datas.props_trk or "")
Ligne 11 457 ⟶ 11 084 :
-- Helpers or admins can add options to include edit or tests or user language...
local res = ""
local t = Central.init(frame, Central.Central_version_nameCentral_version, "read", p.known_arguments, p.options_for_modes)
-- res = res .. t
res = res .. p.form_result(modes.known_arguments)
Ligne 11 467 ⟶ 11 094 :
local res = "</b>"
res = res .. "Library:langs"
local t = Central.init(frame, Central.Central_version_nameCentral_version, "edit", p.known_arguments, p.options_for_modes)
-- res = res .. t
-- res = res .. "</b>"
res = res .. p.form_result(modes.known_arguments)
return res
end -- function Central.edit(frame)
 
-- ["docfunc"] = { ["typ"] = "config", ["need"] = "noevent"0, ["keyword"] = "docfunc"},
-- ["dockeydocitem"] = { ["typ"] = "config", ["need"] = "noevent"0, ["keyword"] = "dockeydocitem"},
-- ["dockey"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "dockey"},
function Central.doc(frame) -- Formats a documentation or a test in a drop_box. TODOTODO
function Central.doc(frame) -- Formats a documentation or a test in a drop_box.
-- {{Centralizer|doc|dockey=modes_get_args_report_title|docfunc=modes.get_args_report}} -- example of use
local res = ""
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {}
Central.init(frame, p.Module_Central_version, "doc", p.known_arguments, p.options_for_modes) -- QITEM
local main_i18n = versions.memo_i18n or langs.main_i18n or versions.main_i18n or {}
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang()
local res, t, docfunc_string, dockey = "", "", "", "modes_get_args_report_title"
modes.change_itemid() -- default = "Q41568"
t = t .. p.init_central_module(frame, mode_name, known_arguments, options_for_modes, QITEM) -- FAMLTVQDR replaces function Central.init(...
-- {{Central|doc|versions_support_desk_title}}
for key, one_arg in pairs(known_arguments) do -- For all known parameters default = "modes_get_args_report_title"
local docfunc = modes.known_arguments.docfunc or modes.known_arguments[3] or modes.args_import.docitem or modes.args_import[3]
if ( type(one_arg) == "table" ) and ( one_arg.keyword == "dockey" ) then
local docitem = modes.known_arguments.docitem or modes.known_arguments[2] or modes.args_import.docitem or modes.args_import[2] or datas.default_item
if not main_i18n.en["dockey"] then dockey = one_arg["prop_default"] end -- If a lang mises of translations, try English.
local dockey = modes.known_arguments.dockey or modes.known_arguments[1] or modes.args_import.dockey or modes.args_import[1]
end
local QITEM = modes.known_arguments.QITEM or modes.known_arguments.docitem or docitem
end
QITEM = mw.text.trim(QITEM) -- clean spaces in each name
-- ["dockey"] = { ["typ"] = "config", ["keyword"] = "dockey", ["prop"] = "modes_get_args_report_title", ["prop_default"] = "modes_get_args_report_title", },
if dockey then
-- ["docfunc"] = { ["typ"] = "config", ["keyword"] = "dockey", ["prop"] = "modes.get_args_report", ["prop_default"] = "modes.get_args_report", },
local selector = mw.text.trim(dockey)
for key, one_arg in pairs(known_arguments) do -- For all known parameters default = "modes_get_args_report_title"
if ( type(one_arg) == "table" ) and ( one_arg.keyword == "docfunc" ) then
if not main_i18n.en["docfunc"] then docfunc_string = one_arg["prop_default"] end -- If a lang mises of translations, try English.
end
end
local docfunc = lua_table.from_subnames_object(docfunc_string, base_table) or modes.get_args_report -- Get the last sub-object from its sub-names, but not a table.
-- res = res .. drop_box.new(selector, "modes_get_args_report_title", modes.get_args_report)
if (not main_i18n.en) or (not main_i18n.en["docfunc"]) then docfunc_string = "modes.get_args_report" end
res = res .. viewers.ta("docfunc_string", docfunc_string) .. viewers.ta("dockey", dockey)
res = res .. drop_box.new("allwaysview", dockey, docfunc ) -- string.find nil function lua_table.from_subnames_object(;
return res
end -- function Central.doc(frame) function drop_box.new(
 
function Central.tests(frame)
local res = ""
res = res .. tracker.init_trakers() -- Initialize some trakers. To run in Central.init()
local t = Central.init(frame, Central.Central_version_nameCentral_version, "tests", p.known_arguments, p.options_for_modes)
res = res .. t
-- res = res .. "\n* getEntityIdForCurrentPage = " .. tostring( mw.wikibase.getEntityIdForCurrentPage() ) -- Returns the Item id as string, like "Q42"
Ligne 11 517 ⟶ 11 136 :
return res
end -- function Central.tests(frame)
 
function Central.begin(frame)
local res = ""
res = res .. "\n* Some examples of author headers, infosbox, ... from 10 first begin modules in langs"
return res
end -- function Central.begin(frame)
 
function versions.detect_MediaWiki_changes()
Ligne 11 681 ⟶ 11 294 :
function viewers.doc_group(selector, mask_sections) -- function viewers.doc_internal(selector, mask_sections)
local res = ""
local selector = selector or "enforce"
if p.teststests == "FAMLTVQDR" then
local mask_sections = mask_sections or nil
res = res .. drop_box.new(selector, "p.teststests = FAMLTVQDR Init_mode_args_datas_tests **", modes.Init_mode_args_datas_tests )
if p.teststests == "not FAMLTVQDR" then -- DODO
res = res .. "\n* Displays internal tests FAMLTVQDR activated."
res = res .. drop_box.new(selector, "modes_known_arguments_report_title", modes.known_arguments_report)
res = res .. drop_box.new(selector, "p_Init_central_module_report **", p.Init_central_module_report) -- for phase = mode or argument or QITEM or property
res = res .. drop_box.new(selector, "p.Init_central_module_tests_title **", p.Init_central_module_tests) -- doc link
res = res .. drop_box.new(selector, "langs_main_i18n_languages_list", langs.main_i18n_languages_list ) -- OK, show in table ?
res = res .. drop_box.new(selector, "langs_list_MediaWiki_languages_title", langs.list_MediaWiki_languages ) -- OK, show in table ?
res = res .. drop_box.new(selector, "modes Init Frame Args Mode Libraries **", p.init_central_module_tests)
res = res .. drop_box.new(selector, "modes_get_args_datas_tests_title", modes.get_args_datas_tests)
Ligne 11 690 ⟶ 11 310 :
else
res = res .. viewers.doc_section(selector, "Tests of this page", "h2", mask_sections) -- function viewers.doc_section(
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_page(selector, mask_sections) -- mask for time limit