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

Contenu supprimé Contenu ajouté
MdCentral lua_table.to_list_tests(t) hard bug table structure 190108 1000.lua
MdCentral sorted phabtasks, update admins counts, debug gsub OK 190119 0015.lua
Ligne 2 :
-- The main central module is mainly an installer of central libraries and a small demonstrator.
-- The main central module installs central libraries and bind the main and its sub-modules
local Central = p -- Save as MdCentral.lua MdCentral lua_table.to_list_tests(t)sorted hardphabtasks, bugupdate tableadmins structurecounts, 190107debug 2250gsub OK 190119 0015.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 = {}
-- DONE+todo : referal version : ModuleCentralizer function modes.levenshtein_similar_tests OK.lua to complete. DODO
-- 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
{ "20190120", "20190101", "todo", "Rical", "S190101cTD", "Ask a central Template:Dropbox for all mediawikis users you and me. on 20190101", },
{ "20190120", "20190120", "done", "Rical", "S181227trb", "treebranches -- For each sought. Replace known. Later on 201811207", },
{ "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)"
{ "20190110", "20190115", "todo", "Rical", "S181222CrC", "Module:CentralSchool: finish reciprocal adaptation with Module:Centralizer", },
{ "20190109", "20190109", "done", "Rical", "S181222SCi", "For 'Begin' Simplify function Central.init(frame, ...) using function p.Init_central_module()" },
{ "20190108", "20190109", "todo", "Rical", "S181221oTc", 'others: ["Tactic"] = "canbenil;nevererror" ', },
{ "20190107", "20190108", "NOW", "Rical", "S181220oso", "select only sub-functions in the right order in function 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" },
{ "20190106", "20190106", "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
} -- 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
-- modif Nov 21 2018, 17:16
 
-- 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(190106T16190118T23:0815)",
["'versionDate"'] = "2019-01-06T1618T23:0815:00", -- UTC version structure MWMW
["'mainDescription"'] = "Begin to use",
["'functionDescription"'] = "first functional support",
["'taskDescription"'] = "enough advanced to use in CentralSchool OK",
-- p_template_drop_box_name = 'Cuadro desplegable', -- Equivalent templates exist in other wikis
["'sought"'] = "Centralizer;Centralizer/I18N;Mathroman;TestRequire", -- Sought module and submodules versions
["'known"'] = "Centralizer;Central-s-fr;Central-14 * Centralizer/I18N;Central/i18n * Mathroman22;Mathroman34", -- Known module and submodules versions
["'treebranches"'] = { -- For each sought. Replace known. Later on 201811207
{ "Centralizer", "Central-s-fr", "Central-2017" }, -- upper
{ "Centralizer/I18N", "Central-s-fr", "Central-2018" }, -- median
Ligne 68 ⟶ 25 :
Central.Central_version_name = Central.version.versionName
p.ModuleNS = mw.site.namespaces.Module.name .. ":" -- translate Module: in other languages
 
 
-- only for ModuleCentralizer : restart from : ModuleCentralizer function modes.levenshtein_similar_tests OK.lua DODO
-- only for ModuleCentralizer : then in function p.init_central_module() group only all sub-functions in the original order then delete duplicated one's
-- only for ModuleCentralizer : then use function p.init_central_module() to replace function Central.init()
-- only for ModuleCentralizer : delete tests_groups and args_final and boxviews and update activity.report_subtasks_list
 
-- cut_libraries
Ligne 427 ⟶ 390 :
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 451 ⟶ 415 :
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 477 ⟶ 442 :
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 503 ⟶ 469 :
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 529 ⟶ 496 :
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 555 ⟶ 523 :
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 579 ⟶ 548 :
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 622 ⟶ 592 :
activity.coder_lang_module = { -- List to report of Module:Centralizer for 'Begin to use' 7 central modules, 7 coders, 7 projets, 7 langs to get.
-- br.wikisource.org/wiki/Modulenn:Centralizer-s-br/doc {{#invoke:Centralizer-s-br|read}} fr = Breton = Breton = Breitz
{ ["'lang"'] = "brfr", ["'project"'] = "wikisourcewikipedia", ["'module_vers"'] = "Centralizer", ["'coder"'] = "[[:sw:brfr:ImplijerUtilisateur:VIGNERONTED|VIGNERONTED]]", ["'ok"'] = "ok",
["'project_short"'] = "sw", ["'tests_lang"'] = "Centralizer/Documentation", ["'template"'] = "PatromModèle", ["'template_vers"'] = "Centralizer/Documentation",
["'module"'] = "Modulenn", ["'admins"'] = "16150", ["'assets"'] = "236", ["'beginon"'] = "20180719 ?", ["'usedfrom"'] = "20180719 ?", },
--
-- de.wikisource.org/wiki/Modul:Centralizer/Doku {{#invoke:Centralizer-s-de|read}} de = German = Deutsch
{ ["'lang"'] = "de", ["'project"'] = "wikisource", ["'module_vers"'] = "Centralizer", ["'coder"'] = "[[:s:de:Benutzer:DerFussi|DerFussi]]", ["'ok"'] = "...",
["'project_short"'] = "s", ["'tests_lang"'] = "Centralizer/Dokumentation", ["'template"'] = "Vorlage", ["'template_vers"'] = "Centralizer/Dokumentation",
["'module"'] = "Modul", ["'admins"'] = "16150", ["'assets"'] = "236", ["'beginon"'] = "20180719 ?", ["'usedfrom"'] = "20180719 ?", },
-- sur la page de projet je ne vois pas qui d'autre :Hexasoft Tejgad Arkanosis Xfigpower Zebulon84 ;Hlm Z.; Od1n TomT0m Archimëa
-- sur la page de projet je ne vois pas qui d'autre : {{u'|Hexasoft}}, {{u'|Tejgad}}, {{u'|Arkanosis}}, {{u'|Xfigpower}}, {{u'|Zebulon84}},, {{u'|Hlm Z.}}.
-- Je rajoute au hasard {{u'|Od1n}}, {{u'|TomT0m}} et... -- [[Utilisateur:Archimëa|Archimëa]] <
-- en.wikipedia.org/wiki/Module:Centralizer/Documentation {{#invoke:Centralizer-w-en|read}} en = English = English
{ ["'lang"'] = "en", ["'project"'] = "wikipedia", ["'module_vers"'] = "Centralizer", ["'coder"'] = "[[:w:en:User:Toohool|Toohool]]", ["'ok"'] = "...",
["'project_short"'] = "w", ["'tests_lang"'] = "Centralizer/Documentation", ["'template"'] = "Template", ["'template_vers"'] = "Centralizer/Documentation",
["'module"'] = "Module", ["'admins"'] = "0150", ["'assets"'] = "0", ["'beginon"'] = "20180719 ?", ["'usedfrom"'] = "20180719 ?", },
--
-- es.wikipedia.org/wiki/Módulo:Centralizers/Documentación {{#invoke:Centralizer-w-es|read}} es = Spanish = español
{ ["'lang"'] = "es", ["'project"'] = "wikipedia", ["'module_vers"'] = "Centralizer", ["'coder"'] = "[[:w:es:Usuario:Juan_Mayordomo|Juan_Mayordomo]]", ["'ok"'] = "...",
["'project_short"'] = "w", ["'tests_lang"'] = "Centralizer/Documentación", ["'template"'] = "Plantilla", ["'template_vers"'] = "Centralizer/Documentación",
["'module"'] = "Módulo", ["'admins"'] = "16150", ["'assets"'] = "236", ["'beginon"'] = "20180719 ?", ["'usedfrom"'] = "20180719 ?", },
--
-- es.wikisource.org/wiki/Módulo:Centralizer-s-es/Documentación {{#invoke:Centralizer-s-es|read}} es = Spanish = española
{ ["'lang"'] = "es", ["'project"'] = "wikisource", ["'module_vers"'] = "Centralizer", ["'coder"'] = "[[:s:es:Usuario:Alex brollo|Alex brollo]]", ["'ok"'] = "...", -- Usuario:Juan_Mayordomo
["'project_short"'] = "s", ["'tests_lang"'] = "Centralizer/Documentación", ["'template"'] = "Plantilla", ["'template_vers"'] = "Centralizer/Documentación",
["'module"'] = "Módulo", ["'admins"'] = "22150", ["'assets"'] = "234", ["'beginon"'] = "20180719 ?", ["'usedfrom"'] = "20180719 ?", },
--
-- Module br Modulenn, de Modul, en Module, es Módulo, fr Module, hu Modul, vi Mô-đun,
Ligne 653 ⟶ 623 :
-- Docum br Documentation, de Dokumentation, en Documentation, es Documentación, fr Documentation, hu Dokumentáció, vi tài liệu,
-- fr.wikisource.org/wiki/Module:Centralizer-s-fr/Documentation {{#invoke:Centralizer-s-fr|read}} fr = French = Français
{ ["'lang"'] = "fr", ["'project"'] = "wikisource", ["'module_vers"'] = "Centralizer", ["'coder"'] = "[[:s:fr:Utilisateur:Rical|Rical]]", ["'ok"'] = "ok",
["'project_short"'] = "s", ["'tests_lang"'] = "Centralizer/Documentation", ["'template"'] = "Modèle", ["'template_vers"'] = "Centralizer/Documentation",
["'module"'] = "Module", ["'admins"'] = "16", ["'assets"'] = "204", ["'beginon"'] = "20180719", ["'usedfrom"'] = "20180719 ?", },
--
-- fr.wikisource.org/wiki/Module:Auteur2Tpt/Tests {{#invoke:Auteur2Tpt|read}} fr = French = Français
{ ["'lang"'] = "fr", ["'project"'] = "wikisource", ["'module_vers"'] = "Auteur2Tpt", ["'coder"'] = "[[:s:fr:Utilisateur:Rical|Rical]]", ["'ok"'] = "ok",
["'project_short"'] = "s", ["'tests_lang"'] = "Auteur2Tpt/Documentation", ["'template"'] = "Modèle", ["'template_vers"'] = "Auteur2Tpt/Documentation",
["'module"'] = "Module", ["'admins"'] = "16", ["'assets"'] = "204", ["'beginon"'] = "20180719", ["'usedfrom"'] = "20180719 ?", },
--
-- hu.wikipedia.org/wiki/Modul:Centralizer-w-hu/doc {{#invoke:Centralizer-w-hu|read}} hu = Hungarian = Magyar
{ ["'lang"'] = "hu", ["'project"'] = "wikipedia", ["'module_vers"'] = "Centralizer", ["'coder"'] = "[[:w:hu:Szerkesztő:Tacsipacsi|Tacsipacsi]]", ["'ok"'] = "...",
["'project_short"'] = "w", ["'tests_lang"'] = "Centralizer/Dokumentáció", ["'template"'] = "Sablon", ["'template_vers"'] = "Centralizer/Dokumentáció",
["'module"'] = "Modul", ["'admins"'] = "3", ["'assets"'] = "77", ["'beginon"'] = "20180719 ?", ["'usedfrom"'] = "20180719 ?", },
--
-- vi.wikipedia.org/wiki/Mô đun:Centralizer-w-vi/tài liệu {{#invoke:Centralizer-w-vi|read}} vi = Vietnamese = Tiếng Việt
{ ["'lang"'] = "vi", ["'project"'] = "wikipedia", ["'module_vers"'] = "Centralizer", ["'coder"'] = "[[:w:vi:Thành viên:mxn|mxn]]", ["'ok"'] = "...",
["'project_short"'] = "w", ["'tests_lang"'] = "Centralizer/vi tài liệu", ["'template"'] = "Bản mẫu", ["'template_vers"'] = "Centralizer/vi tài liệu",
["'module"'] = "Mô đun", ["'admins"'] = "3", ["'assets"'] = "77", ["'beginon"'] = "20180719 ?", ["'usedfrom"'] = "20180719 ?", },
-- Projects : MediaWikis wikidata wikipedia wikisource wikiquote meta test2
-- NOWNOW -- User = 2, Module = 828, Template = 10,
Ligne 837 ⟶ 807 :
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.activate_known_argumentsget_args;modes.activate_known_arguments_reportget_args_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 846 ⟶ 816 :
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 967 ⟶ 937 :
-- DUPLICATE NOWNOW, in change. toDoc
{ "---", "---", "---", "---", "---", "DUPLICATE NOW, in change", },
{ "2019020320181101", "2019020420181101", "NOW", "Rical", "S190102DDrS181101tgl", "DuplicateBegin: presenttranslate dropboxesby ingroups aof uniclanguages Template:Dropbox withlike redirectionfor fromviet, previewslaos, one'scambodgia, likeallways forwith en, es, fr 1 pagesdays", },
{ "2019020320181101", "2019020420181101", "NOW", "Rical", "S181101tglS181101aip", "Begin: translatewhen by10 groupsused ofcases, languagesannounce :that likein forthe vietphabtask, laos,then cambodgiawhen 20, allwaysthen with en, es,for frxmas 1 days", },
{ "2019020320181023", "2019020420181030", "NOW", "Rical", "S181101aipS181023s7P", "Begin: whensearch 107 usedProjects cases,: announceMediaWikis thatwikidata in the phabtask, then when 20,wikipedia thenwikisource forwikiquote xmas? 13 days", },
{ "2019012620181023", "2019020220181030", "NOW", "Rical", "S181023s7PS181023iLC", "Begin: searchRical invite 7 ProjectsLua-coders : MediaWikisTpt, wikidataZolo, wikipediaOd1n, wikisourceJulien1978, Daehan, wikiquoteVIGNERON ? 3 days", },
{ "20181020", "20181022", "NOW", "Rical", "S181020umf", "update MediaWiki:Scribunto/Central manual for ;activity.phabricator_tasks_report;activity.rough_date_days;...", },
{ "20190126", "20190202", "NOW", "Rical", "S181023iLC", "Begin: Rical invite 7 Lua-coders : Tpt, Zolo, Od1n, Julien1978, Daehan, VIGNERON ? 3 days", },
{ "2019012420181018", "2019012620181020", "NOW", "Rical", "S181020umfS181018CrC", "update MediaWikiModule:CentralSchool:Scribunto/Central manualfinish forreciprocal ;activity.phabricator_tasks_report;activity.rough_date_days;...adaptation with Module:Centralizer", },
{ "2019012220181016", "2019012420181017", "NOW", "Rical", "S181018CrCS181016vap", "Module:CentralSchool:restore finishversions.anti_crash(frame) reciprocalif adaptationnot withpcall() recursive in versions.tree_branch='v1;v2;v3' Module:Centralizer", },
{ "2019012120181015", "2019012220181016", "NOW", "Rical", "S181016vapS181015odd", "restoreone_arg versions.anti_crash(frame)has ifa notarg_default pcall()in recursivep.known_args inand a versions.tree_branchdelete = 'v1;v2;v3delete' ", },
{ "2019012020181015", "2019012120181016", "NOW", "Rical", "S181015odd", "one_argone_data has a arg_defaultdata_default in pdatas.known_argsknown_datas and a .delete = 'delete' ", },
{ "2019012020181015", "2019012120181016", "NOW", "Rical", "S181015odd", "one_dataone_mode has a data_defaultmode_default in datasmodes.known_datasknown_modes and a .delete = 'delete' ", },
{ "2019012020181015", "2019012120181016", "NOW", "Rical", "S181015odd", "one_modeone_version has a mode_defaultversion_default in modesversions.known_modesversion_args 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
{ "2019012020181014", "2019012020181014", "NOW", "Rical", "S190120mstS181014uft", "update function tab_view.form_one_case + translate from multiple_selection_test1(...", },
{ "2019012020181014", "2019012020181014", "NOW", "Rical", "S190120rntS181014uft", "update function tab_view.form_one_case + translate from recursive_normal_test1(...", },
{ "2019012020181014", "2019012020181014", "NOW", "Rical", "S190120uptS181014upt", "update activity.phabricator_tasks_report", },
{ "2019012020181014", "2019012020181014", "NOW", "Rical", "S190120ustS181014ust", "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", },
{ "20190120", "20190101", "todo", "Rical", "S190101cTD", "Ask a central Template:Dropbox for all mediawikis users you and me. on 20190101", },
{ "20190110", "20190115", "todo", "Rical", "S181222CrC", "Module:CentralSchool: finish reciprocal adaptation with Module:Centralizer", },
{ "20190108", "20190109", "todo", "Rical", "S181221oTc", 'others: ["Tactic"] = "canbenil;nevererror" ', },
{ "20180108", "20180109", "todo", "Rical", "S180108wtd", "Restore old function datas.wikidata_time_details()", },
{ "20180108", "20180109", "todo", "Rical", "S180108blg", "For each wikidata search the better lang in userlang, userlang2, pagelang, contentlang", },
Ligne 1 004 ⟶ 965 :
{ "20171001", "20171002", "todo", "Rical", "S170801cCD", "Create MediaWiki:Scribunto/CentralData (change from admin only)", },
{ "20171001", "20171002", "todo", "Rical", "S170801cCD", "Create Central/PageData/CentralData (change from any user)", },
{ "20170915", "20170917", "donetodo", "Rical", "S170915ajb", "phabtask extend tests_groups.subdiffs() to lua_table.trees.all_jobs", },
{ "20170910", "20170914", "todo", "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", "donetodo", "Rical", "S170910bob", "Create a button object for boxes, like drop_box with: n, states, shapes, keywords, colors", },
{ "20170828", "20170905", "todo", "Rical", "S170828dut", "delete unused tracker in _G : ARGS, IAMO, MAMO, tests_groups", },
{ "20170828", "20170905", "todo", "Rical", "S170820vtg", "try graphics in viewers.try_graph() -- see Macron", },
{ "20170816", "20170823", "todo", "Rical", "S170901adl", "automatize langs.dummy_languages() using isSupportedLanguage(xx)", },
Ligne 1 051 ⟶ 1 012 :
-- NOWNOW DP, NOW, in change
{ "---", "---", "---", "---", "---", "NOW, in change", },
{ "2019020320181101", "2019020420181101", "NOW", "Rical", "S190102DDrS181101tgl", "DuplicateBegin: presenttranslate dropboxesby ingroups aof uniclanguages Template:Dropbox withlike redirectionfor fromviet, previewslaos, one'scambodgia, likeallways forwith en, es, fr 1 pagesdays", },
{ "2019020320181101", "2019020420181101", "NOW", "Rical", "S181101tglS181101aip", "Begin: translatewhen by10 groupsused ofcases, languagesannounce :that likein forthe vietphabtask, laos,then cambodgiawhen 20, allwaysthen with en, es,for frxmas 1 days", },
{ "2019020320181023", "2019020420181030", "NOW", "Rical", "S181101aipS181023s7P", "Begin: whensearch 107 usedProjects cases,: announceMediaWikis thatwikidata in the phabtask, then when 20,wikipedia thenwikisource forwikiquote xmas? 13 days", },
{ "2019012620181023", "2019020220181030", "NOW", "Rical", "S181023s7PS181023iLC", "Begin: searchRical invite 7 ProjectsLua-coders : MediaWikisTpt, wikidataZolo, wikipediaOd1n, wikisourceJulien1978, Daehan, wikiquoteVIGNERON ? 3 days", },
{ "20181020", "20181022", "NOW", "Rical", "S181020umf", "update MediaWiki:Scribunto/Central manual for ;activity.phabricator_tasks_report;activity.rough_date_days;...", },
{ "20190126", "20190202", "NOW", "Rical", "S181023iLC", "Begin: Rical invite 7 Lua-coders : Tpt, Zolo, Od1n, Julien1978, Daehan, VIGNERON ? 3 days", },
{ "2019012420181018", "2019012620181020", "NOW", "Rical", "S181020umfS181018CrC", "update MediaWikiModule:CentralSchool:Scribunto/Central manualfinish forreciprocal ;activity.phabricator_tasks_report;activity.rough_date_days;...adaptation with Module:Centralizer", },
{ "2019012220181016", "2019012420181017", "NOW", "Rical", "S181018CrCS181016vap", "Module:CentralSchool:restore finishversions.anti_crash(frame) reciprocalif adaptationnot withpcall() recursive in versions.tree_branch='v1;v2;v3' Module:Centralizer", },
{ "2019012120181015", "2019012220181016", "NOW", "Rical", "S181016vapS181015odd", "restoreone_arg versions.anti_crash(frame)has ifa notarg_default pcall()in recursivep.known_args inand a versions.tree_branchdelete = 'v1;v2;v3delete' ", },
{ "2019012020181015", "2019012120181016", "NOW", "Rical", "S181015odd", "one_argone_data has a arg_defaultdata_default in pdatas.known_argsknown_datas and a .delete = 'delete' ", },
{ "2019012020181015", "2019012120181016", "NOW", "Rical", "S181015odd", "one_dataone_mode has a data_defaultmode_default in datasmodes.known_datasknown_modes and a .delete = 'delete' ", },
{ "2019012020181015", "2019012120181016", "NOW", "Rical", "S181015odd", "one_modeone_version has a mode_defaultversion_default in modesversions.known_modesversion_args 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
{ "2019012020181014", "2019012020181014", "NOW", "Rical", "S190120mstS181014uft", "update function tab_view.form_one_case + translate from multiple_selection_test1(...", },
{ "2019012020181014", "2019012020181014", "NOW", "Rical", "S190120rntS181014uft", "update function tab_view.form_one_case + translate from recursive_normal_test1(...", },
{ "2019012020181014", "2019012020181014", "NOW", "Rical", "S190120uptS181014upt", "update activity.phabricator_tasks_report", },
{ "2019012020181014", "2019012020181014", "NOW", "Rical", "S190120ustS181014ust", "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", },
{ "20190120", "20190120", "done", "Rical", "S181227trb", "treebranches -- For each sought. Replace known. Later on 201811207", },
{ "20190109", "20190109", "done", "Rical", "S181222SCi", "For 'Begin' Simplify function Central.init(frame, ...) using function 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 103 ⟶ 1 055 :
{ "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.activate_known_argumentsget_args()=known_argumentsargs_known +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 193 ⟶ 1 145 :
return t
end -- t = function activity.central_subtasks_report(t) -- Report the current state of subtasks, See "NOW".
 
 
activity.phabricator_tasks_Group = { -- toDoc
-- Importance: Important
-- { 000, "importance", "updateday", "TASKNBR", 0, "State", "Synthetic description of the phabricator task", }, -- Last update headers
{ 100, "Important", "2018112120190109", "T107595T168726", 0, "OpenTriage", "[RFC]Create syntax documentation page Multi-Contentfor RevisionsSpecial:PageData.", },
{ "Important", "20190108", "T107595", 0, "Assigned", "[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", "2018100520181231", "T173207T88416", 0, "Open", "Implement LuaProvide alternativeglobal touser {{int:Lang}}talk /page wgUserLanguage(header)", },
{ 104, "ImportantCentral", "2018081720181203", "T168726T121470", 0, "Open", "CreateCentral syntaxGlobal documentation pageRepository for Special:PageData.Templates, Lua modules, and Gadgets", },
{ 106, "Important", "2018080620181201", "T4085T107119", 0, "Open", "AddProvide a {{USERLANGUAGE}}/{{USERLANG}}Lua magicmethod wordmw.loadTemplateData()", }, -- See PageData
{ 108, "Important", "2018071020181005", "T107119T173207", 0, "OpenTriage", "Provide aImplement Lua methodalternative mw.loadTemplateData()to {{int:Lang}} / wgUserLanguage", }, -- See PageData
{ 110, "Important", "2018062620180805", "T135845T4085", 0, "AssignedOpen", "Convert any moduleAdd asa central{{USERLANGUAGE}}/{{USERLANG}} ormagic centralisableword", },
{ "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.
-- Known Importance: ToCreate, Triage, Stalled, Open, Assigned, Resolved, Close, Declined, Declined, Obsolete, Invalid. Assigned To None = Triage
{ 112, "Important", "20180603", "T85461", 0, "Resolved", "Lua error: too many language codes requested", },
--
-- T85461 https://meta.wikimedia.org/wiki/Module:Assemble_multilingual_message
{ "Important", "20180603", "T85461", 0, "Resolved", "Lua error: too many language codes requested", },
-- 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, "ResolvedAssigned", "Why Multi-Content-Revisions? Use cases and requirements.", },
-- Known Importance: ToCreate, Triage, Stalled, Open, Assigned, Resolved, Close, Declined, Declined, Obsolete, Invalid. Assigned To None = Triage
{ 120, "Important", "20170713", "T163923", 0, "Resolved", "Create Special:PageData as a canonical entry point for machine readable page data.", },
-- T149532 Why Multi-Content-Revisions? Use cases and requirements. Jul 27 2017, 00:40 Assigned: daniel
{ 106, "Important", "20170703", "T20170703", 0, "ToCreate", "Standardize content, page and user langages availability", },
{ "Important", "20170713", "T163923", 0, "Resolved", "Create Special:PageData as a canonical entry point for machine readable page data.", },
{ "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"
-- T20170703 : Standardize content, page and user langages availability
-- T20170703 : Content, page and user langages are not available nor defined in the same ways for scribunto modules.
-- T20170703 : That complicate modules which use them. Similar ways could enhance efficiency and reduce the development tasks.
{ 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 ...).
{ 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
{ 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
-- T122752: 20160102 22:46 See example https://fr.wikisource.org/wiki/Module:TestRequire
Ligne 1 243 ⟶ 1 200 :
-- T122752: (actu | diff) 2016-01-18T02:09:45‎ Rical (discussion | contributions | bloquer)‎ . . (319 599 octets) (+10 183)‎ . . (translate library.i18n first)
-- T122752: 2016-01-02 phabricator: T122752 Rical created this task. Sat, Jan 2, 2016-01-02 23:08
{ 156, "Important", "20180508", "T63958", 0, "Assigned", "Use existing $dateFormats to format dates on Wikidata", },
{ 160, "Important", "20170521", "T67687", 0, "Resolved", "mw.load_data can be used to pass data between #invoke's by reading frame arguments", },
--
-- Known Importance: ToCreate, Triage, Stalled, Open, Assigned, Resolved, Close, Declined, Declined, Obsolete, Invalid. Assigned To None = Triage
--
-- Importance: Central
{ 202, "Central", "20180701", "T198107", 0, "Open", "Begin to use central modules in 7 wikis S180625btu", },
{ 206, "Central", "20171106", "T20171106", 0, "ToCreate", "Lua-coders could better report bugs with recent MediaWiki versions for each wiki", },
{ 210, "Central", "2018100220180718", "T121470T52329", 0, "OpenStalled", "CentralWe Globalneed Repositorya common repository for Templates, LuaScribunto modules, and Gadgetstemplates", },
{ 214, "Central", "2018071820180312", "T52329T41610", 0, "StalledOpen", "WeScribunto needshould a common repository for Scribuntosupport modulesglobal andmodule templatesinvocations", },
{ 218, "Central", "20180312", "T41610", 0, "Open", "Scribunto should support global module invocations", },
-- T41610: subscriber: kaldari 2017-05-20, 16:03
-- T41610: You can include Lua modules in extensions and then register them with Scribunto as global modules.
Ligne 1 257 ⟶ 1 215 :
-- T41610: Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua
-- T41610: Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.lua
{ 224, "Central", "20170301", "T20170301", 0, "ToCreate", "Phabricator tasks states for easier versions management of modules", },
-- datas to get for each query: Task number, title, state, priority, Authored By and date, Last event date, number of subscribers, Assigned.
{ 228, "Central", "20170225", "T20170225", 0, "ToCreate", "? Report MediaWiki changes for the versions management, and use {{subst:}}", },
-- T20170225: The gerrit team needs the date of a bug and the dates of mw install in each wiki to debug mw.
-- T20170225: We could detect, record and report all date-time changes of MediaWiki, for some weeks.
-- T20170225: We could use {{subst:}} in 2 ways. See https://www.MediaWiki.org/wiki/Manual:Substitution
-- T20170225: duplicate of T121470: Central Global Repository for Templates, Lua modules, and Gadgets.
{ 230, "Central", "20170314", "T1238", 0, "Close", "Central Code Repository for code used on wikis (Templates, Lua modules, Gadgets)", },
--
-- Importance: Other
{ 302, "Other", "20180320", "T147618", 0, "Open", "Localize one or more major WMF software products related to new editor retention to hu.wikipedia", },
{ 304, "Other", "20180320", "T132308", 0, "Open", "Internationalise citoid dates", },
{ 306, "Other", "20180320", "T142906", 1, "Close", "Data access in user language doesn't obey the uselang get parameter", },
{ 308, "Other", "20180106", "T104109", 0, "Close", "No syntax highlight for large JavaScript/CSS/Lua/API pages", },
{ 310, "Other", "20170427", "T162877", 0, "Close", "CodeEditor default changed if you have never used the toggle", },
{ 312, "Other", "20170427", "T161875", 0, "Close", "CodeEditor is always enabled when starting an edit on a page containing code", },
-- T161875: Actual: It is enabled, though mw.user.options.get('usecodeeditor') correctly gives 0.
{ 314, "Other", "20180412", "T85412", 0, "Open", "The formatPropertyValues needs an option to format data from date-time, angle or geographic coordinates", },
{ 316, "Other", "20170912", "T156048", 0, "Open", "Add syntax highlighting to wiki diff of source code pages (like Gerrit)", },
{ 318, "Other", "20180710", "T107119", 0, "Open", "Provide a Lua method mw.loadTemplateData()", },
{ 320, "Other", "20170524", "T166202", 0, "Open", "Strings defined as long comments give a Lua modules syntax error", },
--
-- Other, ToCreate or not
{ 321, "Other", "20170213", "T20170213", 0, "ToCreate", "Some languages have not French names in French language", },
{ 322, "Other", "20151215", "T20151215", 0, "ToCreate", "In some cases the box of the drop_box is not displayed", },
-- T20151215: .. "\n------ " -- This code interact with drop_box and debug the task T20151215 2016-11-13 17:57.
-- T20151215: if there is "\n------ " before editDocBox and then the editDocBox <div> is only a bar of 1 em hight, and its content is after the <div>. Rical 2016-10-24 08:15.
{ 326, "Other", "20160616", "T20160616", 0, "ToCreate", "? Add module and library types in scribunto ?", },
-- T20160616: get.is_library = ( true ) -- true if the object is a library
{ 328, "Other", "20171007", "T155624", 0, "Open", "Special:Version not showing SHA info for MediaWiki version on fr.wikisource", },
-- UTC-20170407-20:21 : reported in T155624 Special:Version not showing SHA info for MediaWiki version on fr.wikisource
--
-- Known Importance: ToCreate, Triage, Stalled, Open, Assigned, Resolved, Close, Declined, Declined, Obsolete, Invalid. Assigned To None = Triage
--
-- Importance: Obsolete: Do not create, these functions come from mw... libraries.
{ 428, "Obsolete", "20161022", "T20161022", 0, "ToCreate", "? Scribunto functions are out of package.loaded", },
-- T20161022: -- Found in Lua_reference_manual but not in Module:Centralizer-s-fr :
-- T20161022: -- 2016-10-22 15:45 : versions.all_G_and_loaded_list() : Variables in _G global space without libraries and modules in packageloaded. ,
Ligne 1 296 ⟶ 1 256 :
-- assert = function , ipairs = function , rawequal = function , getmetatable = function , rawset = function , pcall = function , type = function ,
-- selector = function , rawget = function , tonumber = function , error = function , setmetatable = function
{ 430, "Obsolete", "20170324", "T133498", 1, "Declined", "Detect and extend known title <-> entity links in a semi-automatic way", },
{ 432, "Obsolete", "20161128", "T151715", 0, "Invalid", 'string.gsub( s, "%%1", repl) fails as "invalid capture index"', },
{ 434, "Obsolete", "20170110", "T154769", 0, "Invalid", 'When "Erreur Lua : attempt to call a string value", where?', },
-- T154769: Rical 2017-01-08 My main mistake was to write xpcall() where pcall() is right.
-- T154769: Tests are there https://fr.wikisource.org/wiki/Module:Phab.T154769.Test
-- T154769: versions.anti_crash() preserve pages against residual errors which can crash pages.
{ 436, "Obsolete", "20170202", "T155898", 0, "Invalid", "Preview change from external local editors", },
-- T155898: OK, I will continue to search in JEdit plugins. Perhaps I will ask them an adapted solution.
{ 438, "Obsolete", "20160424", "T67507", 0, "Resolved", "It should be possible to get entity id from page title", },
{ 440, "Obsolete", "20160524", "T119978", 0, "Invalid", "Get name and record-time of all modules to better manage their versions", },
{ 442, "Obsolete", "20160813", "T75460", 0, "Resolved", "[Story] Make Lua functions default to the user's language on multilingual wikis", },
} -- activity.phabricator_tasks_Group = {...}
 
Ligne 1 313 ⟶ 1 273 :
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 613 ⟶ 1 573 :
-- 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.
known_arguments_countryargs_known_country = "England", -- English
known_arguments_flagargs_known_flag = "Flag_of_England.svg", -- English
known_arguments_monumentargs_known_monument = "St_Pauls_aerial_%28cropped%29.jpg", -- English St Paul's Cathedral
known_arguments_townargs_known_town = "London", -- English
datas_Wikidata_header = "Datas: ",
datas_known_Datas_header = "Known datas: ",
Ligne 1 645 ⟶ 1 605 :
-- Para traducir, no traduzca partes como estas: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
-- Wikidata
known_arguments_countryargs_known_country = "España", -- Spanish
known_arguments_flagargs_known_flag = "Flag_of_Spain.svg", -- Flag of Spain
known_arguments_monumentargs_known_monument = "MADRID_100206_UDCI_023.jpg", -- Puerta del Sol
known_arguments_townargs_known_town = "Madrid", -- Capital city
datas_Wikidata_header = "Datos: ",
datas_known_Datas_header = "Datos conocidas: ",
Ligne 1 676 ⟶ 1 636 :
-- 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.
-- Wikidata
known_arguments_countryargs_known_country = "France", -- French
known_arguments_flagargs_known_flag = "Flag_of_France.svg.png", -- French
known_arguments_monumentargs_known_monument = "Tour Eiffel", -- French
known_arguments_townargs_known_town = "Paris", -- French
datas_Wikidata_header = "Données : ",
datas_known_Datas_header = "Données connues : ",
Ligne 1 764 ⟶ 1 724 :
local i = 0
-- t = t .. "\n* Guideline for this stat : Count lists of translations by languages and libraries, then convert in a 2D table, then format and report them."
local known_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {} -- optional value from p.known_argumentsargs_known = {...}
for key, one_argargmt in pairs(known_argumentsargs_known) do -- For all known parameters
if type(one_argargmt.prop) == "string" then
i = i + 1 ; t = t .. viewers.ta(one_argargmt.keyword, one_argargmt.prop)
end
end
Ligne 1 867 ⟶ 1 827 :
end
 
function datas.property(one_argargmt) -- Get datas from mwwikibase for one property of the page.
one_argargmt = mw.clone(one_argargmt) -- avoid any interaction with other properties.
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 "Q34743" -- Rudyard Kipling
Ligne 1 875 ⟶ 1 835 :
local label = nil
local val = nil
if one_argargmt.prop then -- Admit any type of keyword and prop.
one_argargmt.keyword = one_argargmt.keyword or one_argargmt.key or one_argargmt.prop
one_argargmt.prop = one_argargmt.prop -- Get datas from mwwikibase for one property of the page.
if one_argargmt.prop == "QITEM" then val = mw.wikibase.getEntityIdForCurrentPage() -- use props.QITEM Returns the Item id as string, like "Q42"
elseif one_argargmt.prop == "label" then val = datas.item:getLabel(QITEM) ; label = label or val -- use props.label Returns a string, like "Berlin" with 'de'
elseif one_argargmt.prop == "sitelink" then val = datas.item:getSitelink() -- use props.sitelink like Author:Aristotel
elseif one_argargmt.prop == "labelwithlang" then val = mw.wikibase.entity:getLabelWithLang() -- use props.labelwithlang -- Returns a string like "Berlin" and a language like
elseif one_argargmt.prop == "description" then val = mw.wikibase.description(QITEM) -- use props.description -- ric : Description of the QITEM page
elseif one_argargmt.prop == "labelcontent" then val = mw.wikibase.getLabelByLang(QITEM, langs.content_lang) ; label = label or val -- Returns the content_lang label of the item
elseif one_argargmt.prop == "labelpage" then val = mw.wikibase.getLabelByLang(QITEM, langs.page_lang) ; label = label or val -- Returns the page_lang label of the item
elseif one_argargmt.prop == "labeluser" then val = mw.wikibase.getLabelByLang(QITEM, langs.user_lang or "en") ; label = label or val -- Returns the user_lang label of the item
else -- ric (p.box_read)
loc.formatPropertyValues = datas.item:formatPropertyValues( one_argargmt.prop ) -- like "P123"
-- Returns a table like: { value = "Formatted claim value", label = "Label of the Property" }
if loc.wd_RANK_TRUTH then
loc.formatPropertyValues = datas.item:formatPropertyValues( one_argargmt, { loc.wd_RANK_TRUTH } )
end
if loc.wd_claimRanks then
loc.formatPropertyValues = datas.item:formatPropertyValues( one_argargmt, { loc.wd_claimRanks } )
end
val = loc.formatPropertyValues.value
end
val = tostring(val)
if one_argargmt.format == "year" then val = mw.ustring.sub( val, -4, -1 ) end
val = tostring(val)
one_argargmt.val = val
end --function modes.activate_known_argumentsget_args(
one_argargmt.label = label or one_argargmt.label or one_argargmt.labeluser or one_argargmt.labelcontent or one_argargmt.labelpage or one_argargmt.labelbylang
one_argargmt = mw.clone(one_argargmt) -- avoid any interaction with other properties.
return one_argargmt
end -- one_argargmt = datas.property(one_argargmt) -- Get datas from mwwikibase for one property of the page.
 
function datas.get_item(known_argumentsargs_known, QITEM) -- Get datas from mw.wikibase for the page.
-- from 2016-08-16 ModuleCentral 3a lua_table.to_list.lua
local known_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {} -- optional value from p.known_argumentsargs_known = {...}
local t = "\n* <b>datas.get_item(known_argumentsargs_known, 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 kipling
datas.QITEM = QITEM
datas.item = mw.wikibase.getEntity(datas.QITEM or "Q34743") -- Rudyard Kipling
local props = {} -- All properties form known_argumentsargs_known with one_argargmt.prop.
local prop = {} -- to collect properties
local loc = {} -- local values
for key, one_argargmt in pairs(known_argumentsargs_known) do -- For all known parameters
if type(one_argargmt) == "table" then
one_argargmt.key = key
one_argargmt.syn = one_argargmt.syn or 0
one_argargmt = datas.property(one_argargmt) -- Get datas from mwwikibase for one property of the page. function datas.property(
if one_argargmt.keyword == "QITEM" then one_argargmt.val = QITEM end
if one_argargmt.prop then -- Admit any type of keyword and prop.
props[one_argargmt.keyword] = mw.clone(one_argargmt)
prop[one_argargmt.keyword] = one_argargmt.val -- ric (p.box_read)
end
end
Ligne 1 935 ⟶ 1 895 :
datas.prop = prop
return prop, props
end -- local prop, props = datas.get_item(known_argumentsargs_known, QITEM) -- Get datas from mw.wikibase for the page.
 
function datas.get_item_report(t) -- datas.get_item() Report datas from mw.wikibase for the page **
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_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {} -- modes.known_argumentsargs_known = { -- p.known_argumentsargs_known = { -- }
local prop, props = datas.get_item(known_argumentsargs_known, 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 2 072 ⟶ 2 032 :
-- 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.formatsform(one_eventevt) -- Format events types
-- events.all_categories_test(t) -- test categories
-- - - - ------------------ - - - - ---------------------------------
Ligne 2 182 ⟶ 2 142 :
end
 
function events.formats_catform_cat(one_eventevt, txt, lnk, c, space)
local space = space or (mw.site.namespaces.Category.name .. ":")
local c = c or one_eventevt.ccc or ":"
if one_eventevt.typ == "cat" then -- Format a category to display or activate
one_eventevt.content_wkt = viewers.form9content(one_eventevt.key, lua_table.to_list( one_eventevt.vals ) )
one_eventevt.page_wkt = viewers.form9page(one_eventevt.key, lua_table.to_list( one_eventevt.vals ) )
one_eventevt.user_wkt = viewers.form9user(one_eventevt.key, lua_table.to_list( one_eventevt.vals ) )
return " [[" .. c .. space .. (one_eventevt.content_wkt or lnk) .. "|" .. (one_eventevt.user_wkt or txt) .. "]] "
else
return ""
Ligne 2 195 ⟶ 2 155 :
end
 
events.all_events_grouplist_all_events = {} -- Table to collect all events types "err", "wng" and "cat".
 
function events.new(typ, key, ...) -- Initialize and finalize a new event.
local one_eventevt = {} -- default event
if type(typ) == "table" then
one_eventevt = typ -- Use a predefined event
else -- To finalize an existing event.
one_eventevt.typ = typ
one_eventevt.key = key
end -- Finalize all events
one_eventevt.typ = one_eventevt.typ or typ -- Type of event: err, wng, cat
one_eventevt.key = one_eventevt.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_eventevt.name = one_eventevt.typ or one_eventevt.key or "name" -- Translation key, simple or extended by name
one_eventevt.vals = one_eventevt.vals or { ... } -- table of arguments values
one_eventevt.catview = one_eventevt.catview or ":" -- Default value for eventual use
-- Check, yes or no, to form an event, in special cases
if (one_eventevt.typ == "cat") then
one_eventevt.res, one_eventevt = events.formatsform( one_eventevt ) -- Formats the resulting wikitext, can be re-form later
elseif (one_eventevt.typ == "err") then
one_eventevt.res, one_eventevt = events.formatsform( one_eventevt ) -- Formats the resulting wikitext, can be re-form later
elseif (one_eventevt.typ == "wng") then
one_eventevt.res, one_eventevt = events.formatsform( one_eventevt ) -- Formats the resulting wikitext, can be re-form later
end
return one_eventevt
end -- function events.new(typ, key, ...)
 
function events.add_new(one_eventevt) -- Add a error, warning or category in the lists. S170626rev
-- Select only new events
if type(one_eventevt) ~= "table" then one_eventevt = {} end
local new_one_eventnew_evt = viewers.form9tests( tostring(one_eventevt.key), lua_table.to_list( one_eventevt.vals ) )
for i, event in pairs(events.all_events_grouplist_all_events) do
local old_one_eventold_evt = viewers.form9tests( tostring(event.key), lua_table.to_list( event.vals ) )
if new_one_eventnew_evt == old_one_eventold_evt then new_one_eventnew_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_one_eventnew_evt then table.insert(events.all_events_grouplist_all_events, one_eventevt) end
return one_eventevt
end -- function events.add_new(typ, ref, ...)
 
Ligne 2 241 ⟶ 2 201 :
-- Guide line: We can view or categorize categories.
local intern_or_use = versions.memo_i18n["en"][key]
local one_eventevt = events.new(typ, key, ...) -- Initialize and finalize a new event.
local one_eventevt = events.add_new(one_eventevt) -- Add an error, warning or category in the lists. S170626rev
local res, one_eventevt = events.formatsform(one_eventevt, c) -- Format an event as an error, warning or category.
return res, one_eventevt
end -- local res, one_eventevt = events.add_record(typ, key, ... )
 
function events.formatsform(one_eventevt, c) -- Format an event as an error, warning or category.
one_eventevt.res = tostring(one_eventevt.res) .. "? form " .. viewers.form9tests(".form one_eventevt.key=%1, one_eventevt.res=%2, ", one_eventevt.key, one_eventevt.res )
local one_eventevt = mw.clone(one_eventevt) -- do not disturb input event
if type(one_eventevt) ~= "table" then
one_eventevt.res = lua_table.rough_view(one_eventevt)
return one_eventevt.res, one_eventevt
end
if (one_eventevt.typ ~= "cat") and (one_eventevt.typ ~= "wng") and (one_eventevt.typ ~= "err") then
one_eventevt.res = lua_table.rough_view(one_eventevt)
return one_eventevt.res, one_eventevt
end
one_eventevt.tableStyle = one_eventevt.tableStyle or "" -- Could change the style of the wikitext. Not available on 20160916
if type(one_eventevt.name) ~= "string" then one_eventevt.name = ""
elseif one_eventevt.name ~= "" then one_eventevt.name = one_eventevt.name .. "_" end
one_eventevt.idargs = one_eventevt.name .. tostring( viewers.form9user( tostring(one_eventevt.key), lua_table.to_list( one_eventevt.vals ) ) )
-- Each type of event formats its own type of wikitext
one_eventevt.content_wkt = viewers.form9content(one_eventevt.key, lua_table.to_list( one_eventevt.vals ) )
one_eventevt.page_wkt = viewers.form9page(one_eventevt.key, lua_table.to_list( one_eventevt.vals ) )
one_eventevt.user_wkt = viewers.form9user(one_eventevt.key, lua_table.to_list( one_eventevt.vals ) )
one_eventevt.res = "" -- multilingual
if one_eventevt.typ == "err" then one_eventevt.res = viewers.styles_color_error(one_eventevt.user_wkt) end
if one_eventevt.typ == "wng" then one_eventevt.res = viewers.styles_color_warning(one_eventevt.user_wkt) end
one_eventevt.ccc = c or one_eventevt.catview or events.catview or ":"
one_eventevt.content_catspace = mw.site.namespaces.Category.name -- name: Local namespace name.
if one_eventevt.typ == "cat" then -- Format a category to display or activate
one_eventevt.res = events.formats_catform_cat(one_eventevt)
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")
Ligne 2 280 ⟶ 2 240 :
end
end
return one_eventevt.res, one_eventevt
end -- function events.formatsform(one_eventevt, c)
 
events.all_kinds_test_test_group = {
Ligne 2 303 ⟶ 2 263 :
rowGroup = {},
}
function tab_view.form_one_case(one_eventevt) -- Convert a case from test_group to rowGroup.
return { one_eventevt.typ or "t", one_eventevt.key or "k", one_eventevt.idargs or "i", one_eventevt.res or "r" }
end
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
Ligne 2 323 ⟶ 2 283 :
cats = cats .. events.add_cat(groupCat, wkt)
end
local res, one_eventevt = events.add("catGroup", groupCat, cats) -- Add an event to a group.
one_eventevt.trc = one_eventevt.trc .. viewers.form9user("\n* add_cat one_eventevt.typ=%1, one_eventevt.key=%2, ", one_eventevt.typ, one_eventevt.key)
return res, one_eventevt
end -- function events.add_cat_group(groupCat, groupList)
 
function events.select_typ(typ) -- Select events by one type
local is = {}
for i, one_eventevt in pairs(events.test_group) do
if one_eventevt.typ == typ then table.insert( is, one_eventevt.idargs ) end
end
return is
Ligne 2 338 ⟶ 2 298 :
function events.sort_typ() -- Sort events by type in wng, err, cat.
local wng, err, cat = {}, {}, {}
for i, one_eventevt in pairs(events.test_group) do
if one_eventevt.typ == "wng" then table.insert( wng, one_eventevt ) end
if one_eventevt.typ == "err" then table.insert( err, one_eventevt ) end
if one_eventevt.typ == "cat" then table.insert( cat, one_eventevt ) end
end
return wng, err, cat
end -- function events.sort_typ()
 
function events.selector( tab_view, one_eventevt )
if type(one_eventevt) ~= "table" then
one_eventevt = { -- options for tableview.new() -- Formats a table with lines and columns.
headers = "typ;key;selector-name;wkt",
style = "",
Ligne 2 355 ⟶ 2 315 :
}
else
one_eventevt.headers = one_eventevt.headers or "typ;key;else-name;wkt"
one_eventevt.tableStyle = one_eventevt.tableStyle or ""
one_eventevt.name = one_eventevt.name or "_"
one_eventevt.typ = one_eventevt.typ or "nil"
end
if (type(tab_view) == "table") and (type(tab_view.typ) == "string") and (tab_view.typ == one_eventevt.typ) then
table.insert( tab_view.test_group, { one_eventevt.typ, one_eventevt.key, one_eventevt.name, one_eventevt.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_eventevt.typ, one_eventevt.key, one_eventevt.name, one_eventevt.wkt } )
else
tab_view = {}
table.insert( tab_view.test_group, { one_eventevt.typ, one_eventevt.key, one_eventevt.name, one_eventevt.wkt } )
end
end -- function events.selector( tab_view, one_eventevt )
 
function events.all_kinds_test_test(t) -- Test: all kinds of events (err, wng, cat)
Ligne 2 378 ⟶ 2 338 :
headers = "events_all_kinds_tests_headers", -- "typ;key;idargs;result",
}
function tab_view.form_one_case(one_eventevt) -- Convert a case from test_group to rowGroup.
return { one_eventevt.typ, one_eventevt.key, one_eventevt.idargs, one_eventevt.res }
end
t = t .. tableview.new(tab_view) -- Form a table view with lines and columns.
Ligne 2 418 ⟶ 2 378 :
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.formatsform(one_eventevt, 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_eventevt in pairs(events.all_events_grouplist_all_events) do
one_eventevt = events.formatsform(one_eventevt, c) -- Format an event as an error, warning or category.
table.insert(gener, one_eventevt ) -- Build a table with translations counts.
end
return gener
end -- function events.gener_categories(known_argumentsargs_final)
 
function events.categories_lister(c) -- Categorize categories, or view categories if c=":".
Ligne 2 435 ⟶ 2 395 :
-- c can replace cat_view to enforce the documentation or the categorisation
c = c or modes.cat_view or ""
for k, one_eventevt in pairs(events.all_events_grouplist_all_events) do
if (one_eventevt.typ == "cat") then
local keyuser = viewers.form9user(one_eventevt.key)
local keycontent = viewers.form9content(one_eventevt.key)
res = res .. events.formats_catform_cat(one_eventevt, keyuser, keycontent, c)
end
end
Ligne 2 911 ⟶ 2 871 :
t = t .. "\n* Guideline 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_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {} -- modes.known_argumentsargs_known = { -- p.known_argumentsargs_known = { -- }
local translate_i18n = versions.memo_i18n
local all_stats = {} -- all_stats + Total
Ligne 3 049 ⟶ 3 009 :
local modesCont, modesPage, modesUser = nil, nil, nil
if modes.args_source then -- and modes.args_source.userlang Does module arguments ask a content_lang?
local modes_args = modes.known_argumentsargs_final or modes.args_source -- work after full init or before
modesCont = modes_args.contentlang
modesPage = modes_args.pagelang
Ligne 3 777 ⟶ 3 737 :
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 819 ⟶ 3 743 :
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = {
{ "Simple table", { 123, "abc", 456,key = "deftxt", }, },
{ "TextAll andtypes numbertransmited", { "onename", 111, true, false, { 789, "xyz"}, function()end }, },
{ "Function and Logic", { function()end, true, false,}, },
{ "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.to_list() Return a list from a Lua table.",
Ligne 3 841 ⟶ 3 771 :
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 4 961 ⟶ 4 834 :
modes_list_all_args_main_title = "modes.list_all_args_main() Liste de tous les arguments acceptés",
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_titlemodes_args_known_structure_title = "modes.known_arguments_structureargs_known_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 976 ⟶ 4 849 :
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_titlemodes_args_known_report_title = "modes.known_arguments_reportargs_known_report(t) Rapport des principaux arguments connus.",
modes_known_arguments_report_headersmodes_args_known_report_headers = "clé; valeur; type; nécessaire; mot-clé; synonyme; propriété; format; source; commentaire",
modes_get_args_report_title = "modes.activate_known_argumentsget_args() Valeurs des argument dans p.known_argumentsargs_known{}.", -- fr
} -- modes.i18n.br
 
Ligne 5 072 ⟶ 4 945 :
modes_list_all_args_main_title = "modes.list_all_args_main() Liste aller akzeptierten Argumente",
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_titlemodes_args_known_structure_title = "modes.known_arguments_structureargs_known_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 5 087 ⟶ 4 960 :
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_titlemodes_args_known_report_title = "modes.known_arguments_reportargs_known_report(t) Bericht der wichtigsten bekannten Argumente.",
modes_known_arguments_report_headersmodes_args_known_report_headers = "Schlüssel; Wert; Art;tippen erforderlich;Sie Stichwortein; Synonymnotwendig Schlüsselwort Synonyme; Eigentum; Format; Quelle; KommentarBrunnen",
modes_get_args_report_title = "modes.activate_known_argumentsget_args() Werte der Argumente in p.known_argumentsargs_known{}.", -- es
} -- modes.i18n.de
 
Ligne 5 171 ⟶ 5 044 :
--
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 modesmode.",
-- modes_auto_val_warning_wng = "Verify the automatic argument: <b>%1</b> = <b>%2</b>.",
modes_auto_val_warning_wng = "Verify the automatic arguments.",
Ligne 5 185 ⟶ 5 058 :
modes_list_all_args_main_title = "modes.list_all_args_main() List of all accepted arguments",
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_titlemodes_args_known_structure_title = "modes.known_arguments_structureargs_known_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 5 201 ⟶ 5 074 :
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_titlemodes_args_known_report_title = "modes.known_arguments_reportargs_known_report(t) Report of main known args.",
modes_known_arguments_report_headersmodes_args_known_report_headers = "key; valueval; type; necessaryneed; keyword; synonymoussyn; propertyprop; format; source; comment",
modes_get_args_report_title = "modes.activate_known_argumentsget_args() Values of the arguments in p.known_argumentsargs_known{}.", -- en
} -- modes.i18n.en
 
Ligne 5 297 ⟶ 5 170 :
modes_list_all_args_main_title = "modes.list_all_args_main() Lista de todos los argumentos aceptados",
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_titlemodes_args_known_structure_title = "modes.known_arguments_structureargs_known_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 5 312 ⟶ 5 185 :
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_titlemodes_args_known_report_title = "modes.known_arguments_reportargs_known_report(t) Informe de los principales argumentos conocidos.",
modes_known_arguments_report_headersmodes_args_known_report_headers = "clave; valor; tipo; es necesario; palabra clave; sinónimos; propiedad; formato; fuente; comentario",
modes_get_args_report_title = "modes.activate_known_argumentsget_args() Valores de los argumentos en p.known_argumentsargs_known{}.", -- es
} -- modes.i18n.es
 
Ligne 5 408 ⟶ 5 281 :
modes_list_all_args_main_title = "modes.list_all_args_main() Liste de tous les arguments acceptés",
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_titlemodes_args_known_structure_title = "modes.known_arguments_structureargs_known_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 423 ⟶ 5 296 :
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_titlemodes_args_known_report_title = "modes.known_arguments_reportargs_known_report(t) Rapport des principaux arguments connus.",
modes_known_arguments_report_headersmodes_args_known_report_headers = "clé; valeur; type; nécessaire; mot-clé; synonyme; propriété; format; source; commentaire",
modes_get_args_report_title = "modes.activate_known_argumentsget_args() Valeurs des argument dans p.known_argumentsargs_known{}.", -- fr
} -- modes.i18n.fr
 
Ligne 5 520 ⟶ 5 393 :
modes_list_all_args_main_title = "modes.list_all_args_main() Az elfogadott érvek listája",
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_titlemodes_args_known_structure_title = "modes.known_arguments_structureargs_known_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 535 ⟶ 5 408 :
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_titlemodes_args_known_report_title = "modes.known_arguments_reportargs_known_report(t) A legfontosabb ismert érvekről szóló jelentés.",
modes_known_arguments_report_headersmodes_args_known_report_headers = "kulcs; érték; fajtájaírja; szükséges; kulcsszó; szinonimájafordítása; tulajdon; formátumban; forrás; megjegyzés",
modes_get_args_report_title = "modes.activate_known_argumentsget_args() Az érvek értékei p.known_argumentsargs_known{}.", -- es
} -- modes.i18n.hu
 
Ligne 5 630 ⟶ 5 503 :
modes_list_all_args_main_title = "modes.list_all_args_main() Danh sách tất cả các đối số được chấp nhận",
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_titlemodes_args_known_structure_title = "modes.known_arguments_structureargs_known_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 645 ⟶ 5 518 :
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_titlemodes_args_known_report_title = "modes.known_arguments_reportargs_known_report(t) Báo cáo để các đối số được biết đến chính.",
modes_known_arguments_report_headersmodes_args_known_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_get_args_report_title = "modes.activate_known_argumentsget_args() Giá trị để các đối số trong p.known_argumentsargs_known{}.",
} -- modes.i18n.vi
 
Ligne 5 675 ⟶ 5 548 :
-- 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 modesmode.
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_argumentsargs_known = { -- Table of the definitions of all known arguments at module level.
-- Arguments in order without names, with their keyword for use as other arguments.
[1] = {need = 0, syn = 2, keyword = "mode"},
-- Special arguments to modify the fonctions and outputs of this module.
mode = {typ = "config", need = 0, keyword = "mode"},
Ligne 5 692 ⟶ 5 566 :
}
 
function modes.bind_known_arguments_propsbind_args_known_props(known_argumentsargs_known, args_new) -- Bind known args and their properties for central libraries. Later for modules.
local known_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {}
if (type(known_argumentsargs_known) ~= "table") then return {} end
local known_arguments_oneargs_known_one = {}
if (type(args_new) ~= "table") then return known_argumentsargs_known end
for key, props in pairs(args_new) do -- import and mix known args and properties
if (type(props) == "table") then
known_arguments_oneargs_known_one[key] = props or known_argumentsargs_known[key]
props.key = key
end -- Add properties for a new argument
end
return known_arguments_oneargs_known_one
end -- local known_arguments_propsargs_known_props = modes.bind_known_arguments_propsbind_args_known_props(known_argumentsargs_known, args_new)
 
function modes.known_arguments_one_libargs_known_one_lib(known_argumentsargs_known, args_new) -- Bind known args and their properties for central libraries. Later for modules.
local known_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {} -- modes.known_argumentsargs_known = { -- p.known_argumentsargs_known = { -- }
if (type(known_argumentsargs_known) ~= "table") then return {} end
local known_arguments_propsargs_known_props = {}
for key, one_lib in pairs(args_new) do -- import and mix known args and properties
if (type(one_lib) == "table") then
bind_args = modes.bind_known_arguments_propsbind_args_known_props(known_argumentsargs_known, args_new)
known_arguments_propsargs_known_props = modes.bind_known_arguments_propsbind_args_known_props(modes.known_argumentsargs_known, args_new)
end
end
return known_arguments_propsargs_known_props
end -- function modes.known_arguments_one_libargs_known_one_lib(known_argumentsargs_known, args_new)
 
function modes.bind_known_arguments_one_lib_reportbind_args_known_one_lib_report(t) -- Report the binding of one library known args.
local memo = viewers.save_configs("modes.bind_known_arguments_one_lib_reportbind_args_known_one_lib_report") -- Save global configuration before eventual changes.
local t = t or "\n* mathroman.known_arguments_one_libargs_known_one_lib(t) Report the binding of one library known args."
local known_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {} -- modes.known_argumentsargs_known = { -- p.known_argumentsargs_known = { -- }
local known_arguments_propsargs_known_props = modes.known_arguments_one_libargs_known_one_lib(modes.known_argumentsargs_known, mathroman.known_argumentsargs_known)
t = t .. "\n* " .. viewers.ta("#known_arguments_propsargs_known_props", lua_table.level_count(known_arguments_propsargs_known_props) )
if (type(known_argumentsargs_known) ~= "table") then return known_argumentsargs_known end
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = known_argumentsargs_known,
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, }
end,
title_memo = "modes_bind_known_arguments_report_titlemodes_bind_args_known_report_title",
title_memo = "modes.bind_known_arguments_one_lib_reportbind_args_known_one_lib_report(t) Report the binding of one library known args. **",
headers = "modes_bind_known_arguments_report_headersmodes_bind_args_known_report_headers",
headers = "key;bind;typ;need;keyword;prop;format",
}
t = t .. "<br/>" .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
viewers.restore_configs(memo, "modes.bind_known_arguments_one_lib_reportbind_args_known_one_lib_report") -- Restore global configurations after eventual changes.
return t
end -- function modes.bind_known_arguments_one_lib_reportbind_args_known_one_lib_report(t)
 
function lua_table.sort_onkey(tab, key) -- Sort a table with any types of keys.
Ligne 5 751 ⟶ 5 625 :
end
 
function modes.known_arguments_reportargs_known_report(t, known_argumentsargs_known) -- Report of main known args.
local memo = viewers.save_configs("modes.known_arguments_reportargs_known_report") -- Save global configuration before eventual changes.
local t = t or "\n* <b>modes.known_arguments_reportargs_known_report(t)</b> Report of main known args."
local known_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {} -- modes.known_argumentsargs_known = { -- p.known_argumentsargs_known = { -- }
local args_group = {} -- modes.known_argumentsargs_known = { -- p.known_argumentsargs_known = { -- }
for key, tab in pairs(known_argumentsargs_known) do -- import and mix known args and properties
table.insert( args_group, tab )
end
local prop, props = datas.get_item(known_argumentsargs_known, QITEM) -- Get datas from mw.wikibase for the page. ric
table.sort(props, function (a, b) return ( (a.keyword or a.prop) < (b.keyword or b.prop)) end ) -- alphabetic sort of translated arguments
t = t .. "\n* " .. viewers.ta("known_argumentsargs_known count", lua_table.level_count(known_argumentsargs_known) )
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_reportargs_known_report(t) Report of main known args. **",
title_memo = "modes_known_arguments_report_titlemodes_args_known_report_title", -- "modes.known_arguments_reportargs_known_report(t) Rapport des principaux arguments connus.",
headers = "modes_known_arguments_report_headersmodes_args_known_report_headers", -- headers = "key; valueval; type; necessaryneed; keyword; synonymoussyn; propertyprop; 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,
}
t = t .. "<br/>" .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
viewers.restore_configs(memo, "modes.known_arguments_reportargs_known_report") -- Restore global configurations after eventual changes.
return t
end -- function modes.known_arguments_reportargs_known_report(t, known_argumentsargs_final)
 
function modes.init_options(template_options)
Ligne 5 956 ⟶ 5 830 :
end -- function modes.change_itemid(id_in)
 
function modes.known_arguments_structureargs_known_structure(t, known_argumentsargs_known) -- modes_known_arguments_structure_titlemodes_args_known_structure_title = Table structure of arguments
-- if true then return "" end -- to DEBUG : S170606aks
local t = t or "\n* <b>known_arguments_structureargs_known_structure :</b> " -- modes_list_all_args_main_title
local tt
local known_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {} -- optional value from p.known_argumentsargs_known = { }
if type(known_argumentsargs_known) == "table" then
for key, elem in pairs(known_argumentsargs_known) 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("format", elem.format)
Ligne 5 970 ⟶ 5 844 :
end
return t
end -- function modes.known_arguments_structureargs_known_structure(t, known_argumentsargs_known)
 
function modes.levenshtein(word1, word2) -- Compute the Levenshtein distance between 2 ASCII words.
Ligne 6 106 ⟶ 5 980 :
 
-- For an unknown argument, seeks the name of the closest among the known arguments translated
function modes.similar_args_list(known_argumentsargs_known)
local list, arglingual = {}, "xxx"
local known_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {}
if type(known_argumentsargs_known) ~= "table" then return "similar_args_list", 1 end
for key, argm in pairs(known_argumentsargs_known) do -- List only all known arguments
if not tonumber(key) then -- For named arguments only
key = tostring(key)
Ligne 6 118 ⟶ 5 992 :
end
return list
end -- function modes.similar_args_list(known_argumentsargs_known)
 
-- Check if the value of an argument is among the possible values.
-- Vérifier si la valeur d'un argument est parmi les valeurs possibles.
-- local ... = modes.multiple_values(test.argm, test.argvalue, test.known_argumentsargs_final)
function modes.multiple_values(argname, argvalue, known_argumentsargs_final, known_argumentsargs_known)
if type(known_argumentsargs_final) ~= "table" then known_argumentsargs_final = modes.known_argumentsargs_final or {} end
local known_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {}
local argvalue = argvalue or known_argumentsargs_final[argname]
local arg_values, key_values, keyword, keyval, argval, rank
local one_argargmt = known_argumentsargs_known[argname]
if one_argargmt then
arg_values = langs.content_translations[one_argargmt.arg_values] or "" -- example "no;nada;cn;50;us;70;mpf" in local language
key_values = one_argargmt.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 one_argargmt
local key_tab = mw.text.split(key_values, ';') -- table of key
-- Default values
Ligne 6 141 ⟶ 6 015 :
keyval = nil -- key value
argval = nil
if one_argargmt and arg_values and argvalue then
for i, key in ipairs(arg_tab) do
if key == argvalue then -- Search argvalue in arg_tab
Ligne 6 147 ⟶ 6 021 :
keyval = key_tab[i] -- Return correponding keyval in key_tab
argval = argvalue
keyword = one_argargmt.keyword
end
end
Ligne 6 153 ⟶ 6 027 :
end
return keyword, keyval, argval, rank, arg_values
end -- function modes.multiple_values(argname, argvalue, known_argumentsargs_final, known_argumentsargs_known)
 
function modes.multiple_values_tests(t) -- Test: convert a string to a table of words
Ligne 6 175 ⟶ 6 049 :
if type(group_test) == "table" then
for i, test in ipairs(group_test) do
local keyword, keyval, argval, rank, arg_values = modes.multiple_values(test.argm, test.argvalue, test.known_argumentsargs_final)
table.insert( tab_view.rowGroup, { tostring(test.argm or "-"), tostring(arg_values or "-"), tostring(test.argvalue or "-"), tostring(keyword or "-"), tostring(keyval or "-"), tostring(argval or "-"), tostring(rank or "-") } )
end
Ligne 6 286 ⟶ 6 160 :
 
function modes.verify_args_tables(_known, _source)
-- initialize all the values to "" in one_argargmt table
-- if type(_known) ~= "table" then _known = modes.known_argumentsargs_known end
-- if type(_source) ~= "table" then _source = modes.args_source end
if type(modes.known_argumentsargs_known) ~= "table" then
events.add_err("modes_no_known_arguments_err")
events.add_cat("modes_no_known_arguments_i_cat")
Ligne 6 302 ⟶ 6 176 :
end -- function modes.verify_args_tables(_known, _source)
 
function modes.get_default_argsget_args(known_argumentsargs_known) -- GetsUpdate defaultargmt.val argumentsand valuesargmt.src in p.args_known{}
local m, val = modes, nil
local args_known = args_known or modes.args_known or p.args_known or {} -- optional value from p.args_known = {...}
local prop, props = datas.get_item(args_known, QITEM) -- Get datas from mw.wikibase for the page.
local arguments_known = mw.clone(args_known)
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 modes.args_import[argmt.keyword] then
argmt.val = modes.args_import[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 modes.args_final[argmt.keyword] then
argmt.val = modes.args_final[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(args_known) -- Update argmt.val and argmt.src in p.args_known{}
 
function modes.get_default_args(args_known) -- 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_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {} -- optional value from p.known_argumentsargs_known = { }
-- ["QITEM"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "QITEM", ["prop"] = "QITEM", ["prop_default"] = "Q307", },
-- keep Galilée (Q307), avoid Victor Hugo (Q535), Rudyard Kipling (Q34743),
Ligne 6 310 ⟶ 6 233 :
-- 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_argumentsargs_known) do
if type(one_arg) == "table" then
if type(one_arg.default_item == "string") then datas.prop_default = one_arg.prop .. "_default" end -- "Q34743" -- Rudyard Kipling **
Ligne 6 318 ⟶ 6 241 :
modes.arguments = arguments
viewers.restore_configs(memo, "modes.get_default_args") -- Restore global configurations after eventual changes.
return arguments, counts, tt -- With one_argargmt.val and one_argargmt.src
end -- local arguments = modes.get_default_args(known_argumentsargs_known) -- Gets default arguments values
 
function modes.get_args_report(t) -- Update modes.get_args()=args_known
modes.options_for_modes = { -- default options_for_modes
-- 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 ▼
read = " box1 ",
local memo = viewers.save_configs("modes.get_args_report") -- Save global configuration before eventual changes.
edit = " box1 docdef docline docsrc docdata catview docview : ",
local t = t or "\n* <b>modes.get_args(args_known)</b>: Update argmt.val and argmt.src in p.args_known{}."
doc = " nobox1 noerr nocatview ",
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 ▼'
tests = " box1 docdef docline docsrc docdata catview docview : tests ",
local arguments, counts, tt = modes.get_args(p.args_known) -- Update argmt.val and argmt.src in p.args_known{}
}
 
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.
rowGroup = {},
title_memo = "modes_known_arguments_report_title", -- "modes.known_arguments_report(t) Report of main known args.", -- en
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.format, case.src or "-", case.comment or "c", }
end,
title_memo = "modes_get_args_report_title", -- "modes.get_args() Values of the arguments in p.args_known{}.", -- en
rowGroup = {},
headers = "modes_args_known_report_headers", -- "key; val; type; need; keyword; syn; prop; format; source"
-- track_on == "details",
} -- 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_argumentsargs_known", lua_table.level_count(p.known_argumentsargs_known) ) .. viewers.ta("arguments", lua_table.level_count(arguments) )
t = t .. "\n* Counts for all known_argumentsargs_known{}."
for count, n in pairs(counts) do -- For all known parameters
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, one_argargmt in pairs(arguments) do -- For all known parameters
t = t .. viewers.ta(tostring(key), one_argargmt.kw)
end
viewers.restore_configs(memo, "modes.activate_known_arguments_reportget_args_report") -- Restore global configurations after eventual changes.
return t
end -- t = t .. modes.activate_known_arguments_reportget_args_report(t) -- Update modes.activate_known_argumentsget_args()=known_argumentsargs_known
-- 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
Ligne 6 498 ⟶ 6 345 :
-- Steps to mix modes values
--
-- Once run mix_args and mix_modes, in case a mode option would change the modesmode.
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
Ligne 6 649 ⟶ 6 496 :
end -- function modes.similar_args_search(search, list)
 
function modes.import_arguments(known_argumentsargs_known, args_source, content_translations, args_wikidata) -- Import all arguments from template, or invoke, or wikidata
local known_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {} -- optional value from p.known_argumentsargs_known = { }
modes.known_argumentsargs_known = known_argumentsargs_known
local args_wikidata = args_wikidata or modes.args_wikidata or p.args_wikidata or {} -- optional value from p.known_argumentsargs_known = { -- }
modes.args_wikidata = args_wikidata
local args_import = args_import or modes.args_import or {} -- optional value from p.known_argumentsargs_known = { }
modes.args_import = args_import
-- default parameters
Ligne 6 664 ⟶ 6 511 :
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_argumentsargs_known, ["argssource"] = args_source, ["argswikidata"] = args_wikidata, ["nowyear"] = modes.nowyear, } ) -- ARGS.t
modes.import_arguments_err = ""
modes.import_arguments_track = ""
local err = modes.verify_args_tables(known_argumentsargs_known, args_source)
if err then return args_import, err end
---------------------------------------
Ligne 6 678 ⟶ 6 525 :
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_argumentsargs_known = { -- }
for key_known, argm in pairs(known_argumentsargs_known) do
if type(argm) == "table" then argm.found = 0 end
end
Ligne 6 688 ⟶ 6 535 :
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_argumentsargs_known) do
if type(argm) == "table" then
argm.src = nil
Ligne 6 695 ⟶ 6 542 :
-- first initialise each known argument
modes.import_arguments_track = tostring(modes.import_arguments_track) .. " - " .. tostring(key_known)
argm_syn = known_argumentsargs_known[argm.keyword]
ARGS.add(viewers.ARGS, 1, "known_argumentsargs_known for", { key = key_known, Nargm = lua_table.level_count(argm), syn = argm.syn, } ) -- ARGS.t
if argm.syn == 2 then
-- Name an unnamed argument, positional, by its synonym. Nommer un argument non nommé, numéroté, par son synonyme.
Ligne 6 703 ⟶ 6 550 :
key_known = argm.keyword
-- synonyms are defined with the stamp "syn = 2", then here stamp the basic argument with "syn = 1".
known_argumentsargs_known[key_known].syn = 1
argm = known_argumentsargs_known[key_known] -- new variable argm
argm.src = nil
argm.trk = "s"
Ligne 6 720 ⟶ 6 567 :
argm.trk = argm.trk.."w"
if argm_orig then
-- known_argumentsargs_known[argm_orig].src = "wd"
-- known_argumentsargs_known[argm_orig].trk = (known_argumentsargs_known[argm_orig].trk or "").."w"
end
arg_found = true
Ligne 6 746 ⟶ 6 593 :
-- arg_found = true
if argm_orig then
-- known_argumentsargs_known[argm_orig].src = "args"
-- known_argumentsargs_known[argm_orig].trk = (known_argumentsargs_known[argm_orig].trk or "").."d"
end
else
Ligne 6 758 ⟶ 6 605 :
-- arg_found = true
if argm_orig then
-- known_argumentsargs_known[argm_orig].src = "args"
-- known_argumentsargs_known[argm_orig].trk = (known_argumentsargs_known[argm_orig].trk or "").."c"
end
end
Ligne 6 770 ⟶ 6 617 :
end
key_N = tonumber(key_known_init)
if key_N and not known_argumentsargs_known[key_N] then
events.add_err("modes_too_unnamed_arguments_err", key_N, argval)
events.add_cat("versions_with_usage_error_cat")
Ligne 6 786 ⟶ 6 633 :
end
-- modes.import_arguments: after import itself, some surrounding checks.
for key_known, argm in pairs(known_argumentsargs_known) 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 argm.keyword and known_argumentsargs_known[argm.keyword] and known_argumentsargs_known[argm.keyword].syn then -- if the argument is a synonym, increase the found level
if argm.found and (argm.found > 2) then
events.add_err("modes_value_re_defined_err", (argm["keyword"] or "**") ) --.. ">2")
Ligne 6 814 ⟶ 6 661 :
-- All arguments sources have they been used?
-- modes.args_unknown -- unknown arguments are source arguments without known arguments.
local args_list = modes.similar_args_list(modes.known_argumentsargs_known)
for key_src, val_src in pairs(modes.args_unknown) do -- For all unknown source arguments. function tableview.new(
arglingual = tostring(key_src) -- look for the translated argument
Ligne 6 834 ⟶ 6 681 :
end
key_N = tonumber(arglingual)
if key_N and not known_argumentsargs_known[key_N] then
events.add_err("modes_too_unnamed_arguments_err", key_N, val_src)
events.add_cat("versions_with_usage_error_cat")
Ligne 6 843 ⟶ 6 690 :
modes.args_import = args_import
return modes.args_import
end -- modes.args_import = modes.import_arguments(known_argumentsargs_known, args_source, content_translations, args_wikidata)
 
function modes.args_unknown_report(t) -- Report unknown arguments.
Ligne 6 849 ⟶ 6 696 :
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 855 ⟶ 6 703 :
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 867 ⟶ 6 713 :
-- - - - ------------------ - - - - ---------------------------------
 
function modes.generDoc(opt, known_argumentsargs_final, module_name)
-- List of paramètres for the module documentation
-- Lister des paramètres pour la documentation du module
Ligne 6 881 ⟶ 6 727 :
-- modes.options = " debug tests en es fr " -- for debug or enforce language
-- Option nocatview means "Do not categorize and do not show categories."
local known_argumentsargs_known = modes.known_argumentsargs_known
local err = modes.verify_args_tables(known_argumentsargs_known, modes.args_source)
if err then return err end
if type(module_name) ~= "string" then module_name = modes.module_name end
Ligne 6 888 ⟶ 6 734 :
if type(module_name) ~= "string" then module_name = "Central" end
local n, t, val = 0, "", ""
if type(known_argumentsargs_final) ~= "table" then t = t.."err_args_final="..type(known_argumentsargs_final).."<br>" end -- optional arguments
if type(known_argumentsargs_final) ~= "table" then known_argumentsargs_final = modes.known_argumentsargs_final end -- optional arguments
local key, argknw, argval, arglingual = "", "", ""
local lst = true
local lst_doc, lst_1, lst_t = {}, {}, ""
for key, parm in pairs(known_argumentsargs_final) do -- for all known arguments
val = ""
n = tonumber(key)
if n then key = tostring(parm["keyword"]) end -- key for unnamed arguments, in numeric sort
argknw = known_argumentsargs_known[key]
arglingual = viewers.form9user(arglingual) -- multilingual name of the one_argargmt in the template
if arglingual == "nil" then arglingual = key end -- if argument is translatable
val = parm -- tostring(args_import[key])
Ligne 6 907 ⟶ 6 753 :
if modes.option("docdef", opt) and (val ~= "") then lst = true end
if modes.option("docmax", opt) then lst = true end
if not known_argumentsargs_known[key] then lst = false end
if key and known_argumentsargs_known[key] and known_argumentsargs_known[key].typ == "sys" then lst = false end
if lst then t = t .. viewers.tam( viewers.form9user(key), parm) end -- list if found and selected
end
t = "\n* " .. module_name .. " " .. t -- .. "}}" -- <br>
return t
end -- function modes.generDoc(opt, known_argumentsargs_final, module_name)
 
function modes.sources_of_datas_colors()
Ligne 7 020 ⟶ 6 866 :
end -- function modes.all_errors_list(t)
 
function modes.list_all_args_main(t, known_argumentsargs_known) -- List of all accepted arguments
local memo = viewers.save_configs("modes.list_all_args_main") -- Save global configuration before eventual changes.
local t = "\n* " .. (t or viewers.form9user("modes_list_all_args_main_title") )
local known_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {}
if type(known_argumentsargs_known) ~= "table" then return (t .. "The known arguments table modes.known_argumentsargs_known misses.") end
t = t .. viewers.ta("args N", lua_table.level_count(known_argumentsargs_known) )
local descr, description = "", ""
args = mw.clone(known_argumentsargs_known)
local arglst = {}
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang()
for key, elem in pairs(known_arguments) do
for key, elem in pairs(args) do
elem.key = tostring(key)
descr = key .. "_descr" -- key for description of an argument
Ligne 7 071 ⟶ 6 918 :
viewers.restore_configs(memo, "modes.list_all_args_main") -- Restore global configurations after eventual changes.
return t
end -- function modes.list_all_args_main(t, known_argumentsargs_known) -- modes_list_all_args_main_title for main
 
function modes.recursive_normal( recursiveLevel_in, recursive_limit_in, modes_recursiveLevel_err ) -- Normalize recursiveLevel and recursive_limit
Ligne 7 166 ⟶ 7 013 :
end -- function modes.namespaces_page_list()
 
function modes.init_modes_translate_events(frame, Central_version, mode_name, known_argumentsargs_known, options_for_modes, QITEM)
-- After versions.init(), initialize modes and their options, known arguments, translations, and default item.
local res = ""
modes.frame = frame
langs.Central_version = Central_version -- To adapt the version of Module:Centralizer in any translated text.
modes.known_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known
modes.module_init(frame) -- Get modes.args_source with modes.args_source
modes.mode_name = mode_name or modes.mode_name or "read"
Ligne 7 179 ⟶ 7 026 :
local recursiveLevel, recursive_limit, recursiveLevel_err = modes.recursive_normal(recursiveLevel, modes.recursive_limit)
return res
end -- function modes.init_modes_translate_events(frame, Central_version, mode_name, known_argumentsargs_known, options_for_modes, QITEM)
 
-- p_template_drop_box_name = 'Cuadro desplegable', -- Equivalent templates exist in other wikis
Ligne 8 152 ⟶ 7 999 :
local t = "\n* <b>versions.bind_arguments()<b>: Tests of redefine arguments for any cases."
local loaded_pack = loaded_pack or versions.loaded_modules_track()
local known_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {}
local args_changes = {}
for i, get in pairs(loaded_pack) do -- for all known sub-modules
if (type(get.is_table) == "table") then -- For all types of modules
for one_arg, args in pairs(known_argumentsargs_known) do -- for all arguments in one module
for i, get in pairs(one_arg) do -- for all properties of an argument
one_arg.module = one_arg.module or "no module"
Ligne 8 334 ⟶ 8 181 :
end -- function versions.tasks_changes_report(t)
 
-- function versions.init(frame, mode_name, args_known, options_for_modes, QITEM)
function modes.get_one_arg(known_arguments, keyword) -- Gets versatile adaptations for one argument
function versions.init(frame, Central_version, mode_name, args_known, options_for_modes, QITEM)
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)
-- Initializes translations, bind_libraries, bind_sub_modules, get arguments, modes, options.
-- Imports arguments from wikidata, module and template with increasing priorities.
Ligne 8 376 ⟶ 8 191 :
versions.setup_central_libraries(versions.bindable_libraries) -- Actual installation of central bindable libraries in package.loaded
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_argumentsargs_known, 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.
-- Bind all i18n translations from libraries, modules and their /I18N translations sub-modules
Ligne 8 386 ⟶ 8 201 :
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", },
local args_known = args_known or modes.args_known or p.args_known or {}
-- like function modes.get_default_args(known_arguments) -- Gets default arguments values
for key, one_arg in pairs(args_known) do
local argskwn = args_known[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
local mix = mix or {}
modes.mix = mix -- To easy get, track and test the init_args_mode_options process
Ligne 8 394 ⟶ 8 215 :
res = res .. versions.detect_MediaWiki_changes()
return res
end -- res = res .. versions.init(frame, Central_version, mode_name, known_argumentsargs_known, options_for_modes, QITEM)
 
function versions.versions_support_test(t) -- Test : List all loaded modules
Ligne 8 825 ⟶ 8 646 :
t = t .. viewers.ta("main_title", modes.main_title )
t = t .. viewers.ta("label", mwuri.label )
-- local label = modes.known_argumentsargs_final.label or modes.main_title or modes.known_argumentsargs_final.QITEM or modes.known_argumentsargs_final.itemid
t = t .. viewers.ta("text", mwuri.text )
t = t .. viewers.ta("host", mwuri.host )
Ligne 9 375 ⟶ 9 196 :
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*")
local tests_groups = {}
tests_groups.gettests_groups_recursive_limit = 11 -- To protect against unsought loops in recursive tests_groups.
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)
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = tests_groups,
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 = {},
ccc = {},
}
-- 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.
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.
Ligne 9 795 ⟶ 9 684 :
 
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.activate_known_arguments_reportget_args_report.
-- From 20180503 a bug (in Module:Centralizer or MediaWiki) See CentralManual display twice : modes.activate_known_arguments_reportget_args_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 9 982 ⟶ 9 871 :
 
function tableview.form_whole_view(tab_view) -- Formats whole the tableview.new()
local memo = viewers.save_configs("tableview.form_whole_viewform_all_cases") -- Save global configuration before eventual changes.
local t, err = "", ""
if (lua_table.level_count(tab_view.test_group) == 0) then
Ligne 10 006 ⟶ 9 895 :
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 036 ⟶ 9 925 :
if not mask_sections then res = res .. viewers.doc_section(selector, "viewers_section_title_page", "h2", mask_sections) end
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_titlemodes_args_known_report_title", modes.known_arguments_reportargs_known_report)
res = res .. drop_box.new(selector, "modes_get_args_report_title", modes.activate_known_arguments_reportget_args_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 043 ⟶ 9 932 :
-- res = res .. drop_box.new(selector, "langs_translations_counts_title", langs.translations_counts) -- S170618ltc
res = res .. drop_box.new(selector, "luaTable_table_args_source_title", lua_table.structure, modes.args_source, "modes.args_source")
res = res .. drop_box.new(selector, "modes_known_arguments_structure_titlemodes_args_known_structure_title", modes.known_arguments_structureargs_known_structure)
return res
end -- function viewers.doc_page(selector, mask_sections)
Ligne 10 050 ⟶ 9 939 :
local res = ""
if not mask_sections then res = res .. viewers.doc_section(selector, "viewers_section_title_module", "h2") end
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 069 ⟶ 9 957 :
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(
Ligne 10 109 ⟶ 9 999 :
-- if not mask_sections then res = res .. viewers.doc_section(selector, "viewers_section_title_library_modes", "h3") end
-- res = res .. drop_box.new(selector, "datas.get_item() Report datas from mw.wikibase **", datas.get_item_report)
-- res = res .. drop_box.new(selector, "modes_known_arguments_report_titlemodes_args_known_report_title", modes.known_arguments_reportargs_known_report)
res = res .. drop_box.new(selector, "modes_get_args_report_title", modes.activate_known_arguments_reportget_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_reportbind_args_known_one_lib_report(t) Report the binding of one library known args. **", modes.bind_known_arguments_one_lib_reportbind_args_known_one_lib_report)
-- res = res .. drop_box.new(selector, "modes_used_options_list_title", modes.used_options_list )
res = res .. drop_box.new(selector, "versions_bind_arguments_tests_title", modes.options_from_args_tests)
Ligne 10 119 ⟶ 10 009 :
-- 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
res = res .. drop_box.new(selector, "modes_recursive_normal_tests_title", modes.recursive_normal_tests) -- only errors
-- arguments list
-- res = res .. drop_box.new(selector, "modes_all_categories_list_title", modes.all_categories_list) -- n = 0
Ligne 10 128 ⟶ 10 019 :
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_titlemodes_namespaces_page_list_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 138 ⟶ 10 032 :
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 148 ⟶ 10 043 :
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("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 205 ⟶ 10 101 :
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_argumentsargs_known, 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
Ligne 10 211 ⟶ 10 107 :
local flag = viewers.form_image("Flag_of_England.svg", 50)
-- local flag = viewers.form_image(viewers.form9user("flag_of_country"), 50)
-- known_arguments_countryargs_known_country = "England", -- English
-- known_arguments_flagargs_known_flag = "Flag_of_England.svg", -- English
-- known_arguments_monumentargs_known_monument = "St_Pauls_aerial_%28cropped%29.jpg", -- English St Paul's Cathedral
-- known_arguments_townargs_known_town = "London", -- English
local image = viewers.form_image(prop.image, 50)
local birthyear_deathyear = " ( " .. (prop.birthyear or "birthyear") .. " - " .. (prop.deathyear or "deathyear") .. " ) "
Ligne 10 226 ⟶ 10 122 :
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_argumentsargs_final, title)
 
-- 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_argumentsargs_final)
-- read = " box1 ",
-- edit = " box1 docdef docline docsrc docdata catview docview : ",
Ligne 10 236 ⟶ 10 132 :
-- tests = " box1 docdef docline docsrc docdata catview docview : tests ",
local res, props = "", datas.props
if type(known_argumentsargs_final) ~= "table" then known_argumentsargs_final = modes.known_argumentsargs_final 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)
Ligne 10 249 ⟶ 10 145 :
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_argumentsargs_final, "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_eventevt.typ == "wng" then one_eventevt.res = viewers.styles_color_warning(one_eventevt.user_wkt) end
-- if new_one_eventnew_evt then table.insert(events.all_events_grouplist_all_events, one_eventevt) end
for key, one_eventevt in pairs(events.all_events_grouplist_all_events) do
if one_eventevt.typ == "wng" then
one_eventevt.res, one_eventevt = events.formatsform(one_eventevt)
if one_eventevt.res then t = t .. "<br>* " .. tostring(one_eventevt.res) end
end
end
--
for key, one_eventevt in pairs(events.all_events_grouplist_all_events) do
if one_eventevt.typ == "err" then
one_eventevt.res, one_eventevt = events.formatsform(one_eventevt)
if one_eventevt.res then t = t .. "<br>* " .. tostring(one_eventevt.res) end
end
end
--
for key, one_eventevt in pairs(events.all_events_grouplist_all_events) do
if one_eventevt.typ == "cat" then
one_eventevt.res, one_eventevt = events.formatsform(one_eventevt)
if one_eventevt.res then t = t .. "<br>* " .. tostring(one_eventevt.res) end
end
end
Ligne 10 283 ⟶ 10 179 :
-- result = result .. "\n* " .. events.categories_lister(":")
return res
end -- function p.box_edit(known_argumentsargs_final)
 
function p.form_result(known_argumentsargs_final, 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 "Q307" -- Keep Galilée (Q307)
main_module = main_module or versions.main_module
if type(known_argumentsargs_final) ~= "table" then known_argumentsargs_final = modes.known_argumentsargs_final 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 .. p.box_read(props) end -- ric (p.box_read)
Ligne 10 297 ⟶ 10 192 :
if modes.option("box1") or modes.option("catview")
then res = res .. " catview = " .. events.categories_lister(":") end -- Display categories
events.gener_categories(known_argumentsargs_final) -- Formats all categories without activate them
if modes.option("docview") or modes.option(":") or modes.option("tests") or (modes.known_argumentsargs_final.mode == "edit") then
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_argumentsargs_final)
elseif modes.option("read") or (modes.known_argumentsargs_final.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_argumentsargs_final)
elseif modes.option("edit") or (modes.known_argumentsargs_final.mode == "edit") then
end
modes.time3 = os.clock()
if modes.option("tests") then -- or (modes.known_argumentsargs_final.mode == "tests") --
res = res .. viewers.doc_group("allwaysview") -- viewers.doc_group(selector, mask_sections) -- To enforce title of sections
-- res = res .. viewers.doc_page("allwaysview") -- included in viewers.doc_group
Ligne 10 316 ⟶ 10 211 :
viewers.restore_configs(memo, "p.form_result") -- Restore global configurations after eventual changes.
return res
end -- res = res .. p.form_result(known_argumentsargs_final, main_module) -- Formats all results of this module and its sub-modules.
 
function viewers.init_configs(memo, tab_view, group) -- Initialize global configurations and save them before eventual changes.
Ligne 10 360 ⟶ 10 255 :
memo.memo_user_lang = langs.user_lang
memo.memo_user_translations = langs.user_translations
memo.memo_known_argumentsmemo_args_known = modes.known_argumentsargs_known
memo.memo_args_template = modes.args_template
memo.memo_modes_catView = modes.catView
Ligne 10 395 ⟶ 10 290 :
langs.user_translations = memo.memo_user_translations
langs.init_content_page_user_lang(langs.content_lang, langs.page_lang, langs.user_lang)
modes.known_argumentsargs_known = memo.memo_known_argumentsmemo_args_known
modes.args_template = memo.memo_args_template
modes.catView = memo.memo_modes_catView
Ligne 10 473 ⟶ 10 368 :
p.i18n.br = { -- Translations in breton
-- Arguments to import, do not translate. Arguments à importer, ne pas traduire.
["modules_guide"] = { ["typ"] = "ctr", ["need"] = 0, ["keyword"] = "modules_guide", ["prop_defaultmodules_guide_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 531 ⟶ 10 426 :
p.i18n.en = { -- Translations in English
-- Arguments to import, do not translate.
["modules_guide"] = { ["typ"] = "ctr", ["need"] = 0, ["keyword"] = "modules_guide", ["prop_defaultmodules_guide_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 588 ⟶ 10 483 :
p.i18n.es = { -- Translations in espagnol
-- Importar estos argumentos. No traducir.
["modules_guide"] = { ["typ"] = "ctr", ["need"] = 0, ["keyword"] = "modules_guide", ["prop_defaultmodules_guide_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 646 ⟶ 10 541 :
p.i18n.fr = { -- Translations in français
-- Arguments to import, do not translate. Arguments à importer, ne pas traduire.
["modules_guide"] = { ["typ"] = "ctr", ["need"] = 0, ["keyword"] = "modules_guide", ["prop_defaultmodules_guide_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 705 ⟶ 10 600 :
p.i18n.vi = {
-- Arguments to import, do not translate. Arguments à importer, ne pas traduire.
["modules_guide"] = { ["typ"] = "ctr", ["need"] = 0, ["keyword"] = "modules_guide", ["prop_defaultmodules_guide_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 770 ⟶ 10 665 :
-- - - - ------------------ - - - - ---------------------------------
 
p.known_argumentsargs_known = { -- Table of the definitions of all known arguments at module level. -- 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_defaultsyn"] = "read", 2}, -- for {{Centralizer|doc|... default mode
 
[2] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = 2, ["syn"] = "dockey"}, -- for {{Centralizer|doc|...
[3] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = 3, ["syn"] = "docitem"}, -- for {{Centralizer|doc|...
-- Guideline to integer i18n translations following a list of sub-modules: modules_guide with their own translations.
-- Guideline to integer default arguments values: defaults values are always from Centralizer.
Ligne 10 783 ⟶ 10 678 :
-- Special arguments to modify the fonctions and outputs of this module.
-- Arguments speciaux pour modifier le fonctionnement et les sorties de ce module.
["modules_guide"] = { ["typ"] = "ctr", ["need"] = 0, ["keyword"] = "modules_guide", ["prop_defaultmodules_guide_default"] = "Centralizer", },
["category"] = { ["typ"] = "ctr", ["need"] = 0, ["keyword"] = "category"},
["debug"] = { ["typ"] = "opt", ["need"] = 0, ["keyword"] = "debug"},
Ligne 10 798 ⟶ 10 693 :
["pagelang"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "pagelang"},
["userlang"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "userlang"},
["known_arguments_countryargs_known_country"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "known_arguments_countryargs_known_country", ["prop"] = "P18", },
["known_arguments_flagargs_known_flag"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "known_arguments_flagargs_known_flag", ["prop"] = "P18", },
["known_arguments_monumentargs_known_monument"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "known_arguments_monumentargs_known_monument",["prop"] = "P18", },
["known_arguments_townargs_known_town"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "known_arguments_townargs_known_town", ["prop"] = "P18", },
--
--[[
datas.i18n.en
args_known_country = "London", -- English
args_known_flag = "flag of English.svg", -- English
args_known_monument = "St Paul Cathedral.png", -- English
args_known_town = "London", -- English
datas.i18n.es
args_known_country = "Madrid", -- Spanish
args_known_flag = "flag of .......png", -- Spanish
args_known_monument = "parliament.png", -- Spanish
args_known_town = "Madrid", -- Spanish
datas.i18n.fr
args_known_country = "France", -- French
args_known_flag = "flag of France.svg", -- French
args_known_monument = "Tour Eiffel", -- French
args_known_town = "Paris", -- French
--]]
--[[
for key, trans in pairs(langs.content_translations) do -- Add to function datas.get_item(
if key == "args_known_country" then datas.prop["country"] = langs["args_known_country"] end
if key == "args_known_flag" then datas.prop["country"] = langs["args_known_flag"] end
if key == "args_known_monument" then datas.prop["monument"] = langs["args_known_monument"] end
if key == "args_known_town" then datas.prop["town"] = langs["args_known_town"] end
end
--]]
-- 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.
Ligne 10 834 ⟶ 10 757 :
["arg_values"] = "rights_values", ["key_values"] = "no;none;ONU;none;cn;50;us;70;mpf", -- wiki_selectors
["delay_values"] = "0;0;0;0;50;50;70;70;95", ["arg_uses"] = "none;none;none;none;cn;cn;us;us;mpf" }, -- wiki_selectors
["known_arguments_monumentargs_known_monument"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "known_arguments_monumentargs_known_monument", ["prop"] = "P18", },
["labelbylang"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "labelbylang", ["prop"] = "P18", },
-- known_arguments_monumentargs_known_monument = "Tour Eiffel", -- French
-- known_arguments_townargs_known_town = "Paris", -- French
} -- #p.known_argumentsargs_known = 29 on 2018-01-15
 
function p.form_support_desk_report(t) return versions.form_support_desk_report(t) end
Ligne 10 884 ⟶ 10 807 :
return res
end -- function p.form_tests_init(res, args_source)
 
function p.interact_args_final(args_import, args_known)
local t = ""
local args_known = args_known or modes.args_known or p.args_known or {} -- optional value from p.args_known = { -- }
if type(args_import) ~= "table" then args_import = modes.args_import or {} end
local args_final = mw.clone(args_import) -- do not disturb original args_import
local a = args_import
local i = {} -- interact
datas.prop_default = datas.prop_default or "Q307" -- keep Galilée (Q307)
local tit = nil
if not a.title then -- If title is undefined, enforce it.
if a.lastname and a.firstname then
tit = a.firstname .. " " .. a.lastname
end
i.title = a.label or modes.main_title or a.QITEM or a.itemid or a.title or datas.prop_default
end
--
if a.docfunc then a.docfunc = mw.text.trim(a.docfunc) end -- dockey docitem args_known = { i18n.vi
if a.docitem then a.docitem = mw.text.trim(a.docitem) end -- dockey docitem args_known = { i18n.vi
if a.dockey then a.dockey = mw.text.trim(a.dockey) end -- dockey docitem args_known = { i18n.vi
if not a.QITEM then -- The Title can come from several arguments to insure it.
i.QITEM = a.label or modes.main_title or a.QITEM or a.itemid or a.title
i.QITEM = mw.text.trim(i.QITEM or datas.prop_default) -- Rudyard Kipling
else
a.QITEM = a.QITEM or datas.default_item
a.QITEM = mw.text.trim(a.QITEM)
end
--
-- if absent, synonym of basic arguments, syn = 2
if not a.firstname then i.firstname = (i.firstname2 or a.firstname2) end
if not a.lastname then i.lastname = (i.lastname2 or a.lastname2) end
if not a.firstname2 then i.firstname2 = (i.firstname or a.firstname) end
if not a.lastname2 then i.lastname2 = (i.lastname or a.lastname) end
--
if not a.initial then -- If initial is undefined, enforce it.
if a.lastname then
i.initial = string.sub( a.lastname, 1, 1 ) -- selector the first letter
i.initial = string.upper( i.initial or "*" )
end
end
--
local label = a.label or a.labeluser or a.labelpage or a.labelcontent or a.labelbylang
if label then i.label = label
else
events.add_err( viewers.form9user("versions_with_internal_error") )
events.add_cat( viewers.form9user("versions_with_internal_error_cat") )
end
--
if a.birth and not a.birthyear then
local tt, err = viewers.date_to_part(a.birth, viewers.form9user("modes_date_to_part_format"), "yyyy")
if tt then i.birthyear = tt else
events.add_err(err, viewers.form9user("birthyear"), "yyyy")
events.add_cat("modes_date_to_part_call_cat")
end
end
-- memorize interactions in modes.args_final and show errors or warnings
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang()
local n = 0
for key, val in pairs(i) do
local argskwn = args_known[key]
if type(argskwn) == "table" then
args_final[key] = val -- = i[key]
args_final.src = "inter"
n = n + 1
if (args_final.need == 2) and not a[key] then --
-- need = 2 necessary from argument or module interaction
events.add_wng("modes_auto_val_warning_wng", langs.user_translations[key], val) -- form_result
end
else
events.add_err("modes_unknown_auto_arg_err", langs.content_translations[key], val)
end
end
modes.args_final = args_final
return args_final, t
end -- args_final = p.interact_args_final(args_import)
 
 
Ligne 10 894 ⟶ 10 892 :
-- - - - ------------------ - - - - ---------------------------------
 
function Central.install(frame, Central_version, mode_name, args_known, options_for_modes)
-- p.version.versionNumber = CentralI18N.version.versionNumber
local res = ""
return "\n* ARGS.t=" .. tostring(ARGS.t) .. ", CNT.t=" .. tostring(CNT.t)
end
 
function Central.demo(frame, Central_version, mode_name, args_known, options_for_modes)
local versatile_arguments = {}
-- p.version.versionNumber = CentralI18N.version.versionNumber
modes.versatile_arguments = versatile_arguments
local res = ""
 
return "\n* ARGS.t=" .. tostring(ARGS.t) .. ", CNT.t=" .. tostring(CNT.t)
-- FAMLTVQDR Tactic only once steps : Frame Mode-from-Frame Args Libraries Translations Versions QITEM Datas Results
end
-- { "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) -- Activates known_arguments for phase = "mode" or "argument" or "QITEM" or "property"
-- 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 {}
modes.actual_arguments = modes.actual_arguments or {} -- Groups activated arguments MUMU
modes.actual_arguments = modes.activate_known_arguments(known_arguments, "argument") -- Activates known_arguments for phase = mode or argument or QITEM or property
--
-- 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
-- function versions.setup_central_libraries(
--
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
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.
-- Bind all i18n translations from libraries, modules and their /I18N translations sub-modules
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 = modes.init_args_mode_options(mix, modes.mode_name, modes.actual_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"
res = res .. "\n* Count modes.actual_arguments QITEM : " .. viewers.ta("n", lua_table.level_count(modes.actual_arguments) )
-- ["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.
--
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(modes.get_args_datas)
return res
end -- modes.actual_arguments = function p.Init_central_module(frame, mode_name, known_arguments, options_for_modes, QITEM) -- Activates known_arguments for 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
 
function Central.init(frame, Central_version, mode_name, known_argumentsargs_known, options_for_modes)
-- p.version.versionNumber = CentralI18N.version.versionNumber
local res = ""
tracker.init_trakers() -- Initialize some trakers. To run in Central.init()
modes.time1 = os.clock()
local known_argumentsargs_known = known_argumentsargs_known or modes.known_argumentsargs_known or p.known_argumentsargs_known or {} -- optional value from p.known_argumentsargs_known = {...}
Central_version = Central_version or langs.Central_version or Central.Central_version
local options_for_modes = options_for_modes or modes.options_for_modes or p.options_for_modes
Ligne 11 069 ⟶ 10 916 :
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, Central_version, mode_name, modes.known_argumentsargs_known, options_for_modes, QITEM or itemid)
datas.props = datas.get_item(known_argumentsargs_known, 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
modes.args_import = modes.import_arguments(known_argumentsargs_known, args_source, content_translations, args_wikidata) -- function modes.import_arguments()
modes.activate_known_argumentsargs_final = p.interact_args_final(known_argumentsmodes.args_import) -- Interactions between arguments
modes.get_args(args_known) -- Interactions between arguments
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang()
res = res .. (datas.props_trk or "")
Ligne 11 079 ⟶ 10 927 :
-- p.version.versionNumber = CentralI18N.version.versionNumber
return res
end -- function Central.init(frame, Central_version, mode_name, known_argumentsargs_known, options_for_modes)
 
function Central.read(frame) -- The read mode generates the normal result for read only users.
-- Helpers or admins can add options to include edit or tests or user language...
local res = ""
local t = Central.init(frame, Central.Central_version, "read", p.known_argumentsargs_known, p.options_for_modes)
-- res = res .. t
modes.args_final = p.interact_args_final(modes.args_import) -- Interactions between arguments
res = res .. p.form_result(modes.known_arguments)
res = res .. p.form_result(modes.args_final)
res = res .. "\n* " .. datas.track_val
return res
Ligne 11 094 ⟶ 10 943 :
local res = "</b>"
res = res .. "Library:langs"
local t = Central.init(frame, Central.Central_version, "edit", p.known_argumentsargs_known, p.options_for_modes)
-- res = res .. t
modes.args_final = p.interact_args_final(modes.args_import) -- Interactions between argumensts
res = res .. "</b>"
res = res .. p.form_result(modes.known_argumentsargs_final)
return res
end -- function Central.edit(frame)
Ligne 11 106 ⟶ 10 956 :
function Central.doc(frame) -- Formats a documentation or a test in a drop_box.
local res = ""
Central.init(frame, p.Module_Central_version, "doc", p.known_argumentsargs_known, p.options_for_modes) -- QITEM
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang()
modes.change_itemid() -- default = "Q41568"
modes.args_final = p.interact_args_final(modes.args_import) -- Interactions between argumensts
-- {{Central|doc|versions_support_desk_title}}
local docfunc = modes.known_argumentsargs_final.docfunc or modes.known_argumentsargs_final[3] or modes.args_import.docitem or modes.args_import[3]
local docitem = modes.known_argumentsargs_final.docitem or modes.known_argumentsargs_final[2] or modes.args_import.docitem or modes.args_import[2] or datas.default_item
local dockey = modes.known_argumentsargs_final.dockey or modes.known_argumentsargs_final[1] or modes.args_import.dockey or modes.args_import[1]
local QITEM = modes.known_argumentsargs_final.QITEM or modes.known_argumentsargs_final.docitem or docitem
QITEM = mw.text.trim(QITEM) -- clean spaces in each name
if dockey then
Ligne 11 124 ⟶ 10 975 :
local res = ""
res = res .. tracker.init_trakers() -- Initialize some trakers. To run in Central.init()
local t = Central.init(frame, Central.Central_version, "tests", p.known_argumentsargs_known, p.options_for_modes)
res = res .. t
-- res = res .. "\n* getEntityIdForCurrentPage = " .. tostring( mw.wikibase.getEntityIdForCurrentPage() ) -- Returns the Item id as string, like "Q42"
p.form_tests_init()
modes.args_final = p.interact_args_final(modes.args_import) -- Interactions between arguments
langs.init_content_page_user_lang(a, b, c, d, "Central.tests")
versions.main_versions = versions.main_versions or { versionName = "versionName", versionNumber = "0.0", }
if not versions.main_versions then versions.main_versions = p.version or versions.version end
modes.mode_name = "tests"
res = res .. p.form_result(modes.known_argumentsargs_final) -- Generate wikitext, categories, and others
-- res = res .. viewers.try_graph()
return res
Ligne 11 286 ⟶ 11 138 :
{ site = "fr.wikisource", verstime = "2018-12-19T17:52:30", versid = "1.33.0-wmf.9 (7cf3023)", seen_time = "2018-12-20T09:07:00", },
{ site = "fr.wikisource", verstime = "2018-12-20T17:20:46", versid = "1.33.0-wmf.9 (02196d2)", seen_time = "2018-12-20T21:04:00", },
{ site = "www.MediaWiki", verstime = "2019-01-08T21:06:30", versid = "1.33.0-wmf.12 (1bc0e29)", seen_time = "2019-01-09T06:03:00", },
{ site = "fr.wikisource", verstime = "2019-01-10T20:33:38", versid = "1.33.0-wmf.12 (ee22e48)", seen_time = "2019-01-11T09:09:00", },
{ site = "fr.wikisource", verstime = "2019-01-11T21:00:02", versid = "1.33.0-wmf.12 (fd444fe)", seen_time = "2019-01-12T07:02:00", },
{ site = "fr.wikisource", verstime = "2019-01-15T01:25:25", versid = "1.33.0-wmf.12 (21b4e27)", seen_time = "2019-01-16T06:19:00", },
{ site = "www.MediaWiki", verstime = "2019-01-15T19:23:17", versid = "1.33.0-wmf.13 (baa5168)", seen_time = "2019-01-16T06:19:00", },
{ site = "fr.wikisource", verstime = "2019-01-17T20:05:42", versid = "1.33.0-wmf.13 (c8ec225)", seen_time = "2019-01-18T07:40:00", },
} -- MWMW
versions.MediaWiki_version_memo = "1.33.0-wmf.912 (02196d221b4e27)"
versions.MediaWiki_Versions_sort = "<" -- First on end, Last on begin
versions.MediaWiki_Versions_sort = ">" -- First on begin, Last on end
Ligne 11 296 ⟶ 11 154 :
local selector = selector or "enforce"
local mask_sections = mask_sections or nil
if p.teststests == "not FAMLTVQDR" then -- DODO
res = res .. "\n* DisplaysDisplay internal: testslangs_main_i18n_languages_list FAMLTVQDRand activated.langs_list_MediaWiki_languages_title \n*"
res = res .. drop_box.new(selector"enforce", "modes_known_arguments_report_titlelangs_main_i18n_languages_list", modeslangs.known_arguments_reportmain_i18n_languages_list ) -- OK, show in table ?
res = res .. drop_box.new(selector"enforce", "p_Init_central_module_report **langs_list_MediaWiki_languages_title", plangs.Init_central_module_reportlist_MediaWiki_languages ) -- for phase = mode or argumentOK, orshow QITEMin ortable property?
res = res .. drop_box.new(selector, "p.Init_central_module_tests_titleteststests = FAMLTVQDR Init_mode_args_datas_tests **", pmodes.Init_central_module_tests)Init_mode_args_datas_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)