« Module:Multilingual » : différence entre les versions
Contenu supprimé Contenu ajouté
ModuleCentralizer langs.list_MediaWiki_languages() OK 20181225 0200.lua |
MdCentral lua_table.to_list_tests(t) hard bug table structure 190108 1000.lua |
||
Ligne 1 :
local p = {}
-- 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) hard bug table structure 190107 2250.lua
------------------------------------------|------------------------ typical length --------------------------|----------max| DODO
-- update DONE+todo list at 190107 2150
-- DONE+todo mean : DODO is to do soon, this sub-task is already done MUMU = CentralManual.xml MWMW = report in versions.MediaWiki_Versions = {}
-- 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
{ "
{ "
{ "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)"
{ "
{ "
{ "20190108", "20190109", "todo", "Rical", "S181221oTc", 'others: ["Tactic"] = "canbenil;nevererror" ', },
{ "
{ "
{ "
-- 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(
["versionDate"] = "
["mainDescription"] = "Begin to use",
["functionDescription"] = "first functional support",
Ligne 77 ⟶ 105 :
activity = {} -- Library:activity from 20170611 Search story in Central modules.txt
-- args = {} -- Object:args from 20180106 form known arguments to import, complete from datas and finalize
datas = {} -- Library:datas from ?
drop_box = {} -- Object:drop_box from 20170615 rename viewers.drop_box.form() in viewers.drop_box on 20170615
Ligne 92 ⟶ 119 :
viewers = {} -- Library:viewers from 20170209
-- versions.args = args -- Object:args from 20180106 todo
-- Records are in function versions.setup_central_libraries(bindable_libraries, opt) -- Install central bindable libraries in package.loaded
Ligne 193 ⟶ 219 :
mathroman.infos = { -- from 20130312
["libname"] = "mathroman", typ = "Library",
libdesc = "The Library:mathroman converts roman to
versfirst = "130312.12:00", verslast = "171221.07:43",
versions = {
Ligne 258 ⟶ 284 :
{ "viewers", "The Library:viewer translates and formats strings to document texts and table views.", },
-- Objects have a function object.new() to form several objects.
{ "drop_box", "The Object:drop_box, in the Library:viewers, formats drop-boxes. It needs a local template installed with Centralizer.", },
{ "central_library","The Object:central_library, in the Library:versions, formats the basis of libraries and their properties.", },
Ligne 385 ⟶ 410 :
-- Pour traduire, ne traduisez pas des parties comme celles-ci : <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["docitem"] = "docitem",
["dockey"] = "dockey",
activity_description = "La Library:activity soutient la gestion des tâches de phabricator, des sous-tâches inter Lua-codeurs et des modules centraux interwikis.",
Ligne 401 ⟶ 427 :
activity_phabricator_tasks_headers = "Importance, modifiée le; Tâche; Etat; Titre",
activity_central_functions_report_title = "activity.central_functions_report(t) Lister les fonctions actuelles.",
activity_space_name_module = "Modulenn", -- br
activity_space_name_template = "Patrom",
Ligne 410 ⟶ 435 :
-- Modul:Central-s-de/Doku {{#invoke:Central-s-de|read}} de = German = Deutsch
["docfunc"] = "docfunc",
["docitem"] = "docitem",
["dockey"] = "dockey",
activity_description = "Das Library:activity Das Ding unterstützt das Management von phaborator-Aufgaben, von inter-Lua-Coder-Unteraufgaben und von interwikis-Zentralmodulen.",
Ligne 425 ⟶ 451 :
activity_phabricator_tasks_headers = "Wichtigkeit; modifiziert die; Aufgabe; Status; Titel",
activity_central_functions_report_title = "activity.central_functions_report(t) Listen Sie die aktuellen Funktionen auf.",
activity_space_name_module = "Modul", -- de
activity_space_name_template = "Vorlage",
Ligne 435 ⟶ 460 :
-- To translate, do not translate parts like these: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["docitem"] = "docitem",
["dockey"] = "dockey",
activity_description = "The Library:activity supports the management of phabricator tasks, of inter Lua-coders sub-tasks, and of interwikis central modules.",
Ligne 451 ⟶ 477 :
activity_phabricator_tasks_headers = "Importance; modified on; Task; Status; Title",
activity_central_functions_report_title = "activity.central_functions_report(t) List actual functions.",
activity_space_name_module = "Module", -- en
activity_space_name_template = "Template",
Ligne 461 ⟶ 486 :
-- To translate, do not translate parts like these: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["docitem"] = "docitem",
["dockey"] = "dockey",
activity_description = "La Library:activity soporta la gestión de tareas de phabricator, de sub-tareas inter Lua-coders, y de módulos interwikis centrales.",
Ligne 477 ⟶ 503 :
activity_phabricator_tasks_headers = "Importancia; modificado; Tarea; Estado; Título",
activity_central_functions_report_title = "activity.central_functions_report(t) Listar funciones actuales.",
activity_space_name_module = "Módulo", -- es
activity_space_name_template = "Modelo",
Ligne 487 ⟶ 512 :
-- Pour traduire, ne traduisez pas des parties comme celles-ci : <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["docitem"] = "docitem",
["dockey"] = "dockey",
activity_description = "La Library:activity soutient la gestion des tâches de phabricator, des sous-tâches inter Lua-codeurs et des modules centraux interwikis.",
Ligne 503 ⟶ 529 :
activity_phabricator_tasks_headers = "Importance, modifiée le; Tâche; Etat; Titre",
activity_central_functions_report_title = "activity.central_functions_report(t) Lister les fonctions actuelles.",
activity_space_name_module = "Module", -- fr
activity_space_name_template = "Modèle",
Ligne 513 ⟶ 538 :
-- To translate, do not translate parts like these: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["docitem"] = "docitem",
["dockey"] = "dockey",
activity_description = "A Library:activity a phabricator feladatok kezelését, az inter Lua-kódoló al-feladatok és az interwikis központi modulok kezelését.",
Ligne 529 ⟶ 555 :
activity_phabricator_tasks_headers = "Fontosság; módosította; a Feladat; Állapot; Cím",
activity_central_functions_report_title = "activity.central_functions_report(t) Listázza az aktuális funkciókat.",
activity_space_name_module = "Modul", -- hu
activity_space_name_template = "Sablon",
Ligne 538 ⟶ 563 :
-- To translate, do not translate parts like these: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
["docfunc"] = "docfunc",
["docitem"] = "docitem",
["dockey"] = "dockey",
activity_central_library_description = "Điều này Library:activity hỗ trợ việc quản lý các công việc để nhà phân tích, các nhiệm vụ phụ liên Lua-coders, và các mô-đun trung tâm liên thông.",
Ligne 553 ⟶ 579 :
activity_phabricator_tasks_headers = "Tầm quan trọng; sửa đổi; nhiệm vụ; tình trạng; tiêu đề",
activity_central_functions_report_title = "activity.central_functions_report(t) Liệt kê các chức năng hiện tại.",
activity_space_name_module = "Mô-đun", -- vi
activity_space_name_template = "Mẫu",
Ligne 804 ⟶ 829 :
ftd = ftd .. "events.add_cat;events.add_cat_group;events.add_err;events.add_wng;events.all_kinds_test;"
ftd = ftd .. "events.categories_lister;events.errors_lister;events.gener_categories;"
ftd = ftd .. "langs.dummy_languages;langs.init_content_page_user_lang;langs.list_MediaWiki_languages;langs.
ftd = ftd .. "langs.missing_translations;langs.translations_counts;"
ftd = ftd .. "lua_table.count_all;lua_table.count_tests;lua_table.count_types;lua_table.count_values;"
Ligne 812 ⟶ 837 :
ftd = ftd .. "lua_table.to_list;lua_table.to_list_tests;lua_table.to_table;lua_table.to_table_test;"
ftd = ftd .. "mathroman.int2roman;mathroman.int2roman_test;mathroman.roman2int;mathroman.roman2int_tests;"
ftd = ftd .. "modes.all_categories_list;modes.all_errors_list;modes.
ftd = ftd .. "modes.multiple_selection_tests;modes.options_from_args_tests;modes.recursive_normal;modes.recursive_normal_tests;modes.similar_args_list;"
ftd = ftd .. "tableview.form_one_case;tableview.new;"
Ligne 821 ⟶ 846 :
ftd = ftd .. "viewers.form_image;viewers.is_in;viewers.is_in_sp;viewers.main_view;viewers.restore_configs;lua_table.rough_view;"
ftd = ftd .. "lua_table.rough_view_test;viewers.save_configs;viewers.save_restore_balance_report;viewers.simple_list;"
ftd = ftd .. "
ftd = ftd .. "viewers.table_end;viewers.table_head;viewers.table_row;viewers.styles_color_add;viewers.styles_color_colargs;"
ftd = ftd .. "viewers.styles_color_delete;viewers.styles_color_discreet;viewers.styles_color_error;viewers.styles_color_mask;"
Ligne 937 ⟶ 962 :
end -- function activity.central_libraries_autodoc(t, sorted_functions)
activity.report_subtasks_list = { -- List of subtasks to report. See "
-- Begin later below
--loadData
-- DUPLICATE NOWNOW, in change. toDoc
{ "---", "---", "---", "---", "---", "DUPLICATE NOW, in change", },
{ "20190203", "20190204", "NOW", "Rical", "S190102DDr", "Duplicate present dropboxes in a unic Template:Dropbox with redirection from previews one's like for pages", },
{ "
{ "
{ "20190126", "20190202", "NOW", "Rical", "S181023s7P", "Begin: search 7 Projects : MediaWikis wikidata wikipedia wikisource wikiquote ? 3 days", },
{ "20190126", "20190202", "NOW", "Rical", "S181023iLC", "Begin: Rical invite 7 Lua-coders : Tpt, Zolo, Od1n, Julien1978, Daehan, VIGNERON ? 3 days", },
{ "20190124", "20190126", "NOW", "Rical", "S181020umf", "update MediaWiki:Scribunto/Central manual for ;activity.phabricator_tasks_report;activity.rough_date_days;...", },
{ "20190122", "20190124", "NOW", "Rical", "S181018CrC", "Module:CentralSchool: finish reciprocal adaptation with Module:Centralizer", },
{ "20190121", "20190122", "NOW", "Rical", "S181016vap", "restore versions.anti_crash(frame) if not pcall() recursive in versions.tree_branch='v1;v2;v3' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_arg has a arg_default in p.known_args and a .delete = 'delete' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_data has a data_default in datas.known_datas and a .delete = 'delete' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_mode has a mode_default in modes.known_modes and a .delete = 'delete' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_version has a version_default in versions.version_args and a .delete = 'delete' ", },
-- function versioning.antiCrash(options, content_or_func, ...) -- Form the display of a running error. in ModuleCentral 20170902.ModuleCentral 2e no antiCrash ok.lua
{ "20190120", "20190120", "NOW", "Rical", "S190120mst", "update function tab_view.form_one_case + translate from multiple_selection_test1(...", },
{ "20190120", "20190120", "NOW", "Rical", "S190120rnt", "update function tab_view.form_one_case + translate from recursive_normal_test1(...", },
{ "20190120", "20190120", "NOW", "Rical", "S190120upt", "update activity.phabricator_tasks_report", },
{ "20190120", "20190120", "NOW", "Rical", "S190120ust", "Module:Centralizer update subtasks list", },
{ "20190115", "20190120", "NOW", "Rical", "S190115rtn", "ModuleCentralizer replace template's display to their names in fr.wikipedia.org and fr.wikisouce.org", },
-- S181224rtn : a similar comportment suggest a change in MW"
-- S181224rtn : do not happened before the MediaWiki version "1.33.0-wmf.9 (02196d2)"
{ "20190107", "20190108", "NOW", "Rical", "S181220oso", "select only sub-functions in the right order in function p.Init_central_module()", },
{ "20190106", "20190106", "NOW", "Rical", "S181220ust", "Module:Centralizer update subtasks list", }, -- search abnormal tests
--
-- Automatic shift of below "todo" subtasks.
{ "---", "---", "---", "---", "---", "Automatic shift of below todo subtasks", },
{ "
{ "
{ "
{ "
{ "
{ "
{ "
{ "20171015", "20171018", "todo", "Rical", "S171015trk", "add a method tracker:trk(self, ...) from tracker.add(opt, ...). see Lua_reference_manual#Function_declaration_statements", }, --
{ "
{ "
{ "
{ "
{ "
{ "
-- see 4.2 Paramètre "wikidata" https://fr.wikipedia.org/wiki/Aide:Infobox_en_Lua#Param.C3.A8tre_.22wikidata.22
{ "20170910", "20170914", "done", "Rical", "S170910bob", "Create a button object for boxes, like drop_box with: n, states, shapes, keywords, colors", },
{ "
{ "
{ "
{ "
{ "20170816", "20170823", "
{ "20170816", "20170823", "
{ "20170816", "20170823", "
{ "20170816", "20170823", "
{ "
{ "
{ "20170811", "20170815", "
{ "20170811", "20170815", "
{ "20170811", "20170815", "
{ "20170811", "20170815", "
-- S170718FLI : in https://www.wikidata.org/wiki/Wikidata:Property_proposal/Person#Noms().", },
-- S170718FLI : T53657 is Close : Firstname and Lastname properties
-- S170718FLI : T53657 to re Open : Firstname and Lastname properties. Follow Aklapper comment on Jul 19 2013, 12:51
{ "
-- if viewers.is_in("_i_cat", key) then key = "versions_with_internal_error" -- = "Module with internal error",
-- elseif viewers.is_in("_u_cat", key) then key = "versions_with_usage_error" -- = "Module with usage error",
{ "20170810", "20170811", "
{ "
{ "
{ "
{ "
{ "
{ "20170810", "20170811", "todo", "Rical", "S170617rpd", "debug modes.recursive_normal() test", },
{ "
{ "
{ "20170808", "20170810", "todo", "Rical", "S170707icc", "Begin: begin to integrate changes from other coders", },
{ "20170808", "20170810", "todo", "Rical", "S170707icc", "Begin: update important Phabricator tasks to activate their availability", },
-- Inform after 'Create Begin'
{ "20170805", "20170807", "todo", "Rical", "S170702cJP", "Begin: Lua-coders Utilisateur:JackPotte [[:fr:Utilisateur:JackPotte|JackPotte fr de es en]]", },
{ "20170805", "20170807", "todo", "Rical", "S170702wvm", "Begin: announce Meet coders throught Wikis video meeting France SWEL-fr https://meet.jit.si/swel-fr", },
{ "20170805", "20170807", "todo", "Rical", "S170702atr", "Begin: Ask translations in meta [https://meta.wikimedia.org/wiki/Translation_requests Translation_requests]", },
{ "20170805", "20170807", "todo", "Rical", "S170604iTN", "Begin: inform [https://meta.wikimedia.org/wiki/Tech/News#contribute Tech News] about central modules begin phase", },
-- S170604iTN : Tech/News#contribute : central, begin to use, efficiency, ask lua coders ?
-- Debug to support Create Begin's group
Ligne 1 026 ⟶ 1 049 :
-- Begin later behind
--
-- NOWNOW DP, NOW, in change
{ "---", "---", "---", "---", "---", "NOW, in change", },
{ "20190203", "20190204", "NOW", "Rical", "S190102DDr", "Duplicate present dropboxes in a unic Template:Dropbox with redirection from previews one's like for pages", },
{ "20190203", "20190204", "NOW", "Rical", "S181101tgl", "Begin: translate by groups of languages : like for viet, laos, cambodgia, allways with en, es, fr 1 days", },
{ "20190203", "20190204", "NOW", "Rical", "S181101aip", "Begin: when 10 used cases, announce that in the phabtask, then when 20, then for xmas 1 days", },
{ "20190126", "20190202", "NOW", "Rical", "S181023s7P", "Begin: search 7 Projects : MediaWikis wikidata wikipedia wikisource wikiquote ? 3 days", },
{ "20190126", "20190202", "NOW", "Rical", "S181023iLC", "Begin: Rical invite 7 Lua-coders : Tpt, Zolo, Od1n, Julien1978, Daehan, VIGNERON ? 3 days", },
{ "20190124", "20190126", "NOW", "Rical", "S181020umf", "update MediaWiki:Scribunto/Central manual for ;activity.phabricator_tasks_report;activity.rough_date_days;...", },
{ "20190122", "20190124", "NOW", "Rical", "S181018CrC", "Module:CentralSchool: finish reciprocal adaptation with Module:Centralizer", },
{ "20190121", "20190122", "NOW", "Rical", "S181016vap", "restore versions.anti_crash(frame) if not pcall() recursive in versions.tree_branch='v1;v2;v3' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_arg has a arg_default in p.known_args and a .delete = 'delete' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_data has a data_default in datas.known_datas and a .delete = 'delete' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_mode has a mode_default in modes.known_modes and a .delete = 'delete' ", },
{ "20190120", "20190121", "NOW", "Rical", "S181015odd", "one_version has a version_default in versions.version_args and a .delete = 'delete' ", },
-- function versioning.antiCrash(options, content_or_func, ...) -- Form the display of a running error. in ModuleCentral 20170902.ModuleCentral 2e no antiCrash ok.lua
{ "20190120", "20190120", "NOW", "Rical", "S190120mst", "update function tab_view.form_one_case + translate from multiple_selection_test1(...", },
{ "20190120", "20190120", "NOW", "Rical", "S190120rnt", "update function tab_view.form_one_case + translate from recursive_normal_test1(...", },
{ "20190120", "20190120", "NOW", "Rical", "S190120upt", "update activity.phabricator_tasks_report", },
{ "20190120", "20190120", "NOW", "Rical", "S190120ust", "Module:Centralizer update subtasks list", },
{ "20190115", "20190120", "NOW", "Rical", "S190115rtn", "ModuleCentralizer replace template's display to their names in fr.wikipedia.org and fr.wikisouce.org", },
-- S181224rtn : a similar comportment suggest a change in MW"
-- S181224rtn : do not happened before the MediaWiki version "1.33.0-wmf.9 (02196d2)"
{ "20190107", "20190108", "NOW", "Rical", "S181220oso", "select only sub-functions in the right order in function p.Init_central_module()", },
{ "20190106", "20190106", "NOW", "Rical", "S181220ust", "Module:Centralizer update subtasks list", }, -- search abnormal tests
-- Already done
{ "---", "
{ "
{ "
{ "20190106", "20190107", "done", "Rical", "S181205mgT", "function modes.get_args_datas_tests(t) Tactic all in one for modes args datas no known_arguments no origins old" },
{ "20180824", "20180825", "done", "Rical", "S180824iCD", "in activity.begin_central_modules_support() header namespace and local links.", },
{ "20180730", "20180730", "done", "Rical", "S180730ust", "Module:Centralizer update subtasks list", },
Ligne 1 052 ⟶ 1 100 :
{ "20180604", "20180604", "done", "Rical", "S180604crm", "For 'Begin' T20180604 Update Central modules reference manual. DONE", },
{ "20180518", "20180518", "done", "Rical", "S180518ust", "Module:Centralizer update subtasks list", },
{ "20180421", "20180421", "done", "Rical", "S180421CGL", "For 'Begin' renew
{ "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.
{ "---", "---", "---", "---", "---", "STOP the display of this table", },
{ "20170729", "20170729", "done", "STOP", STOP = "STOP", }, -- STOP the display of this table
Ligne 1 077 ⟶ 1 125 :
ccc = {}, -- To communicate and compute between cases
rowGroup = {},
}
local function tab_view_rough_shifter(tab_view) -- Monitor and shift tasks.
Ligne 1 149 ⟶ 1 196 :
activity.phabricator_tasks_Group = { -- toDoc
-- Importance: Important
{ 100, "Important", "20181121", "T107595", 0, "Open", "[RFC] Multi-Content Revisions", },
-- CCicalese_WMF removed a subtask: : Introduce a ContentStore service to allow certain types of content to not be stored as serialized blobs..
{ 102, "Important", "20181005", "T173207", 0, "Open", "Implement Lua alternative to {{int:Lang}} / wgUserLanguage", },
{ 104, "Important", "20180817", "T168726", 0, "Open", "Create syntax documentation page for Special:PageData.", },
{ 106, "Important", "20180806", "T4085", 0, "Open", "Add a {{USERLANGUAGE}}/{{USERLANG}} magic word", },
{ 108, "Important", "20180710", "T107119", 0, "Open", "Provide a Lua method mw.loadTemplateData()", }, -- See PageData
{ 110, "Important", "20180626", "T135845", 0, "Assigned", "Convert any module as central or centralisable", },
-- T135845 : Central modules must be really multi wikis.
-- T135845 : For this goal they need to join a standard template with the central module.
-- T135845 : But the MediaWiki security prohibit them in Lua modules. Then the deployment must do these.
{ 112, "Important", "20180603", "T85461", 0, "Resolved", "Lua error: too many language codes requested", },
-- T85461 https://meta.wikimedia.org/wiki/Module:Assemble_multilingual_message
-- T85461 https://meta.wikimedia.org/w/index.php?title=Module:Assemble_multilingual_message&action=edit#mw-ce-l46
-- : Authored By daniel, Jul 31 2015. modif Nov 21 2018, 17:16
{ 114, "Important", "20180412", "T185557", 0, "Open", "Create the easy function mw.wikibase.property('P21', 'Q8023', 'en')", },
{ 116, "Important", "20180413", "T142093", 0, "Open", "Decide how to do usage tracking for strings_c used to lookup entities (page titles, external ids, …)", },
{ 118, "Important", "20170921", "T176362", 0, "Declined", "Implement ClassNameTests in Scribunto to enhance central modules stability", },
{ 126, "Important", "20170907", "T68051", 1, "Open", "Central modules need the user language to display errors and category names", },
{ 122, "Important", "20170727", "T149532", 0, "Resolved", "Why Multi-Content-Revisions? Use cases and requirements.", },
{ 120, "Important", "20170713", "T163923", 0, "Resolved", "Create Special:PageData as a canonical entry point for machine readable page data.", },
{ 106, "Important", "20170703", "T20170703", 0, "ToCreate", "Standardize content, page and user langages availability", },
-- T20170703 : Rename T68051 : "Central modules need the user language to display errors and category names"
Ligne 1 157 ⟶ 1 224 :
{ 110, "Important", "20170325", "T20170325", 0, "ToCreate", "Centralize and share central datas about central modules", },
-- T20170325 : Centralize datas as MediaWiki versions installations in each lang-project, uses of central modules (helpers, projects, languages ...).
{ 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
Ligne 1 268 ⟶ 1 313 :
local t = t or "\n* <b>activity.phabricator_tasks_report()</b> Monitor states of known phabricator tasks,"
t = t .. "\n* How to well report a task like in <b><big>viewers.phab_task('T149532#2878699', 'that task')</big></b> :"
t = t .. "\n* 1
t = t .. "\n* 4
t = t .. "\n* 5
t = t .. "\n* 7
t = t .. "\n* 8
t = t .. "\n* 10
local mwtitle = mw.title.getCurrentTitle()
local tasks_Group = activity.phabricator_tasks_Group
Ligne 1 304 ⟶ 1 349 :
}
function tab_view.form_one_case(task) -- Convert a task from test_group to rowGroup.
task.phab = viewers.phab_task(task.phab, task.phab)
local usual = "discreet"
if viewers.is_in(task.status, "ToCreate, Declined, Invalid, ") then usual = "discreet"
Ligne 1 382 ⟶ 1 427 :
headers_class = "wikitable alternative center sortable",
rowGroup = {},
}
-- from MediaWiki 1.30.0-wmf.4 (3248a17) 22:41, 7 June 2017
Ligne 1 507 ⟶ 1 552 :
-- datas = {} -- already declared by Scribunto, see central_library.new() -- Record a library in package.loaded
datas.default_item = datas.default_item or "
datas.i18n = {} -- Translations for datas library
Ligne 1 513 ⟶ 1 558 :
-- Pour traduire, les langues de référence sont l'anglais et le français.
-- Pour traduire, ne traduisez pas des parties comme celles-ci : <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
-- Wikidata
datas_Wikidata_header = "Données : ",
Ligne 1 536 ⟶ 1 579 :
datas_update_Special_PageData_header = "site; temps de version; identificateur de version; heure de vue",
datas_get_item_report_title = "datas.get_item_report() Rapporte les données de mw.wikibase pour la page ou tout autre élément.",
-- Messages et erreurs divers
datas_no_args_Wikidata_err = "Erreur interne : Module sans table d'arguments Wikidata.",
Ligne 1 544 ⟶ 1 586 :
-- Zum Übersetzen sind die Referenzsprachen Englisch und Französisch.
-- Übersetze keine Teile wie diese: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
datas_Wikidata_header = "Daten: ",
datas_known_Datas_header = "Bekannte Daten: ",
Ligne 1 566 ⟶ 1 606 :
datas_update_Special_PageData_header = "Ort; Versionszeit; Versionskennung; Stunde der Sicht",
datas_get_item_report_title = "datas.get_item_report() Gibt mw.wikibase-Daten für die Seite oder einen anderen Artikel aus.",
-- Verschiedene Nachrichten und Fehler
datas_no_args_Wikidata_err = "Interner Fehler: Modul ohne Wikidata-Argumenttabelle.",
Ligne 1 574 ⟶ 1 613 :
-- To translate, referral languages are English and French.
-- To translate, do not translate parts like these: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
datas_Wikidata_header = "Datas: ",
datas_known_Datas_header = "Known datas: ",
Ligne 1 600 ⟶ 1 637 :
datas_update_Special_PageData_header = "site; version time; version identifier; seen hour",
datas_get_item_report_title = "datas.get_item_report() Reports datas from mw.wikibase for the page or any other item.",
-- Miscellaneous warnings and errors
datas_no_args_Wikidata_err = "Error: Module without Wikidata arguments table.",
Ligne 1 608 ⟶ 1 644 :
-- Para traducir, los idiomas de referencia son inglés y francés.
-- Para traducir, no traduzca partes como estas: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
-- Wikidata
known_arguments_monument = "MADRID_100206_UDCI_023.jpg", -- Puerta del Sol
datas_Wikidata_header = "Datos: ",
datas_known_Datas_header = "Datos conocidas: ",
Ligne 1 634 ⟶ 1 668 :
datas_update_Special_PageData_header = "sitio; tiempo de versión; identificador de versión; tiempo visto",
datas_get_item_report_title = "datas.get_item_report() Informes de datos de mw.wikibase para la página o cualquier otro elemento.",
-- Diversos mensajes y errores
datas_no_args_Wikidata_err = "Error: Módulo sin argumentos Wikidata tabla.",
Ligne 1 642 ⟶ 1 675 :
-- Pour traduire, les langues de référence sont l'anglais et le français.
-- Pour traduire, ne traduisez pas des parties comme celles-ci : <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
-- Wikidata
datas_Wikidata_header = "Données : ",
datas_known_Datas_header = "Données connues : ",
Ligne 1 669 ⟶ 1 700 :
datas_update_Special_PageData_header = "site; temps de version; identificateur de version; heure de vue",
datas_get_item_report_title = "datas.get_item_report() Rapporte les données de mw.wikibase pour la page ou tout autre élément.",
-- Messages et erreurs divers
datas_no_args_Wikidata_err = "Erreur interne : Module sans table d'arguments Wikidata.",
Ligne 1 677 ⟶ 1 707 :
-- Zum Übersetzen sind die Referenzsprachen Englisch und Französisch.
-- Übersetzen Sie keine Teile wie diese: <b>%1</b> ; <b>%1</b> = <b>%2</b> (%3) ; <code>Q535</code> ; <br/> ; \n* ; _G.
datas_Wikidata_header = "Adat: ",
datas_known_Datas_header = "Ismert adatok: ",
Ligne 1 699 ⟶ 1 727 :
datas_get_item_report_title = "datas.get_item_report() Rapporte les données de mw.wikibase pour la page ou tout autre élément.",
-- Messages et erreurs divers
datas_no_args_Wikidata_err = "Erreur interne : Module sans table d'arguments Wikidata.",
Ligne 1 707 ⟶ 1 734 :
-- Để dịch, các ngôn ngữ giới thiệu là tiếng Anh và tiếng Pháp.
-- Để dịch, không dịch các phần như thế này: <b>%1</b> ; <b>%2</b> = <b>%3</b> (<b>%4</b>) ; <code>Q535</code> ; <br/> ; <br/> ; \n* ; _G.
datas_Wikidata_header = "Dữ liệu: ",
datas_known_Datas_header = "Dữ liệu nổi tiếng: ",
Ligne 1 729 ⟶ 1 754 :
datas_update_Special_PageData_header = "địa điểm; thời gian phiên bản; định danh phiên bản; thấy giờ",
datas_get_item_report_title = "datas.get_item_report() Báo cáo dữ liệu mw.wikibase cho trang hoặc bất kỳ mục nào khác.",
-- Các thông báo và lỗi khác nhau
datas_no_args_Wikidata_err = "Lỗi nội bộ: Mô-đun không có bảng đối số Wikidata.",
Ligne 1 739 ⟶ 1 763 :
local t = t or "\n* <b>datas.available_props_report(t)</b> Reports availables datas properties.\n* "
local i = 0
-- t = t .. "\n*
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments
for key,
if type(
i = i + 1 ; t = t .. viewers.ta(
end
end
Ligne 1 843 ⟶ 1 867 :
end
function datas.property(one_arg) -- Get datas from mwwikibase for one property of the page.
one_arg = mw.clone(one_arg) -- avoid any interaction with other properties.
datas.QITEM = mw.wikibase.getEntityIdForCurrentPage() -- use props.QITEM Returns the Item id as string, like "Q42"
datas.
local
local label = nil
local val = nil
if one_arg.prop then -- Admit any type of keyword and prop.
one_arg.keyword = one_arg.keyword or one_arg.key or one_arg.prop
one_arg.prop = one_arg.prop -- Get datas from mwwikibase for one property of the page.
if one_arg.prop == "QITEM" then val = mw.wikibase.getEntityIdForCurrentPage() -- use props.QITEM Returns the Item id as string, like "Q42"
elseif one_arg.prop == "label" then val = datas.item:getLabel(QITEM) ; label = label or val -- use props.label Returns a string, like "Berlin" with 'de'
elseif one_arg.prop == "sitelink" then val = datas.item:getSitelink() -- use props.sitelink like Author:Aristotel
elseif one_arg.prop == "labelwithlang" then val = mw.wikibase.entity:getLabelWithLang() -- use props.labelwithlang -- Returns a string like "Berlin" and a language like
elseif one_arg.prop == "description" then val = mw.wikibase.description(QITEM) -- use props.description -- ric : Description of the QITEM page
elseif one_arg
elseif one_arg
else -- ric (p.box_read)
loc.formatPropertyValues = datas.item:formatPropertyValues( one_arg.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_arg, { loc.wd_RANK_TRUTH } )
end
if loc.wd_claimRanks then
end
val = loc.formatPropertyValues.value
end
val = tostring(val)
val = tostring(val)
one_arg.val = val
end --function modes.activate_known_arguments(
one_arg.label = label or one_arg.label or one_arg.labeluser or one_arg.labelcontent or one_arg.labelpage or one_arg.labelbylang
one_arg = mw.clone(one_arg) -- avoid any interaction with other properties.
return one_arg
end --
function datas.get_item(known_arguments, QITEM) -- Get datas from mw.wikibase for the page.
-- from 2016-08-16 ModuleCentral 3a lua_table.to_list.lua
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments
local t = "\n* <b>datas.get_item(known_arguments, QITEM)</b>: Get datas from mw.wikibase for the page."
local Title, Label, prop, lang, description, val, label, adr, proplabel
local QITEM = QITEM or mw.wikibase.getEntityIdForCurrentPage() or datas.default_item or
datas.QITEM = QITEM
datas.item = mw.wikibase.getEntity(datas.QITEM or "Q34743") -- Rudyard Kipling
local props = {} -- All properties form known_arguments with
local prop = {} -- to collect properties
local loc = {} -- local values
Ligne 1 899 ⟶ 1 922 :
one_arg.key = key
one_arg.syn = one_arg.syn or 0
one_arg = datas.
if one_arg.keyword == "QITEM" then one_arg.val = QITEM end
if one_arg.prop then -- Admit any type of keyword and prop.
props[one_arg.keyword] = mw.clone(one_arg)
prop[one_arg.keyword] = one_arg.val -- ric (p.box_read)
end
end
Ligne 1 914 ⟶ 1 937 :
end -- local prop, props = datas.get_item(known_arguments, QITEM) -- Get datas from mw.wikibase for the page.
local memo = viewers.save_configs("datas.get_item_report") -- Save global configuration before eventual changes.
local t = t or "\n* <b>datas.get_item_report(t)</b>: Report datas from mw.wikibase for the page **"
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- modes.known_arguments = { -- p.known_arguments
local prop, props = datas.get_item(known_arguments, QITEM) -- Get datas from mw.wikibase for the page. ric
local countprops = tostring( lua_table.level_count(props) ) -- do not follow one_prop structure
local countallprops = tostring( lua_table.level_count(props) ) -- do not follow one_prop structure
Ligne 1 925 ⟶ 1 947 :
local sortprops = {} -- to sort properties in alphabetic order
for key, val in pairs(props) do -- from list all fond datas
-- t = t .. "\n* get_item: " .. viewers.ta("key", key) .. viewers.ta("val", val)
table.insert(sortprops, props[key])
end
Ligne 1 931 ⟶ 1 954 :
test_group = sortprops, -- Use default cases.
rowGroup = {},
title_memo = "datas_get_item_report_title
form_one_case = function(case) -- Convert a case from test_group to rowGroup.
return { case.
headers = "key; val; typ; need; keyword; syn; prop; format",
}
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
Ligne 1 944 ⟶ 1 965 :
viewers.restore_configs(memo, "datas.get_item_report") -- Restore global configurations after eventual changes.
return t
end -- local t = datas.get_item_report(t) -- datas.get_item() Report datas from mw.wikibase for the page **
function datas.prot(prop) -- form a string to show a prop value
Ligne 2 014 ⟶ 2 035 :
headers = "key;val",
rowGroup = {},
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 2 043 ⟶ 2 063 :
end
end -- function datas.load_data(t, datext) -- Pass data between #invoke's
-- cut_libraries
-- - - - ------------------ - - - - ------------------ - - - - -----------------------------
-- - - - ------------------ - - - - ------------------ - - - - -----------------------------
-- The Library:events supports events of types erros, warnings and categories.
-- viewers.save_configs("events.save_configs" memo, tab_view, group ) -- Init a new events group
-- events.add_err(key, ... ) -- Add an error in the actual table of events.
-- events.add_cat_group(groupCat, groupList) -- Add some categories in the actual table of events.
-- events.formats(one_event) -- Format events types
-- events.all_categories_test(t) -- test categories
-- - - - ------------------ - - - - ---------------------------------
-- - - - ------------------ - - - - ---------------------------------
-- events = {} -- already declared by Scribunto, see central_library.new() -- Record a library in package.loadedS
events.i18n = {} -- Translations for Library:events
events.i18n.br = {
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "Tester categ_Test : catégories dans quelques langues",
events_all_kinds_tests_title = "events.all_kinds_test() Test: toutes les sortes d'événements (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_add_cat_deprecated = "Fonction obsolète dans le module principal.",
events_close_without_memo_err = "viewers.restore_configs(memo, where) sans <b>memo</b> dans le module <b>%1</b>.",
events_antiCrash_protect_err = "La fonction antiCrash() protège cette page contre un effondrement complet dû à une erreur interne : %1.",
} -- events.i18n.br
events.i18n.en = {
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "categ_Test test : classes in some languages",
events_all_kinds_tests_title = "events.all_kinds_test() Test: all kinds of events (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_close_without_memo_err = "viewers.restore_configs(memo, where) without <b>memo</b> in module <b>%1</b>.",
events_antiCrash_protect_err = "The antiCrash() function protects this page against a complete crash due to an internal error: %1.",
} -- events.i18n.en
events.i18n.es = {
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "Prueba categ_Test: clases en algunos lenguajes",
events_all_kinds_tests_title = "events.all_kinds_test() Prueba: todo tipo de eventos (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_add_cat_deprecated = "Función obsoleto en módulo principal.",
events_close_without_memo_err = "viewers.restore_configs(memo, where) sin <b>memo</b> en el módulo <b>%1</b>.",
events_antiCrash_protect_err = "La función antiCrash() protege esta página contra un colapso completo debido a un error interna: %1.",
} -- events.i18n.es
events.i18n.fr = {
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "Tester categ_Test : catégories dans quelques langues",
events_all_kinds_tests_title = "events.all_kinds_test() Test: toutes les sortes d'événements (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_add_cat_deprecated = "Fonction obsolète dans le module principal.",
events_close_without_memo_err = "viewers.restore_configs(memo, where) sans <b>memo</b> dans le module <b>%1</b>.",
events_antiCrash_protect_err = "La fonction antiCrash() protège cette page contre un effondrement complet dû à une erreur interne : %1.",
} -- events.i18n.fr
events.i18n.hu = {
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "Tester categ_Test : catégories dans quelques langues",
events_all_kinds_tests_title = "events.all_kinds_test() Test: toutes les sortes d'événements (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_add_cat_deprecated = "Fonction obsolète dans le module principal.",
events_close_without_memo_err = "viewers.restore_configs(memo, where) sans <b>memo</b> dans le module <b>%1</b>.",
events_antiCrash_protect_err = "La fonction antiCrash() protège cette page contre un effondrement complet dû à une erreur interne : %1.",
} -- events.i18n.hu
events.i18n.vi = {
events_test_tests_title = "List a table, test with limits:",
events_test_resTest_title = "List a table, test with limits:",
events_test_projects_title = "Test and display tests events for projects",
events_test_projects_headers = "Type;Key;Name test and values;result of the test",
events_test_MediaWiki_title = "Test and display tests events for MediaWiki",
events_test_MediaWiki_headers = "Type;Key;Name test and values;result of the test",
events_test_categ_Test_title = "Tester categ_Test : catégories dans quelques langues",
events_all_kinds_tests_title = "events.all_kinds_test() Test: toutes les sortes d'événements (err, wng, cat)",
events_all_kinds_tests_headers = "typ;key;idargs;result",
events_add_cat_deprecated = "Fonction obsolète dans le module principal.",
events_close_without_memo_err = "viewers.restore_configs(memo, where) sans <b>memo</b> dans le module <b>%1</b>.",
events_antiCrash_protect_err = "La fonction antiCrash() protège cette page contre un effondrement complet dû à une erreur interne : %1.",
} -- events.i18n.vi
events.test_group = {}
events.rowGroup = {}
events.tab_view = {}
events.tab_view.test_group = {}
events.tab_view.rowGroup = {}
function events.add_cat(key, ... ) -- Add a category in the actual table of events.
return events.add_record("cat", key, ...) -- Add a error, warning or category in the lists. S170626rev
end
function events.add_err(key, ... ) -- Add an error in the actual table of events.
return events.add_record("err", key, ...) -- Add a error, warning or category in the lists. S170626rev
end
function events.add_wng(key, ... ) -- Add a warning in the actual table of events.
return events.add_record("wng", key, ...) -- Add a error, warning or category in the lists. S170626rev
end
function events.formats_cat(one_event, txt, lnk, c, space)
local space = space or (mw.site.namespaces.Category.name .. ":")
local c = c or one_event.ccc or ":"
if one_event.typ == "cat" then -- Format a category to display or activate
one_event.content_wkt = viewers.form9content(one_event.key, lua_table.to_list( one_event.vals ) )
one_event.page_wkt = viewers.form9page(one_event.key, lua_table.to_list( one_event.vals ) )
one_event.user_wkt = viewers.form9user(one_event.key, lua_table.to_list( one_event.vals ) )
return " [[" .. c .. space .. (one_event.content_wkt or lnk) .. "|" .. (one_event.user_wkt or txt) .. "]] "
else
return ""
end
end
events.all_events_group = {} -- Table to collect all events types "err", "wng" and "cat".
function events.new(typ, key, ...) -- Initialize and finalize a new event.
local one_event = {} -- default event
if type(typ) == "table" then
one_event = typ -- Use a predefined event
else -- To finalize an existing event.
one_event.typ = typ
one_event.key = key
end -- Finalize all events
one_event.typ = one_event.typ or typ -- Type of event: err, wng, cat
one_event.key = one_event.key or key -- Translation key, simple or extended by name
if type(typ) ~= "string" then typ = "notyp" end -- To debug abnormal type of event
if type(key) ~= "string" then key = "nokey" end -- To debug abnormal translation key
one_event.name = one_event.typ or one_event.key or "name" -- Translation key, simple or extended by name
one_event.vals = one_event.vals or { ... } -- table of arguments values
one_event.catview = one_event.catview or ":" -- Default value for eventual use
-- Check, yes or no, to form an event, in special cases
if (one_event.typ == "cat") then
one_event.res, one_event = events.formats( one_event ) -- Formats the resulting wikitext, can be re-form later
elseif (one_event.typ == "err") then
one_event.res, one_event = events.formats( one_event ) -- Formats the resulting wikitext, can be re-form later
elseif (one_event.typ == "wng") then
one_event.res, one_event = events.formats( one_event ) -- Formats the resulting wikitext, can be re-form later
end
return one_event
end -- function events.new(typ, key, ...)
function events.add_new(one_event) -- Add a error, warning or category in the lists. S170626rev
-- Select only new events
if type(one_event) ~= "table" then one_event = {} end
local new_one_event = viewers.form9tests( tostring(one_event.key), lua_table.to_list( one_event.vals ) )
for i, event in pairs(events.all_events_group) do
local old_one_event = viewers.form9tests( tostring(event.key), lua_table.to_list( event.vals ) )
if new_one_event == old_one_event then new_one_event = nil ; break end -- Add only new events. Reject already seen events.
end
-- events.add_wng("modes_auto_val_warning_wng", langs.user_translations[key], val) -- form_result
if new_one_event then table.insert(events.all_events_group, one_event) end
return one_event
end -- function events.add_new(typ, ref, ...)
function events.add_record(typ, key, ... ) -- Add a new error, warning or category in a list.
-- Guide line: all events are in a single table, including categories, without duplication.
-- Guide line: without duplication: events differ if the type, the key or any value of any argument differs.
-- Guide line: We can view or categorize categories.
local intern_or_use = versions.memo_i18n["en"][key]
local one_event = events.new(typ, key, ...) -- Initialize and finalize a new event.
local one_event = events.add_new(one_event) -- Add an error, warning or category in the lists. S170626rev
local res, one_event = events.formats(one_event, c) -- Format an event as an error, warning or category.
return res, one_event
end -- local res, one_event = events.add_record(typ, key, ... )
function events.formats(one_event, c) -- Format an event as an error, warning or category.
one_event.res = tostring(one_event.res) .. "? form " .. viewers.form9tests(".form one_event.key=%1, one_event.res=%2, ", one_event.key, one_event.res )
local one_event = mw.clone(one_event) -- do not disturb input event
if type(one_event) ~= "table" then
one_event.res = lua_table.rough_view(one_event)
return one_event.res, one_event
end
if (one_event.typ ~= "cat") and (one_event.typ ~= "wng") and (one_event.typ ~= "err") then
one_event.res = lua_table.rough_view(one_event)
return one_event.res, one_event
end
one_event.tableStyle = one_event.tableStyle or "" -- Could change the style of the wikitext. Not available on 20160916
if type(one_event.name) ~= "string" then one_event.name = ""
elseif one_event.name ~= "" then one_event.name = one_event.name .. "_" end
one_event.idargs = one_event.name .. tostring( viewers.form9user( tostring(one_event.key), lua_table.to_list( one_event.vals ) ) )
-- Each type of event formats its own type of wikitext
one_event.content_wkt = viewers.form9content(one_event.key, lua_table.to_list( one_event.vals ) )
one_event.page_wkt = viewers.form9page(one_event.key, lua_table.to_list( one_event.vals ) )
one_event.user_wkt = viewers.form9user(one_event.key, lua_table.to_list( one_event.vals ) )
one_event.res = "" -- multilingual
if one_event.typ == "err" then one_event.res = viewers.styles_color_error(one_event.user_wkt) end
if one_event.typ == "wng" then one_event.res = viewers.styles_color_warning(one_event.user_wkt) end
one_event.ccc = c or one_event.catview or events.catview or ":"
one_event.content_catspace = mw.site.namespaces.Category.name -- name: Local namespace name.
if one_event.typ == "cat" then -- Format a category to display or activate
one_event.res = events.formats_cat(one_event)
if viewers.is_in("_i_cat", key) then -- If needed, add a second "Category:Module with internal error"
res = res .. events.add_cat("versions_with_internal_error")
end
if viewers.is_in("_u_cat", key) then -- If needed, add a second "Category:Module with user error"
res = res .. events.add_cat("versions_with_user_error")
end
end
return one_event.res, one_event
end -- function events.formats(one_event, c)
events.all_kinds_test_test_group = {
{ "abc", "langs_form9user_all_types_values", { "pi = ", "circle / diameter", 3.14, }, },
{ "equation", "langs_form9user_all_types_values", { 11, 7, 3.14, }, },
{ "Matrix:", "langs_form9user_all_types_values", { "2.1.0", "v4-6, ISO_8601, FC14 h6", }, },
{ "pi = ", "langs_form9user_all_types_values", { "circle / diameter", 3.14, }, },
{ "quadrature", "langs_form9user_all_types_values", { function() end, "convert a square to a circle", }, },
}
-- langs_form9user_all_types_values = "Test: string=%1 number=%2 nil=%3 function=%4 table=%5.",
function events.all_kinds_test(t) -- Test: all kinds of events (err, wng, cat)
local memo = viewers.save_configs("events.all_kinds_test") -- Save global configuration before eventual changes.
events.all_kinds_trck = "\n* events.all_kinds_trck: "
local t = t or ""
t = t .. "\n* events.all_kinds_test(t) -- Test: all kinds of events (err, wng, cat): "
t = t .. events.all_kinds_trck
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = events.all_kinds_test_test_group, -- Use default cases.
title_memo = "events_all_kinds_tests_title", -- "events.all_kinds_test() Test: all kinds of events (err, wng, cat)",
headers = "events_all_kinds_tests_headers", -- "typ;key;idargs;result",
rowGroup = {},
}
function tab_view.form_one_case(one_event) -- Convert a case from test_group to rowGroup.
return { one_event.typ or "t", one_event.key or "k", one_event.idargs or "i", one_event.res or "r" }
end
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
t = t .. viewers.ta("end #test_group *2", lua_table.level_count(tab_view.test_group) ) -- function tableview.new( nil bug170602
t = t .. viewers.ta("end #rowGroup *2", lua_table.level_count(tab_view.rowGroup) ) -- function tableview.new( nil bug170602
t = t .. events.all_kinds_trck
viewers.restore_configs(memo, "events.all_kinds_test") -- Restore global configurations after eventual changes.
return t
end -- function events.all_kinds_test(t)
function events.add_cat_group(groupCat, groupList) -- Add some categories in the actual table of events. Separated by ";".
-- catGroup("Country %1", "France,Italia") -> [[Category:Country France]] [[Category:Country Italia]]
if type(groupCat) ~= "string" then groupCat = "%1" end
if type(groupList) ~= "string" then return "" end
local cats = ""
for i, str in mw.text.gsplit(groupList, ";", true) do
local wkt = viewers.form9user(groupCat, str)
cats = cats .. events.add_cat(groupCat, wkt)
end
local res, one_event = events.add("catGroup", groupCat, cats) -- Add an event to a group.
one_event.trc = one_event.trc .. viewers.form9user("\n* add_cat one_event.typ=%1, one_event.key=%2, ", one_event.typ, one_event.key)
return res, one_event
end -- function events.add_cat_group(groupCat, groupList)
function events.select_typ(typ) -- Select events by one type
local is = {}
for i, one_event in pairs(events.test_group) do
if one_event.typ == typ then table.insert( is, one_event.idargs ) end
end
return is
end
function events.sort_typ() -- Sort events by type in wng, err, cat.
local wng, err, cat = {}, {}, {}
for i, one_event in pairs(events.test_group) do
if one_event.typ == "wng" then table.insert( wng, one_event ) end
if one_event.typ == "err" then table.insert( err, one_event ) end
if one_event.typ == "cat" then table.insert( cat, one_event ) end
end
return wng, err, cat
end -- function events.sort_typ()
function events.selector( tab_view, one_event )
if type(one_event) ~= "table" then
one_event = { -- options for tableview.new() -- Formats a table with lines and columns.
headers = "typ;key;selector-name;wkt",
style = "",
typ = "err",
rowGroup = {},
}
else
one_event.headers = one_event.headers or "typ;key;else-name;wkt"
one_event.tableStyle = one_event.tableStyle or ""
one_event.name = one_event.name or "_"
one_event.typ = one_event.typ or "nil"
end
if (type(tab_view) == "table") and (type(tab_view.typ) == "string") and (tab_view.typ == one_event.typ) then
table.insert( tab_view.test_group, { one_event.typ, one_event.key, one_event.name, one_event.wkt } )
elseif (type(tab_view) == "table") and (type(tab_view.typ) == "string") and (tab_view.typ == "v") then
table.insert( tab_view.test_group, { one_event.typ, one_event.key, one_event.name, one_event.wkt } )
else
tab_view = {}
table.insert( tab_view.test_group, { one_event.typ, one_event.key, one_event.name, one_event.wkt } )
end
end -- function events.selector( tab_view, one_event )
function events.all_kinds_test_test(t) -- Test: all kinds of events (err, wng, cat)
local memo = viewers.save_configs("events.all_categories_test") -- Save global configuration before eventual changes.
local t = t or "\n* <b>events.all_kinds_test()</b> Test: all kinds of events (err, wng, cat)"
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = nil, -- Use default cases.
title_memo = "events_all_kinds_tests_title", -- "events.all_kinds_test() Test: all kinds of events (err, wng, cat)",
headers = "events_all_kinds_tests_headers", -- "typ;key;idargs;result",
}
function tab_view.form_one_case(one_event) -- Convert a case from test_group to rowGroup.
return { one_event.typ, one_event.key, one_event.idargs, one_event.res }
end
t = t .. tableview.new(tab_view) -- Form a table view with lines and columns.
viewers.restore_configs(memo, "events.all_kinds_test_test") -- Restore global configurations after eventual changes.
return t --, errors -- langs_missing_translations_title
end -- function events.all_kinds_test_test(t)
events.errors_list = {} -- Deprecated: Table to collect errors and warnings
events.erron = true -- Activated or not errors. Errores activado o no. Erreurs activées ou non.
events.categories_list = {} -- Table to collect all categories to generate in wikitext
function events.errors_lister(title, v1, v2, v3, v4, v5, v6, v7, v8, v9)
local res, msgref = "", ""
local mwtitle = mw.title.getCurrentTitle()
local page = tostring(mwtitle.nsText) .. ":" .. tostring(mwtitle.text)
if type(title) ~= "string" then title = "modes_error_list_header_err" end
res = res .. '\n*' .. viewers.form9user(title, page, v1, v2, v3, v4, v5, v6, v7, v8, v9) -- .. ' - ' .. page
local n = 0
for k, wng in ipairs(events.errors_list) do
msgref = viewers.form9user(wng.ref, wng.v1, wng.v2, wng.v3, wng.v4, wng.v5, wng.v6, wng.v7, wng.v8, wng.v9) -- texte traduit ou direct
if wng.typ == "wng" then
res = res .. '<br>⦁ ' .. viewers.styles_color_warning(msgref)
end
end
for k, wng in ipairs(events.errors_list) do
msgref = viewers.form9user(wng.ref, wng.v1, wng.v2, wng.v3, wng.v4, wng.v5, wng.v6, wng.v7, wng.v8, wng.v9) -- texte traduit ou direct
if wng.typ == "err" then
res = res .. '<br>⦁ ' .. viewers.styles_color_error(msgref)
n = n + 1
end
end
if n > 0 then
events.add_cat("versions_module_with_error_err")
end
return res
end -- function events.errors_lister(title, v1, v2, v3, v4, v5, v6, v7, v8, v9)
function events.gener_categories() -- Only for this library, form categories without activate them
-- events.gener_categories Only display categories, as a text line, using function events.categories_lister
-- function events.formats(one_event, c) -- Format an event as an error, warning or category.
local gener = {}
modes.options_to_cat_view()
-- c can replace cat_view to enforce the documentation or the categorisation
c = c or modes.cat_view or ""
for k, one_event in pairs(events.all_events_group) do
one_event = events.formats(one_event, c) -- Format an event as an error, warning or category.
table.insert(gener, one_event ) -- Build a table with translations counts.
end
return gener
end -- function events.gener_categories(known_arguments)
function events.categories_lister(c) -- Categorize categories, or view categories if c=":".
local res = ""
modes.options_to_cat_view()
-- c can replace cat_view to enforce the documentation or the categorisation
c = c or modes.cat_view or ""
for k, one_event in pairs(events.all_events_group) do
if (one_event.typ == "cat") then
local keyuser = viewers.form9user(one_event.key)
local keycontent = viewers.form9content(one_event.key)
res = res .. events.formats_cat(one_event, keyuser, keycontent, c)
end
end
return res
end -- function events.categories_lister(c)
-- cut_libraries
Ligne 2 055 ⟶ 2 456 :
langs.i18n = {} -- Translations for Library:langs
langs.i18n.br = {
language = 'langue',
langs_translations_counts_title = "langs.translations_counts() Comptages des traductions en tables",
Ligne 2 103 ⟶ 2 502 :
} -- langs.i18n.br
langs.i18n.de = {
language = 'Sprache',
langs_translations_counts_title = "langs.translations_counts() Übersetzungen in Tabellen zählen",
Ligne 2 127 ⟶ 2 524 :
langs_main_i18n_languages_count = "Dieses Modul kann <b>%1</b> Sätze in <b>%2</b> Sprachen übersetzen.",
langs_table_can_translate_counts = "LaDie Tabelle <b>%1</b> kann <b>%2</b> Sätze in <b>%3</b> Sprachen übersetzen.",
langs_mw_language_fetchLanguageName = "<b>%1</b>(<b>%2</b>=<b>%3</b>), ",
langs_counts_translations_headers = "*; Name der Tabelle; Texte; Tabellen; Kommentar",
langs_i18n_list_all_string = "Diese Liste zeigt alle Texte, kann aber die ursprünglichen Aussagen nicht ersetzen.",
Ligne 2 151 ⟶ 2 548 :
} -- langs.i18n.de
langs.i18n.en = {
language = 'language',
langs_translations_counts_title = "langs.translations_counts() Counts of translations into tables",
Ligne 2 200 ⟶ 2 595 :
} -- langs.i18n.en
langs.i18n.es = { -- ¿Quién es?
language = 'lenguaje',
langs_translations_counts_title = "langs.translations_counts() Condes des traducciones en tablas",
Ligne 2 225 ⟶ 2 618 :
langs_main_i18n_languages_count = "Este módulo puede traducir <b>%1</b> frases en <b>%2</b> idiomas: ",
langs_table_can_translate_counts = "Tabla <b>%1</b> puede traducir <b>%2</b> frases en <b>%3</b> idiomas.",
langs_mw_language_fetchLanguageName = "<b>%1</b>( <b>%2</b> = <b>%3</b> ), ",
langs_counts_translations_headers = "*; Nombre de la tabla; Textos; Mesas; Comentario",
langs_languages_nbr_and_list = "\n* Hay <b>%1</b> mesas de traducciones en estas idiomas: <b>%2</b> <br>",
Ligne 2 250 ⟶ 2 643 :
} -- langs.i18n.es
langs.i18n.fr = {
language = 'langue',
langs_translations_counts_title = "langs.translations_counts() Comptages des traductions en tables",
Ligne 2 298 ⟶ 2 689 :
} -- langs.i18n.fr
langs.i18n.hu = {
language = 'nyelv',
langs_translations_counts_title = "langs.translations_counts() Fordítások a táblázatokba",
Ligne 2 347 ⟶ 2 736 :
} -- langs.i18n.hu
langs.i18n.vi = {
language = 'langue',
langs_translations_counts_title = "langs.translations_counts() Số bản dịch vào các bảng",
Ligne 2 504 ⟶ 2 891 :
headers_class = "wikitable alternative center sortable",
rowselect = selector,
rowGroup = {}, -- tests or tab_view.test_group or
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 2 523 ⟶ 2 909 :
local memo = viewers.save_configs("langs.translations_statistics_report") -- Save global configuration before eventual changes.
local t = t or "\n* <b>langs.translations_statistics_report(t)</b> Statistical report on translations by languages and libraries."
t = t .. "\n*
t = t .. "\n* <b>Normal result: Counts are similar in all languages.</b>"
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- modes.known_arguments = { -- p.known_arguments
local translate_i18n = versions.memo_i18n
local all_stats = {} -- all_stats + Total
local trans_count, case, i18n_group, total_stat, total_stats = 0
--
for libname, vers in pairs(package.loaded) do -- in reverse order bind_libra
total_stat = { ["libr"] = tostring(vers.libname), ["code"] = "en", ["content"] = 0, ["page"] = 0, ["user"] = 0, ["n_langs"] = 0, ["total"] = 0, }
Ligne 2 625 ⟶ 3 011 :
end -- function langs.key(key, lang)
function langs.
local main_i18n = versions.memo_i18n or {}
local xxx, strings_c, tables_c, strs_on_tabs, subnames = langs.i18n_sub_counts("versions.memo_i18n", "langs_main_i18n_languages_count", "user")
local tab_to_sort = {}
for lang, modname in pairs(main_i18n) do
table.insert(tab_to_sort, lang) -- build a table with only languages codes
end
table.sort(
return ( a < b )
end )
strs_on_tabs = math.floor(strs_on_tabs / tables_c)
local t = viewers.form9user("langs_main_i18n_languages_count", strs_on_tabs, tables_c)
for i, lang in pairs(
local langi18n = "langs.main_i18n." .. lang
local xxx, strings_c, tables_c, strs_on_tabs, subnames = langs.i18n_sub_counts(langi18n, "langs_main_i18n_languages_count", "user")
t = t .. "<b>" .. strings_c .. "</b>-"
local nativename = mw.language.fetchLanguageName(lang)
local englishname = mw.language.fetchLanguageName(lang, "en")
local englishname = mw.language.fetchLanguageName(lang, "en")
t = t .. viewers.form9user("langs_mw_language_fetchLanguageName", nativename, lang, englishname) -- "<b>%1</b>(%2=%3), "
if i > 12 then t = t .. "<b> ...</b>" ; break end
end -- see langs.select_lang
return t
end -- function langs.
langs.Central_version = "Central-s-fr" -- To adapt the version of Module:Centralizer in any translated text.
langs.default_user_lang = "en" -- To adapt the version of Module:Centralizer in any translated text.
-- waiting T68051 Central modules need the user language to display errors and category names
function langs.init_content_page_user_lang(content_lang, page_lang, user_lang)
-- Initialize or change the content, the page and the user languages and their translations tables.
--
-- See also https://meta.wikimedia.org/wiki/Translate_extension and [[Special:PageLanguage]] 2016-12-19
local main_i18n = versions.memo_i18n or langs.main_i18n or versions.main_i18n
local t = "" -- internal track
local lg = {}
Ligne 2 707 ⟶ 3 094 :
{ content_lang = "fr", user_lang = "es", sought = "tests", },
},
headers = "langs_selectLang_test_headers"
-- headers = "Wiki language; User language; Sought language; Selected language; Example",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 2 726 ⟶ 3 111 :
local memo = viewers.save_configs("langs.list_MediaWiki_languages") -- Save global configuration before eventual changes.
if type(t) ~= "string" then t = "\n* <b>langs.list_MediaWiki_languages()</b> List all known MediaWiki languages:" end
local interwikiMap = mw.site.interwikiMap("local") local lang = mw.language.new( langs.user_lang or "en" )
local LangCode = lang:getFallbackLanguages()
local lang_code_name = mw.language.fetchLanguageNames() -- inLanguage, 'mwfile' )
local toSort, t2 = {}, ""
local t = (t or "") .. "\n* Infos lang_code_name: " .. viewers.ta("#lang_code_name", lua_table.level_count(lang_code_name) )
for code, name in pairs(lang_code_name) do
table.insert(toSort, { code, name } )
-- insert detail { [1]=code, [2]=name } )
end
table.sort(toSort, function (row_x, row_y) return ( row_x[1] < row_x[1] ) end ) -- Sort based on [1]=code
table.sort(toSort, function (row_x, row_y) return ( row_x[2] < row_x[2] ) end ) -- Sort based on [2]=name
t = t .. "\n* List of <b>known</b> languages of MediaWiki lang_code_name: <br/>" .. t2
Ligne 2 852 ⟶ 3 240 :
kind = "projects", -- MediaWiki or projects
typ = "err",
rowGroup = {}, -- tests or tab_view.test_group or
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 2 964 ⟶ 3 351 :
kind = "projects", -- MediaWiki or projects
typ = "err",
rowGroup = {}, -- tests or tab_view.test_group or
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 3 050 ⟶ 3 436 :
headers = " lang; isTag; isLang; isBuilt; langname; native ", --
rowGroup = {},
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 3 061 ⟶ 3 446 :
-- local isLang = mw.language.isSupportedLanguage(lang)
local isBuilt = mw.language.isValidBuiltInCode(lang)
local space_name = tostring(mw.site.namespaces.Module.name)
return { lang, isTag, tostring(isLang), isBuilt, langname, native, space_name, }
end
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
Ligne 3 083 ⟶ 3 469 :
lua_table.i18n = {} -- Translations for lua_table library
lua_table.i18n.br = {
luaTable_recursive_luaTable_title = "MediaWiki lua_table récursive",
luaTable_rough_view_tests_title = "lua_table.rough_view() Test: Former un code Lua grossier d'une table",
Ligne 3 101 ⟶ 3 485 :
luaTable_table_dont_exists_err = "La table <b>%1</b> n'existe pas.",
luaTable_table_args_source_title = "lua_table.structure() Table des arguments reçus, args_source :",
luaTable_tables_differences_title = "
} -- lua_table.i18n.br
lua_table.i18n.de = {
luaTable_recursive_luaTable_title = "MediaWiki lua_table rekursive",
luaTable_rough_view_tests_title = "lua_table.rough_view() Test: Bilden Sie einen groben Lua-Code aus einer Tabelle",
Ligne 3 122 ⟶ 3 504 :
luaTable_table_dont_exists_err = "Tabelle <b>%1</b> existiert nicht.",
luaTable_table_args_source_title = "lua_table.structure() Tabelle der Argumente erhaltenTabelle der Argumente erhalten, args_source:",
luaTable_tables_differences_title = "
} -- lua_table.i18n.de
lua_table.i18n.en = {
luaTable_recursive_luaTable_title = "MediaWiki recursive lua_table",
luaTable_rough_view_tests_title = "lua_table.rough_view() Test: Formats a rough Lua code of a table",
Ligne 3 146 ⟶ 3 526 :
} -- lua_table.i18n.en
lua_table.i18n.es = {
luaTable_recursive_luaTable_title = "MediaWiki lua_table recursiva",
luaTable_rough_view_tests_title = "lua_table.rough_view() Prueba: Formar un código de Lua grueso de una tabla",
Ligne 3 164 ⟶ 3 542 :
luaTable_table_dont_exists_err = "La tabla <b>%1</b> no existe.",
luaTable_table_args_source_title = "lua_table.structure() Tabla de argumentos recibido, args_source:",
luaTable_tables_differences_title = "
} -- lua_table.i18n.es
lua_table.i18n.fr = {
luaTable_recursive_luaTable_title = "MediaWiki lua_table récursive",
luaTable_rough_view_tests_title = "lua_table.rough_view() Test: Former un code Lua grossier d'une table",
Ligne 3 188 ⟶ 3 564 :
} -- lua_table.i18n.fr
lua_table.i18n.hu = {
luaTable_recursive_luaTable_title = "MediaWiki lua_table rekurzív",
luaTable_rough_view_tests_title = "lua_table.rough_view() Teszt: Formázz egy durva Lua kódot egy asztaltól",
Ligne 3 205 ⟶ 3 579 :
luaTable_table_dont_exists_err = "A <b>%1</b> táblázat nem létezik.",
luaTable_table_args_source_title = "lua_table.structure() A kapott érvek táblázata, args_source :",
luaTable_tables_differences_title = "
} -- lua_table.i18n.hu
lua_table.i18n.vi = {
luaTable_recursive_luaTable_title = "MediaWiki lua_table đệ quy",
luaTable_rough_view_tests_title = "lua_table.rough_view() Kiểm tra: Tạo thành một mã Lua thô từ một bảng",
Ligne 3 225 ⟶ 3 597 :
luaTable_table_dont_exists_err = "Bảng <b>%1</b> không tồn tại.",
luaTable_table_args_source_title = "lua_table.structure() Bảng đối số nhận được, args_source:",
luaTable_tables_differences_title = "
} -- lua_table.i18n.vi
Ligne 3 405 ⟶ 3 777 :
return tabN_to_list1(tab, 1, ...)
end -- function lua_table.to_list(tab, ...)
--[[ viewers.value(
ftd = ftd .. "lua_table.count_all;lua_table.count_tests;lua_table.count_types;lua_table.count_values;"
ftd = ftd .. "lua_table.from_subnames_object;lua_table.from_subnames_table;lua_table.level_count;lua_table.level_get;"
ftd = ftd .. "lua_table.level_list;lua_table.named_sub_counts;lua_table.obj_from_subnames;lua_table.sort_onkey;"
ftd = ftd .. "lua_table.sort_types;lua_table.structure;lua_table.structure_recursive_report;lua_table.tab_from_subnames;"
ftd = ftd .. "lua_table.to_list;lua_table.to_list_tests;lua_table.to_table;lua_table.to_table_test;"
function viewers.value(value, form) -- Formats a string to discribe a value like: true, 123.456, "abcd", func(), table{}.
local typ, view = type(value), "-" -- options: ' nonil noquote '
if typ == "boolean" then
if value == true then view = "true" else view = "false" end
elseif typ == "function" then view = "func()"
elseif typ == "number" then view = tostring(value)
elseif typ == "string" then
if viewers.is_in('noquote', form) then view = value
else view = '"' .. value .. '"' end
elseif typ == "table" then view = "table{}"
elseif typ == "nil" then view = "nil"
if viewers.is_in('nonil', form) then view = "" end
end
return view
end -- function viewers.value(value, form)
{| class="wikitable alternative center" |
! scope="col" | Cas testé ! scope="col" | Table à lister, vue brute ! scope="col" | Liste de sortie |- | Simple table | { [1] = 123, [2] = abc, [3] = 456, [4] = def, } | [1] = 123 , [2] = abc , [3] = 456 , [4] = def , |- | Text and number | { [1] = one, [2] = 111, } | [1] = one , [2] = 111 , |- | Function and Logic | { [1] = function, [2] = true, [3] = false,
["1"] = function() }
| [1] = function , [2] = true , [3] = false , |- | 10 values in the table | { [1] = a, [2] = b, [3] = c, [4] = d, [5] = e, [6] = f, [7] = g, [8] = h, [9] = i9, [10] = j10, } | [1] = a , [2] = b , [3] = c , [4] = d , [5] = e , [6] = f , [7] = g , [8] = h , [9] = i9 , [10] = j10 ,
|}
-- function viewers.ta(
function viewers.ta(txt, val, sep) -- Formats an argument and its value in a documentation. The text is "nil" if the value is nil.
if val == nil then val = "nil" end
if sep == nil then sep = "=" end
return tostring(txt) .. " " .. tostring(sep) .. " <b>" .. tostring(val) .. "</b> " .. ", "
end
--]]
function lua_table.to_list_tests(t) -- Return a list from a Lua table.
Ligne 3 411 ⟶ 3 819 :
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = {
{ "
},
title_memo = "luaTable_toList_tests_title", -- "lua_table.to_list() Return a list from a Lua table.",
headers = "luaTable_toList_tests_headers", -- "Tested case; Input table, rough_view; Output list",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 3 439 ⟶ 3 841 :
return t --, errors -- langs_missing_translations_title
end -- function lua_table.to_list_tests(t)
function lua_table.toList(tab, ...) -- Return a list from any Lua table.
-- This function is the reverse of func( ... )
if (type(tab) ~= "table") then tab = {} end
local tab = mw.clone(tab) -- to not disturb original table
local maxn = lua_table.count_all(tab)
local function tabN_to_list1(tab, n, ...)
local max_tab = lua_table.count_all(tab)
local listab = {...}
local max_list = lua_table.count_all(listab)
local tab_last = tab[n] -- last element, even a table to not delete below
local tab_last_string = type(tab_last) -- tostring(tab_last)
if (type(tab_last) ~= "nil") and (n <= max_tab) then
if (type(tab) == "table") then
return tab_last, tabN_to_list1(tab, n + 1, ...)
else
tab_last = tostring(tab_last)
end
else return end
end
return tabN_to_list1(tab, 1, ...)
end -- function lua_table.toList(tab, ...)
function lua_table.toList_tests(t) -- Return a list from a LUA table.
local memo = events.save_configs() -- Save global configuration before eventual changes.
local t = t or "\n* <b>events.all_kinds_test()</b> Test: all kinds of events (err, wng, cat)"
local tabView = {
testGroup = {
{ "Simple table", { 123, "abc", key = "txt" }, },
{ "All types transmited", { "name", 111, true, false, { 789, "xyz"}, function()end }, },
{ "10 values in the table", { "a", "b", "c", "d", "e", "f", "g", "h", "i9", "j10" }, },
{ "Any number of values", {
"a", "b", "c", "d", "e", "f", "g", "h", "i09", "j10",
"a", "b", "c", "d", "e", "f", "g", "h", "i19", "j20",
"a", "b", "c", "d", "e", "f", "g", "h", "i29", "j30",
"a", "b", "c", "d", "e", "f", "g", "h", "i39", "j40",
"a", "b", "c", "d", "e", "f", "g", "h", "i49", "j50",
"a", "b", "c", "d", "e", "f", "g", "h", "i59", "j60" }, },
},
title_memo = "luaTable_toList_tests_title", -- "lua_table.toList() Return a list from a Lua table.",
headers = "luaTable_toList_tests_headers", -- "Tested case; Input table, roughView; Output list",
}
function tabView.form_one_case(case) -- Convert a case from testGroup to rowGroup.
local descript = case[1]
local tabview = lua_table.roughView( case[2] )
local tab_list = { lua_table.toList( case[2] ) }
local t1 = ""
for i, elem in ipairs(tab_list) do
t1 = t1 .. viewer.ta( "[" .. i .. "]", tostring(elem) )
end
return { descript, tabview, t1, }
end
local t = tableview.form(tabView) -- Form a table view with lines and columns.
events.restore_configs(memo) -- Restore global configurations after eventual changes.
return t --, errors -- langs_missing_translations_title
end -- function lua_table.toList_tests(t)
function lua_table.to_table(stringList, pattern, plain) -- convert a string to a table of words
Ligne 3 468 ⟶ 3 927 :
headers = "langs_selectLang_test_headers", -- "stringList; pattern; plain; result"
headers = "stringList; pattern; plain; result",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 3 686 ⟶ 4 143 :
headers = "luaTables_count_all_types_values_headers", -- "Tested case; Input table, rough_view; Output list",
headers = "Tested table; Function to count; Kind of count; Resulting counts",
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup RIC05900470
Ligne 3 989 ⟶ 4 444 :
mathroman.i18n = {} -- Translations for mathroman library
mathroman.i18n.br = {
mathroman_errors_head_err = "Erreur : ",
mathroman_roman_err = "Erreur de romain : ",
Ligne 4 004 ⟶ 4 457 :
mathroman_roman2int_tests_headers = "Nombre romain; Valeur décimale; Correct; Erreur(s)",
mathroman_int2roman_test_title = "mathroman.int2roman() Test des nombres décimaux en nombres romains",
mathroman_int2roman_tests_headers = "Nombre
mathroman_int_is_not_integer_err = "Le nombre non entier <b>%1</b> n'est pas convertible en nombre romain",
mathroman_int_is_not_number_err = "La valeur <b>%1</b> n'est pas un nombre convertible en nombre romain",
Ligne 4 010 ⟶ 4 463 :
} -- mathroman.i18n.br
mathroman.i18n.de = {
mathroman_errors_head_err = "Fehler: ",
mathroman_roman_err = "Römischer Fehler: ",
Ligne 4 025 ⟶ 4 476 :
mathroman_roman2int_tests_headers = "Römische Nummer; Dezimalwert; Richtig; Error (s)",
mathroman_int2roman_test_title = "mathroman.int2roman() Test von Dezimalzahlen in römischen Zahlen",
mathroman_int2roman_tests_headers = "
mathroman_int_is_not_integer_err = "Das nicht ganzzahlige <b>%1</b> ist nicht in römische Zahl umwandelbar",
mathroman_int_is_not_number_err = "Der Wert <b>%1</b> ist keine Zahl, die in eine römische Zahl umgewandelt werden kann",
Ligne 4 031 ⟶ 4 482 :
} -- mathroman.i18n.de
mathroman.i18n.en = {
mathroman_errors_head_err = "Error: ",
mathroman_roman_err = "Roman error: ",
Ligne 4 046 ⟶ 4 495 :
mathroman_roman2int_tests_headers = "Roman number; Digital value; Correct; Error(s)",
mathroman_int2roman_test_title = "mathroman.int2roman() Test digital numbers to roman numbers",
mathroman_int2roman_tests_headers = "
mathroman_int_is_not_integer_err = "The not integer number <b>%1</b> is not convertible to Roman numeral",
mathroman_int_is_not_number_err = "The value <b>%1</b> is not a convertible number to Roman numeral",
Ligne 4 052 ⟶ 4 501 :
} -- mathroman.i18n.en
mathroman.i18n.es = {
mathroman_errors_head_err = "Error: ",
mathroman_roman_err = "Error de romano: ",
Ligne 4 067 ⟶ 4 514 :
mathroman_roman2int_tests_headers = "Número romano; Valor digital; Corregido; Error(s)",
mathroman_int2roman_test_title = "mathroman.int2roman() Prueba de números decimales a números romanos",
mathroman_int2roman_tests_headers = "Número
mathroman_int_is_not_integer_err = "El no entero <b>%1</b> no se puede convertir en número romano",
mathroman_int_is_not_number_err = "El valor <b>%1</b> no es un número y no se puede convertir en número romano",
Ligne 4 073 ⟶ 4 520 :
} -- mathroman.i18n.es
mathroman.i18n.fr = {
mathroman_errors_head_err = "Erreur : ",
mathroman_roman_err = "Erreur de romain : ",
Ligne 4 088 ⟶ 4 533 :
mathroman_roman2int_tests_headers = "Nombre romain; Valeur décimale; Correct; Erreur(s)",
mathroman_int2roman_test_title = "mathroman.int2roman() Test des nombres décimaux en nombres romains",
mathroman_int2roman_tests_headers = "Nombre
mathroman_int_is_not_integer_err = "Le nombre non entier <b>%1</b> n'est pas convertible en nombre romain",
mathroman_int_is_not_number_err = "La valeur <b>%1</b> n'est pas un nombre convertible en nombre romain",
Ligne 4 094 ⟶ 4 539 :
} -- mathroman.i18n.fr
mathroman.i18n.hu = {
mathroman_errors_head_err = "Hiba: ",
mathroman_roman_err = "Római hiba: ",
Ligne 4 109 ⟶ 4 552 :
mathroman_roman2int_tests_headers = "Római szám; Decimális érték; helyes; Hiba (k)",
mathroman_int2roman_test_title = "mathroman.int2roman() A decimális számok vizsgálata római számokban",
mathroman_int2roman_tests_headers = "
mathroman_int_is_not_integer_err = "A nem egész <b>%1</b> nem konvertálható a római számra",
mathroman_int_is_not_number_err = "A <b>%1</b> érték nem egy szám, amely átváltható egy római számra",
Ligne 4 115 ⟶ 4 558 :
} -- mathroman.i18n.hu
mathroman.i18n.vi = {
mathroman_errors_head_err = "Lỗi: ",
mathroman_roman_err = "Lỗi roman: ",
Ligne 4 130 ⟶ 4 571 :
mathroman_roman2int_tests_headers = "Số La Mã; Giá trị thập phân; chính xác; Lỗi",
mathroman_int2roman_test_title = "mathroman.int2roman() Kiểm tra các số thập phân trong số La Mã",
mathroman_int2roman_tests_headers = "Số
mathroman_int_is_not_integer_err = "Số nguyên <b>%1</b> không thể chuyển đổi thành số La Mã",
mathroman_int_is_not_number_err = "Giá trị <b>%1</b> không phải là số có thể chuyển đổi thành số La Mã",
Ligne 4 140 ⟶ 4 581 :
-- Romans view : XIJ=12 MCXI=1111 MCDXLIV=1444 MDCLXVI=1666 MCMXCIX=1999 MMCCXXII=2222 MMMMCMXCIX=4999 ERREURS=0 erreur caractere S en 7. XIA=11 erreur caractere A en 3. XJI=12 erreur caractere J avant la fin. IXC=89 erreur caracteres croissants. VLD=445 erreur caracteres croissants. MMMMM=5000 erreur > 4999. MMMMMYJXC=5089 erreur > 4999. erreur caractere Y en 6. erreur caractere J avant la fin.
function mathroman.roman2int(rm) -- Convert a roman number to integer -- S170606rmn
-- { ["name"] = "mathroman.roman2int (4)', ["args"] = { "VI", }, ["expect"] = { 123 } }, -- example of test case
local v = 0 -- valeur totale
local v1 = 0 -- valeur de derniere lettre
local v2 = 0 -- valeur de lettre precedente
local v3 = 0 -- valeur de lettre precedente
local x = '-' -- caractere en cours d'evaluation
local i = 1 -- numero du caractere en cours d'evaluation
local j = 0 -- numero du caractere de reference courant (debut en Lua)
local k = 0 -- numero du caractere de reference courant (fin en Lua)
local errs, errtab = "", {}
if type(rm) ~= "string" then
table.insert(errtab, tostring(events.add_err("mathroman_is_not_string_err", tostring(rm) ) ) )
return 0, errs
end
if rm == "" then
errs = errs .. events.add_err("mathroman_is_not_string_err", '""')
table.insert(errtab, tostring(events.add_err("mathroman_is_not_string_err", '""') ) )
return 0, errs
end
if type(rm) ~= "string" then rm = "-" end
local lst = '-MDCLXVIJ' -- caracteres autorises
x = string.sub(rm, i, i) or ''
while (x ~= '') do
v3 = v2
v2 = v1
v1 = 0
if ( x == 'M' ) then v1 = 1000 end
if ( x == 'D' ) then v1 = 500 end
if ( x == 'C' ) then v1 = 100 end
if ( x == 'L' ) then v1 = 50 end
if ( x == 'X' ) then v1 = 10 end
if ( x == 'V' ) then v1 = 5 end
if ( x == 'I' ) then v1 = 1 end
if ( x == 'J' ) then v1 = 1 end
if ( x == 'J' ) and ( i < string.len(rm) ) then
errs = errs .. events.add_err("mathroman_J_before_end_err") -- e4 = 'character J before the end'
table.insert(errtab, tostring(events.add_err("mathroman_J_before_end_err") ) ) -- e4 = 'character J before the end'
end
if ( v1 == 0 ) then
errs = errs .. events.add_err("mathroman_char_X_in_N_err", x, i) -- e3 = "character K in 3"
table.insert(errtab, tostring(events.add_err("mathroman_char_X_in_N_err", x, i) ) )
end
v = v + v1
if ( (v1 == 5*v2) or (v1 == 10*v2) ) then v = v - (2*v2) end -- adjust 4, 9, 40, 90 ...
j, k = string.find(lst, x)
if ( j == nil ) then j = -1 end
if ( k == nil ) then k = -1 end
if (v1 > v2) and (v2 > v3) and (v3 > 0) then
errs = errs .. events.add_err("mathroman_char_increase_err") -- e2 = ' increasing chars.'
table.insert(errtab, tostring(events.add_err("mathroman_char_increase_err") ) )
end
i = i + 1
x = string.sub(rm, i, i) or ''
end
if ( v < 1 ) then -- e0 = ' valeur nulle.'
errs = errs .. events.add_err("mathroman_null_value_err")
table.insert(errtab, tostring(events.add_err("mathroman_null_value_err") ) )
end
if ( v > 4999 ) then -- e1 = ' valeur > 4999.'
errs = errs .. events.add_err("mathroman_greater_4999_err")
table.insert(errtab, tostring(events.add_err("mathroman_greater_4999_err") ) )
end
errs = table.concat(errtab, " ; ")
return v, errs -- with or without errors
end -- function mathroman.roman2int(rm)
function mathroman.romani2r(i, j)
Ligne 4 171 ⟶ 4 664 :
end -- function mathroman.romani2r(i, j)
function mathroman.int2roman(int) -- Convert an integer to a roman number, also if int is a string
-- { ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { int = 444 }, ["expect"] = { "CDXLIV" } }, -- example of test case
local errs = "" -- local collection of errors -- S170606rmn
Ligne 4 244 ⟶ 4 737 :
end
end
return
end --
function mathroman.roman2int_tests(t) -- Tests of main central modules -- S170606rmn
local memo = viewers.save_configs("mathroman.roman2int_tests") -- Save global configuration before eventual changes.
local t = t or "\n* " .. viewers.form9user("mathroman_roman2int_tests_title")
local tab_view = { -- Group datas and options for a table view with lines and columns.
tests_title = "mathroman_roman2int_tests_title", -- "mathroman.roman2int() Test roman to digital numbers"
{ "MMMMMYJXC", }, { {x}, }, { function()end, },
},
headers = "mathroman_roman2int_tests_headers", -- "Roman number; Digital value; Correct; Error(s)"
rowGroup = {},
}
tab_view.t = (tab_view.t or "") .. viewers.ta("roman2int_tests: ", "start")
tab_view.t = tab_view.t .. viewers.ta("#test_group: ", lua_table.level_count(tab_view.test_group) )
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
local word = case[1] -- DEBUG : mathroman.roman2int() can fail without blocking page.
local valX, errs = mathroman.roman2int(word) -- DEBUG : mathroman.roman2int() can fail without blocking page.
local wordX, errsX = mathroman.int2roman(valX) -- DEBUG : mathroman.roman2int() can fail without blocking page.
return { word, valX, wordX, errs .. " " .. errsX, }
end
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
viewers.restore_configs(memo, "mathroman.roman2int_tests") -- Restore global configurations after eventual changes.
return t
end -- function mathroman.roman2int_tests(t)
function mathroman.int2roman_test(t) -- Unitary tests of mathroman.int2roman
local memo = viewers.save_configs("mathroman.int2roman_test") -- Save global configuration before eventual changes.
local t = t or "\n*
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group =
{ 0, }, { 12, }, { 17, }, { "18", }, { "19", },
{ 111, }, { 444, }, { 555, },
{ "777", }, { "1111", },{ "4999", }, { "5000", },
},
headers = "mathroman_int2roman_tests_headers", -- "
rowGroup = {},
}
tab_view.t = (tab_view.t or "") .. viewers.ta("int2roman_tests: ", "start")
tab_view.t = tab_view.t .. viewers.ta("#test_group: ", lua_table.level_count(tab_view.test_group) )
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
local val = case[1] -- DEBUG : mathroman.roman2int() can fail without blocking page.
local wordX, errs = mathroman.int2roman(val, " ") -- DEBUG : mathroman.int2roman() can fail without blocking page.
local valX, errsX = mathroman.roman2int(wordX) -- DEBUG : mathroman.roman2int() can fail without blocking page.
return { val, wordX, valX, errs .. " " .. errsX, }
end
t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
viewers.restore_configs(memo, "mathroman.int2roman_test") -- Restore global configurations after eventual changes.
return t
end -- function mathroman.int2roman_test(t)
-- vueRomains : XIJ=12 MCXI=1111 MCDXLIV=1444 MDCLXVI=1666 MCMXCIX=1999 MMCCXXII=2222 MMMMCMXCIX=4999 ERREURS=0 erreur caractere S en 7. XIA=11 erreur caractere A en 3. XJI=12 erreur caractere J avant la fin. IXC=89 erreur caracteres croissants. VLD=445 erreur caracteres croissants. MMMMM=5000 erreur > 4999. MMMMMYJXC=5089 erreur > 4999. erreur caractere Y en 6. erreur caractere J avant la fin.
-- { ["
-- { ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { 1 }, ["expect"] = { "I" } },
mathroman.TestsCasesGroup = { -- Autotest cases to validate the mathroman library at MediaWiki level.
-- each test_case defines a name, a function, an input, an output. See also viewers.strTestCase. 8 cases
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "XXII" }, ["expect"] = { 22 }, },
}
mathroman.Tests_cases = { -- Autotest cases to validate the mathroman library at MediaWiki level.
-- each test_case defines a name, a function, an input, an output. See also viewers.strTestCase. 5 cases
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { 12, }, ["expect"] = { "XII" }, },
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "VIA", }, ["expect"] = { 6, "character AAA in 3" }, },
}
mathroman.int2romanTests = { -- Autotest cases to validate the mathroman library at MediaWiki level.
-- each test_case defines a name, a function, an input, an output. See also viewers.strTestCase. 8 - 1 = 7 + 8 = 15 cases
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { "19" }, ["expect"] = { "XII" } },
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { 4999 }, ["expect"] = { "MMMMCMXCIX" } },
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { 5000 }, ["expect"] = { "0", "value > 4999" } },
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { -10 }, ["expect"] = { "X", "null value" } },
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.int2roman", ["args"] = { 0 }, ["expect"] = { "0", "null value" } },
}
mathroman.roman2intTests = { -- Autotest cases to validate the mathroman library at MediaWiki level.
-- each test_case defines a name, a function, an input, an output. See also viewers.strTestCase. 6 cases
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "-X" }, ["expect"] = { 10, "mathroman_char_X_in_N_err---1-" } },
{ ["
{ ["
--[
{ ["
{ ["
{ ["
{ ["
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "XJI" }, ["expect"] = { 12, "mathroman_char_increase_err" } },
{ ["
{ ["
{ ["
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "MMMMM" }, ["expect"] = { 5000, "mathroman_J_before_end_err-XJI" } },
--]]
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "MMMMMYJXC" }, ["expect"] = { 5089, ";mathroman_J_before_end_err;mathroman_char_increase_err;mathroman_char_X_in_N_err-Y-6;mathroman_greater_4999_err;" } },
}
mathroman.testsRecursive = { -- Autotest cases to validate the mathroman library at MediaWiki level.
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "XXIJ" }, ["expect"] = { 22 } },
-- { ["errorsKey"] = 2, ["modulename"] = "mathroman", funcname = 'recurse', group = mathroman.testsRecursive, },
{ ["errorsKey"] = 2, ["modulename"] = "mathroman", ["funcname"] = "mathroman.roman2int", ["args"] = { "MCXI" }, ["expect"] = { 1111 } },
-- { ["errorsKey"] = 2, ["modulename"] = "mathroman", funcname = 'recurse', group = mathroman.testsRecursive, },
}
local func_example = { ["funcname"] = "mathroman.roman2int", ["args"] = { "MCXI" }, ["expect"] = { 1111 }, ["errorsKey"] = 2, }
local group_example = { ["name"] = "mathroman.roman2int.5", ["modulename"] = "mathroman", ["groupname"] = "mathroman.testsRecur", }
mathroman.tests_groups = { -- Autotest cases to validate the mathroman library at MediaWiki level.
-- Each test_case defines a name, a function, an input, an output.
{ ["name"] = "mathroman", ["modulename"] = "mathroman", ["funcname"] = "runGroups", ["groupname"] = "mathroman.Tests_cases", }, --
{ ["name"] = "mathroman", ["modulename"] = "mathroman", ["funcname"] = "runGroups", ["groupname"] = "mathroman.int2romanTests", }, --
{ ["name"] = "mathroman", ["modulename"] = "mathroman", ["funcname"] = "runGroups", ["groupname"] = "mathroman.roman2intTests", }, --
-- modulename = "mathroman", ["funcname"] = "runGroups", ["groupname"] = "mathroman.testsRecursive", },
}
-- cut_libraries
Ligne 4 431 ⟶ 4 872 :
modes.i18n = {} -- Translations for modes library
modes.i18n.br = {
-- Noms et descriptions des arguments de configurations
[1] = "1",
Ligne 4 439 ⟶ 4 878 :
[4] = "4",
["modules_guide"] = "Argument modules_guide",
-- Languages
--
itemid_descr = "Identifiant des données de Wikidata, comme <code>Q535</code> pour Victor Hugo.",
itemid2_descr = "Autre identifiant des données de Wikidata, comme <code>Q535</code> pour Victor Hugo.",
category = 'Catégorie',
mode_descr = "Type d'utilisation du module ou du modèle : lire, éditer, documenter, tester.",
options_descr = "Options d'affichage d'un module ou d'un modèle.",
c_descr = "Options d'affichage d'un module ou d'un modèle.",
knownversions_descr = "Versions connues, pour les gérer.",
soughtversions_descr = "Versions demandées, pour les gérer.",
modes_form_ok_categ_tests = "Test de génération de catégorie OK",
-- Principaux textes, erreurs et catégories des outils
-- Messages et erreurs divers
modes_used_options_list_title = "modes.used_options_list() Utilisation des options :",
Ligne 4 518 ⟶ 4 949 :
--
modes_delete_docbox_wng = "Vous devez suprimer cette documentation avant d'enregistrer.<br>Supprimez tous les modes pour revenir en mode read.",
--
modes_assist_user_param_err = "Support aux utilisateurs pour vérifier les paramètres :",
Ligne 4 531 ⟶ 4 962 :
modes_levenshtein_similar_tests_title = "modes.levenshtein() Test des distances de <b>[https://fr.wikipedia.org/wiki/Distance_de_Levenshtein Levenshtein]</b> entre mots:",
modes_known_arguments_structure_title = "modes.known_arguments_structure() Définitions des arguments",
modes_args_unknown_report_title = "
modes_normal_box_main_text_1 = "Boîte d'information simple : titre de cette page <b>%1</b>, description : <b>%2</b>",
modes_normal_box_main_text_2 = "<br/>Il était <b>%1</b>, se nommait <b>%2</b> <b>%3</b>, il est mort en <b>%4</b>.",
Ligne 4 545 ⟶ 4 976 :
modes_recursive_normal_tests_title = "modes.recursive_normal() Test: Normalise le niveau récursif et la limite récursive",
modes_namespaces_page_list_title = "modes.namespaces_page_list() Module, namespaces, et noms de pages :",
modes_known_arguments_report_title
modes_known_arguments_report_headers
modes_get_args_report_title = "modes.
} -- modes.i18n.br
modes.i18n.de = {
-- Namen und Beschreibungen von Konfigurationsargumenten
[1] = "1",
Ligne 4 559 ⟶ 4 988 :
[4] = "4",
["modules_guide"] = "Argument modules_guide",
-- Sprachen
--
modes_form_ok_categ_tests = "Testkategoriegenerierung OK",
--
Ligne 4 633 ⟶ 5 062 :
modes_unknown_auto_arg_err = "Interner fehler: Automatisches unbekanntes Argument: <b>%1</b> = <b>%2</b>.",
modes_delete_docbox_wng = "Sie müssen diese Dokumentation vor dem Brennen entfernen.<br>Entfernen Sie alle Modi, um in den Lesemodus zurückzukehren.",
--
modes_assist_user_param_err = "Benutzerunterstützung zur Überprüfung der Konfiguration:",
Ligne 4 644 ⟶ 5 073 :
modes_levenshtein_similar_tests_title= "modes.levenshtein() Beweis der Entfernungen <b>[https://es.wikipedia.org/wiki/Distancia_de_Levenshtein Levenshtein]</b> zwischen den Wörtern:",
modes_known_arguments_structure_title = "modes.known_arguments_structure() Definitionen von Argumenten",
modes_args_unknown_report_title = "
modes_normal_box_main_text_1 = "Einfaches Informationsfeld: Titel der Seite: <b>%1</b>, Beschreibung: <b>%2</b>",
modes_normal_box_main_text_2 = "<br/>Er war ein <b>%1</b>, heißt <b>%2</b> <b>%3</b> war in gestorben <b>%4</b>.",
Ligne 4 658 ⟶ 5 087 :
modes_recursive_normal_tests_title = "modes.recursive_normal() Test: Normalisieren Sie die rekursive Ebene und die rekursive Grenze",
modes_namespaces_page_list_title = "modes.namespaces_page_list() Module, Namespaces und Seitennamen:",
modes_known_arguments_report_title
modes_known_arguments_report_headers
modes_get_args_report_title = "modes.
} -- modes.i18n.de
modes.i18n.en = { -- 182 <tab>mode_...
-- From here, TRANSLATE ONLY descriptions with a key like label_descr
-- To translate, always keep
Ligne 4 674 ⟶ 5 101 :
[4] = "4",
["modules_guide"] = "Argument modules_guide",
-- Languages
--
modes_used_options_list_title = "modes.used_options_list() Use of options:",
modes_options_uses_tests_title = "modes.options_from_mode_tests() Options uses and short test",
Ligne 4 752 ⟶ 5 171 :
--
modes_unknown_auto_arg_err = "Internal Error: Unknown automatic argument: <b>%1</b> = <b>%2</b>.",
modes_delete_docbox_wng = "You must remove this documentation before recording.<br>Remove all modes to return to read
--
--
modes_assist_user_param_err = "User support for checking the settings:",
Ligne 4 767 ⟶ 5 186 :
modes_levenshtein_similar_tests_title= "modes.levenshtein() Test the distances between words <b>[https://en.wikipedia.org/wiki/Levenshtein_distance Levenshtein]</b>:",
modes_known_arguments_structure_title = "modes.known_arguments_structure() Arguments definitions",
modes_args_unknown_report_title = "
modes_normal_box_main_text_1 = "Simple infobox: page title: <b>%1</b>, description: <b>%2</b>",
modes_normal_box_main_text_2 = "<br/>He was <b>%1</b>, named <b>%2</b> <b>%3</b> was dead in <b>%4</b>.",
Ligne 4 782 ⟶ 5 201 :
modes_recursive_normal_tests_title = "modes.recursive_normal() Test: Normalize the recursive level and the recursive limit",
modes_namespaces_page_list_title = "modes.namespaces_page_list() Module, namespaces, and page names:",
modes_known_arguments_report_title
modes_known_arguments_report_headers
modes_get_args_report_title = "modes.
} -- modes.i18n.en
modes.i18n.es = {
-- Nombres y descripciones de argumentos de configuraciones
[1] = "1",
Ligne 4 796 ⟶ 5 213 :
[4] = "4",
["modules_guide"] = "Argument modules_guide",
-- Languages
--
modes_form_ok_categ_tests = "Prueba generación categoría en OK",
--
Ligne 4 876 ⟶ 5 285 :
modes_unknown_auto_arg_err = "Error interno: Argumento desconocido automático: <b>%1</b> = <b>%2</b>.",
modes_delete_docbox_wng = "Debe quitar esta documentación antes de grabar.<br>Retire todos los modos para volver al modo read.",
--
modes_assist_user_param_err = "Apoyo al usuario para comprobar la configuración:",
Ligne 4 889 ⟶ 5 298 :
modes_levenshtein_similar_tests_title= "modes.levenshtein() Prueba de las distancias <b>[https://es.wikipedia.org/wiki/Distancia_de_Levenshtein Levenshtein]</b> entre las palabras:",
modes_known_arguments_structure_title = "modes.known_arguments_structure() Definiciones de argumentos",
modes_args_unknown_report_title = "
modes_normal_box_main_text_1 = "Simple caja de información: Título de la página: <b>%1</b>, descripción: <b>%2</b>",
modes_normal_box_main_text_2 = "<br/>Él era un <b>%1</b>, es nombrado <b>%2</b> <b>%3</b> había muerto en <b>%4</b>.",
Ligne 4 903 ⟶ 5 312 :
modes_recursive_normal_tests_title = "modes.recursive_normal() Prueba: Normalizar el nivel recursivo y el límite recursiva",
modes_namespaces_page_list_title = "modes.namespaces_page_list() Módulo, namespaces, y nombres de páginas:",
modes_known_arguments_report_title
modes_known_arguments_report_headers
modes_get_args_report_title = "modes.
} -- modes.i18n.es
modes.i18n.fr = {
-- Noms et descriptions des arguments de configurations
[1] = "1",
Ligne 4 917 ⟶ 5 324 :
[4] = "4",
["modules_guide"] = "Argument modules_guide",
-- Languages
--
modes_form_ok_categ_tests = "Test de génération de catégorie OK",
-- Principaux textes, erreurs et catégories des outils
Ligne 4 997 ⟶ 5 396 :
--
modes_delete_docbox_wng = "Vous devez suprimer cette documentation avant d'enregistrer.<br>Supprimez tous les modes pour revenir en mode read.",
--
modes_assist_user_param_err = "Support aux utilisateurs pour vérifier les paramètres :",
Ligne 5 010 ⟶ 5 409 :
modes_levenshtein_similar_tests_title = "modes.levenshtein() Test des distances de <b>[https://fr.wikipedia.org/wiki/Distance_de_Levenshtein Levenshtein]</b> entre mots:",
modes_known_arguments_structure_title = "modes.known_arguments_structure() Définitions des arguments",
modes_args_unknown_report_title = "
modes_normal_box_main_text_1 = "Boîte d'information simple : titre de cette page <b>%1</b>, description : <b>%2</b>",
modes_normal_box_main_text_2 = "<br/>Il était <b>%1</b>, se nommait <b>%2</b> <b>%3</b>, il est mort en <b>%4</b>.",
Ligne 5 024 ⟶ 5 423 :
modes_recursive_normal_tests_title = "modes.recursive_normal() Test: Normalise le niveau récursif et la limite récursive",
modes_namespaces_page_list_title = "modes.namespaces_page_list() Module, namespaces, et noms de pages :",
modes_known_arguments_report_title
modes_known_arguments_report_headers
modes_get_args_report_title = "modes.
} -- modes.i18n.fr
modes.i18n.hu = {
-- Nombres y descripciones de argumentos de configuraciones
[1] = "1",
Ligne 5 038 ⟶ 5 435 :
[4] = "4",
["modules_guide"] = "Argument modules_guide",
-- Languages
--
-- Textos principales, errores y categorías de instrumentos
modes_form_ok_categ_tests = "OK kategória-generációs teszt",
Ligne 5 119 ⟶ 5 508 :
modes_unknown_auto_arg_err = "Belső hiba: Automatikus ismeretlen argumentum: <b>%1</b> = <b>%2</b>.",
modes_delete_docbox_wng = "Törölje a dokumentációt az égetés előtt.<br> Távolítsa el az összes módot, hogy visszatérjen az olvasási üzemmódba.",
--
modes_assist_user_param_err = "Felhasználói támogatás a konfiguráció ellenőrzéséhez:",
Ligne 5 132 ⟶ 5 521 :
modes_levenshtein_similar_tests_title= "modes.levenshtein() A távolságok igazolása <b>[https://es.wikipedia.org/wiki/Distancia_de_Levenshtein Levenshtein]</b> entre las palabras:",
modes_known_arguments_structure_title = "modes.known_arguments_structure() Az érvek fogalommeghatározása",
modes_args_unknown_report_title = "
modes_normal_box_main_text_1 = "Egyszerű információs mező: Az oldal címe: <b>%1</b>, leírás: <b>%2</b>",
modes_normal_box_main_text_2 = "<br/><b>%1</b> névvel <b>%2</b> <b>%3</b> meghalt <b>%4</b>.",
Ligne 5 146 ⟶ 5 535 :
modes_recursive_normal_tests_title = "modes.recursive_normal() Teszt: Normalizálja a rekurzív szintet és a rekurzív határt",
modes_namespaces_page_list_title = "modes.namespaces_page_list() Modul, névterek és oldalnevek:",
modes_known_arguments_report_title
modes_known_arguments_report_headers
modes_get_args_report_title = "modes.
} -- modes.i18n.hu
modes.i18n.vi = {
-- Noms et descriptions des arguments de configurations
[1] = "1",
Ligne 5 160 ⟶ 5 547 :
[4] = "4",
["modules_guide"] = "Argument modules_guide",
-- Languages
--
itemid_descr = "Định danh dữ liệu Wikidata, chẳng hạn như <code>Q535</code> để Victor Hugo.",
itemid2_descr = "Số nhận dạng khác để dữ liệu Wikidata, chẳng hạn như <code>Q535</code> để Victor Hugo.",
category = 'Loại',
mode_descr = "Loại sử dụng mô-đun hoặc mô hình: đọc, chỉnh sửa, tài liệu, kiểm tra.",
options = "options",
options_descr = "Hiển thị tùy chọn mô-đun hoặc mô hình.",
c = "c",
c_descr = "Hiển thị tùy chọn mô-đun hoặc mô hình.",
knownversions = "knownversions",
knownversions_descr = "Các phiên bản đã biết, để quản lý chúng.",
soughtversions_descr = "Các phiên bản được yêu cầu, để quản lý chúng.",
-- Principaux textes, erreurs et catégories des outils
-- Messages et erreurs divers
modes_used_options_list_title = "modes.used_options_list() Sử dụng các tùy chọn:",
Ligne 5 240 ⟶ 5 618 :
--
modes_delete_docbox_wng = "Bạn phải xóa tài liệu này trước khi lưu.<br> Xóa tất cả các chế độ để trở về chế độ đọc.",
--
modes_assist_user_param_err = "Hỗ trợ người dùng để kiểm tra cài đặt:",
Ligne 5 253 ⟶ 5 631 :
modes_levenshtein_similar_tests_title = "modes.levenshtein() Kiểm tra khoảng cách <b>[https://fr.wikipedia.org/wiki/Distance_de_Levenshtein Levenshtein]</b> entre mots:",
modes_known_arguments_structure_title = "modes.known_arguments_structure() Định nghĩa đối số",
modes_args_unknown_report_title = "
modes_normal_box_main_text_1 = "Hộp thông tin đơn giản: tiêu đề để trang này <b>%1</b>, mô tả: <b>%2</b>",
modes_normal_box_main_text_2 = "<br/>Anh ta <b>%1</b>, tên anh ta <b>%2</b> <b>%3</b>, anh ta đã chết <b>%4</b>.",
Ligne 5 267 ⟶ 5 645 :
modes_recursive_normal_tests_title = "modes.recursive_normal() Kiểm tra: Bình thường hóa mức đệ quy và giới hạn đệ quy",
modes_namespaces_page_list_title = "modes.namespaces_page_list() Mô-đun, namespaces, và tên trang:",
modes_known_arguments_report_headers= "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.
} -- modes.i18n.vi
Ligne 5 276 ⟶ 5 654 :
-- - - - ------------------ - - - - ---------------------------------
modes.options_for_modes = { -- default options_for_modes
edit = " box1 docdef docline docsrc docdata catview docview : ",
-- List of parameters for module documentation
-- "docview" or ":" add the documentation panel
Ligne 5 299 ⟶ 5 675 :
-- Manage Library:modes options. Administrar opciones. Gérer les options.
modes.template_options = "" -- Normal options from the template, like {{Bananas|options=docmax docdef}}.
modes.mode_options = "" -- Internal options from the
modes.available_options = "" -- table to collect all available options, at any time.
modes.used_options = {} -- table to collect really or tested options then list them at end of tests.
mathroman.known_arguments = { -- Table of the definitions of all known arguments at module level.
-- Arguments in order without names, with their keyword for use as other arguments.
-- Special arguments to modify the fonctions and outputs of this module.
mode = {typ = "config", need = 0, keyword = "mode"},
c = {typ = "config", need = 0, keyword = "c"},
options = {typ = "config", need = 0, keyword = "options"},
-- The userlang argument permits at an administrator in his own langage (errors, warnings, catégories, tests) to help a wiki in any language.
contentlang = {typ = "config", need = 1, keyword = "contentlang"},
pagelang = {typ = "config", need = 2, keyword = "pagelang"},
userlang = {typ = "config", need = 0, keyword = "userlang"},
birthyear = {typ = "dat", need = 0, keyword = "birthyear", prop = "P569", format = "year"},
}
function modes.bind_known_arguments_props(known_arguments, args_new) -- Bind known args and their properties for central libraries. Later for modules.
Ligne 5 318 ⟶ 5 707 :
function modes.known_arguments_one_lib(known_arguments, args_new) -- Bind known args and their properties for central libraries. Later for modules.
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- modes.known_arguments = { -- p.known_arguments
if (type(known_arguments) ~= "table") then return {} end
local known_arguments_props = {}
Ligne 5 333 ⟶ 5 722 :
local memo = viewers.save_configs("modes.bind_known_arguments_one_lib_report") -- Save global configuration before eventual changes.
local t = t or "\n* mathroman.known_arguments_one_lib(t) Report the binding of one library known args."
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- modes.known_arguments = { -- p.known_arguments
local known_arguments_props = modes.known_arguments_one_lib(modes.known_arguments, mathroman.known_arguments)
t = t .. "\n* " .. viewers.ta("#known_arguments_props", lua_table.level_count(known_arguments_props) )
Ligne 5 339 ⟶ 5 728 :
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = known_arguments,
rowGroup = {},
form_one_case = function(case) -- Convert a case from test_group to rowGroup.
return { viewers.value(case.key), case.bind, case.typ, case.need, case.keyword, case.prop, case.format, }
Ligne 5 346 ⟶ 5 736 :
headers = "modes_bind_known_arguments_report_headers",
headers = "key;bind;typ;need;keyword;prop;format",
}
t = t .. "<br/>" .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
Ligne 5 366 ⟶ 5 754 :
local memo = viewers.save_configs("modes.known_arguments_report") -- Save global configuration before eventual changes.
local t = t or "\n* <b>modes.known_arguments_report(t)</b> Report of main known args."
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- modes.known_arguments = { -- p.known_arguments
local args_group = {} -- modes.known_arguments = { -- p.known_arguments
for key, tab in pairs(known_arguments) do -- import and mix known args and properties
table.insert( args_group, tab )
Ligne 5 376 ⟶ 5 764 :
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = args_group, -- tab_view.test_group or
rowGroup = {},
title_memo = "modes.known_arguments_report(t) Report of main known args. **",
title_memo = "modes_known_arguments_report_title", -- "modes.known_arguments_report(t) Rapport des principaux arguments connus.",
headers = "modes_known_arguments_report_headers", -- headers = "key;
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.
Ligne 5 573 ⟶ 5 960 :
local t = t or "\n* <b>known_arguments_structure :</b> " -- modes_list_all_args_main_title
local tt
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments
if type(known_arguments) == "table" then
for key, elem in pairs(known_arguments) do
tt = viewers.tam("typ", elem.typ) .. viewers.tam("keyword", elem.keyword) .. viewers.tam("syn", elem.syn)
tt = tt .. viewers.tam("need", elem.need) .. viewers.tam("prop", elem.prop
tt = string.sub(tt, 3, -1)
t = t .. '\n: ' .. tostring(key) .. ' = { ' .. tt .. ' } '
Ligne 5 640 ⟶ 6 027 :
end -- function modes.levenshtein(word1, word2)
function modes.levenshtein_similar_tests(t) -- Tests of modes.
local memo = viewers.save_configs("modes.levenshtein_similar_tests") -- Save global configuration before eventual changes.
local t = t or ("\n* " .. viewers.form9user("modes_max_nearest_argument_msg") ) -- "A longer name argument accepts more letter errors."
t = t .. "\n* " .. "
local
t = t .. "\n* List of diffmaxi
local diffmaxi
for i = 1, 10 do
diffmaxi, tt = modes.similar_args_diffmaxi( string.sub("azertyuiopqsdfghjklm", 1, i), "azertyuiopqsdfghjklm") -- Format a string from the formula
modes.length_from_i[i] = diffmaxi
t = t .. viewers.ta(tostring(i), diffmaxi)
end
local diffmaxi, tt = modes.similar_args_diffmaxi(10, t .. "diffmaxi = ")
local group_test = { -- events.test_group
{ try = "nom", correct = "nom", },
Ligne 5 675 ⟶ 6 063 :
test_group = group_test,
title_memo = "modes.recursive_normal() Test: Normalize the recursive level and the recursive limit",
headers = "try;
headers_class = "wikitable alternative center sortable",
modes_nearest_argument_err = "Error: Do you need the known argument <b>%1</b> ?",
Ligne 5 682 ⟶ 6 070 :
case.try_length = string.len(case.try)
case.correct_length = string.len(case.correct)
case.diffmaxi
case.diff = modes.similar_args_diffmaxi(case.correct)
return { case.try, case.try_length, case.correct, case.correct_length, case.errors }
end,
rowGroup = {},
Ligne 5 701 ⟶ 6 090 :
modes.constants.near_word_search_diff_coef = 0.30 -- Access to change these constants from anywhere.
modes.constants.near_word_search_diff_const = 0.82
-- Maximum number of different letters between 2 argument names
Ligne 5 714 ⟶ 6 095 :
-- Nombre maximum de lettres différentes entre deux noms d'arguments
modes.length_from_i = {} -- Format a string from the formula
local coef = modes.constants.near_word_search_diff_coef or 0.30
local constant = modes.constants.near_word_search_diff_const or 0.82
local
local length = string.len(word)
local diffmaxi =
if type(t) == "string" then t = t .. tostring(coef) .. " * length + " .. tostring(constant) else t = "" end
return diffmaxi, t
end -- local diffmaxi, t = function modes.similar_args_diffmaxi(word, t) -- Format a string from the formula
-- For an unknown argument, seeks the name of the closest among the known arguments translated
Ligne 5 749 ⟶ 6 128 :
local argvalue = argvalue or known_arguments[argname]
local arg_values, key_values, keyword, keyval, argval, rank
local
if
arg_values = langs.content_translations[
key_values =
end
if type(arg_values) == "string" and type(key_values) == "string" then
local arg_tab = mw.text.split(arg_values, ';') -- table of
local key_tab = mw.text.split(key_values, ';') -- table of key
-- Default values
Ligne 5 762 ⟶ 6 141 :
keyval = nil -- key value
argval = nil
if
for i, key in ipairs(arg_tab) do
if key == argvalue then -- Search argvalue in arg_tab
Ligne 5 768 ⟶ 6 147 :
keyval = key_tab[i] -- Return correponding keyval in key_tab
argval = argvalue
keyword =
end
end
Ligne 5 859 ⟶ 6 238 :
local memo = viewers.save_configs("modes.multiple_selection_tests") -- Save global configuration before eventual changes.
local t = (t or "") .. "\n* <b>multiple_selection</b> options: " .. viewers.ta("=", "equal only") .. viewers.ta("t", "not trim before and after") .. viewers.ta("U", "not lowercase and uppercase")
--[[
local function multiple_selection_test1(t, opt, selector, to_select)
local selected_txt, selected_tab, txt = modes.multiple_selection(opt, selector, to_select)
local t = t .. viewers.table_row() .. viewers.table_dat(opt) .. viewers.table_dat(selector) .. viewers.table_dat(to_select) .. viewers.table_dat( txt .. viewers.ta("selected_txt", selected_txt) )
return t, opt, selector, to_select -- , selected_txt, selected_tab
end
--]]
local opt = "; "
t = t .. "\n: selector = <b>nobel,+1,président,3,député,prix</b> signifie : sélectionner le premier, puis 1 de plus parmi les suivants, puis 3 en tout au maximum."
Ligne 5 900 ⟶ 6 286 :
function modes.verify_args_tables(_known, _source)
-- initialize all the values to "" in
-- if type(_known) ~= "table" then _known = modes.known_arguments end
-- if type(_source) ~= "table" then _source = modes.args_source end
Ligne 5 915 ⟶ 6 301 :
return
end -- function modes.verify_args_tables(_known, _source)
function modes.get_default_args(known_arguments) -- Gets default arguments values
local memo = viewers.save_configs("modes.get_default_args") -- Save global configuration before eventual changes.
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments
-- ["QITEM"] = { ["typ"] = "dat", ["need"] =
-- 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"] =
for key, one_arg in pairs(known_arguments) do
if type(one_arg) == "table" then
Ligne 5 981 ⟶ 6 318 :
modes.arguments = arguments
viewers.restore_configs(memo, "modes.get_default_args") -- Restore global configurations after eventual changes.
return arguments, counts, tt -- With
end -- local arguments = modes.get_default_args(known_arguments) -- Gets default arguments values
modes.options_for_modes = { -- default options_for_modes
read = " box1 ",
edit = " box1 docdef docline docsrc docdata catview docview : ",
doc = " nobox1 noerr nocatview ",
tests = " box1 docdef docline docsrc docdata catview docview : tests ",
}
function modes.activate_known_arguments(known_arguments, phase) -- Activates known_arguments for phase = mode or argument or QITEM or property DODO
-- if type(one_arg["keyword"]) == "number" then one_arg["keyword"] = one_arg["syn"] end -- to move in the rigth place DODO
local m, val = modes, nil
local phase = phase or "none" -- Tactic: phase can be "mode", "argument", "QITEM", "property", "...". Any other value desactivates it, "none" is explicit. MUMU
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments = {...}
modes.actual_arguments = modes.actual_arguments or {} -- Groups activated arguments MUMU
local t = "\n* <b>function modes.activate_known_arguments(known_arguments, phase)</b> -- Activates known_arguments"
t = t .. "\n* in <b> function modes.activate_known_arguments(known_arguments, phase)</b> Counts initial modes.actual_arguments : " .. lua_table.level_count(modes.actual_arguments) .. "\n*"
if modes.actual_arguments == {} then modes.actual_arguments = mw.clone(known_arguments) end
local prop, props = datas.get_item(known_arguments, QITEM) -- Get datas from mw.wikibase for the page.
local arguments_known = mw.clone(known_arguments)
local counts = { ["template"] = 0, ["import"] = 0, ["source"] = 0, ["datas"] = 0, ["final"] = 0, ["known"] = 0, }
for key, one_arg in pairs(known_arguments) do -- For all known parameters
if type(one_arg) == "table" then -- avoid abnormal structure of known_arguments
-- * These origins of arguments are in the increasig priority: <code>known</code>, <code>import</code>, <code>datas</code>, <code>template</code>, <code>interact_final</code>.
if phase == "mode" then -- Tactic: this phase selects and activate the mode between "read", "edit", or "tests".
if one_arg["keyword"] and ( type(one_arg["keyword"] == "string") ) then -- If the argument need a Tactic
local mode = one_arg["prop_default"] -- Default is read mode
-- ["mode"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "mode", ["prop_default"] = "read"},
for i in pairs(modes.options_for_modes) do
if modes.options_for_modes[ mode ] then one_arg["mode"] = mode end
end
one_arg.val = mode -- mode = activate_known_arguments(known_arguments, "mode") done at 20181230 1755
counts = counts + 1
table.insert(modes.actual_arguments, mw.clone(one_arg) ) -- Inserts one_arg in the arguments already actualized.
end
end
--
if phase == "argument" then -- Tactic: this phase selects and activate the mode between mode or argument or QITEM or property".
if one_arg["keyword"] and ( type(one_arg["keyword"] == "string") ) then -- If the argument need a Tactic
-- ["mode"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "mode", ["prop_default"] = "read"},
-- ["modules_guide"] = { ["typ"] = "ctr", ["need"] = 0, ["keyword"] = "modules_guide", ["prop_default"] = "Centralizer", },
one_arg.val = one_arg["prop_default"] ; one_arg.src = "known" ;
counts = counts + 1
table.insert(modes.actual_arguments, mw.clone(one_arg) ) -- Inserts one_arg in the arguments already actualized.
end
end
--
if phase == "QITEM" then -- Tactic: this phase gets the sought QITEM or a default one's.
if one_arg["keyword"] and ( type(one_arg["keyword"] == "string") ) then -- If the argument need a Tactic
-- ["QITEM"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "QITEM", ["prop"] = "QITEM", ["prop_default"] = "Q307", }, -- ["prop"] = "QITEM" for:
-- datas.prop, datas.props = function datas.get_item(modes.args_unknown, QITEM) -- Get datas from mw.wikibase for the page.
one_arg.val = one_arg.default ; one_arg.src = "known" ;
table.insert(modes.actual_arguments, mw.clone(one_arg) ) -- Inserts one_arg in the arguments already actualized.
-- elseif one_arg.prop == "description" then val = mw.wikibase.description(QITEM) -- use props.description -- ric : Description of the QITEM page
counts = counts + 1
end
end
--
if phase == "property" then -- Tactic: this phase gets a sought property or a default one's.
if one_arg["keyword"] and ( type(one_arg["keyword"] == "string") ) then -- If the argument need a Tactic
one_arg.val = one_arg.default ; one_arg.src = "known" ;
counts = counts + 1
local datas_prop = datas.property(one_arg) -- Get datas from mwwikibase for one property of the page.
table.insert(modes.actual_arguments, mw.clone(datas_prop) ) -- Inserts one_arg in the arguments already actualized. function p.Init_central_module() group only
end
end
end
end
t = t .. "\n* in <b>function modes.activate_known_arguments(known_arguments, phase)</b> Counts final modes.actual_arguments : " .. lua_table.level_count(modes.actual_arguments) .. "\n*"
-- arguments.label = arguments.label or arguments.labeluser or arguments.labelpage or arguments.labelcontent or arguments.labelbylang -- insure label.val
table.sort(modes.actual_arguments, function (a, b) return ( tostring(a.keyword) < tostring(b.keyword) ) end ) -- alphabetic sort of translated arguments
return modes.actual_arguments, counts, tt -- With one_arg.val and one_arg.src
end -- modes.actual_arguments = function modes.activate_known_arguments(known_arguments, phase) -- Activates known_arguments for phase = mode or argument or QITEM or property
function modes.activate_known_arguments_report(t) -- Reports known_arguments after function ;modes.activate_known_arguments(known_arguments, phase) in functions_to_doc
local memo = viewers.save_configs("modes.activate_known_arguments_report") -- Save global configuration before eventual changes.
local t = t or "\n* <b>modes.activate_known_arguments(known_arguments)</b>: Update one_arg.val and one_arg.src in p.known_arguments."
t = t .. '\n* List of twice-view cases : in CentralManual modes.activate_known_arguments_report ; not in ModuleCentral test mode'
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments = { }
local arguments, counts, tt = modes.activate_known_arguments(known_arguments, phase) -- Activates known_arguments for phases = mode or argument or QITEM or property
-- function modes.activate_known_arguments(known_arguments, phase) -- Activates known_arguments for phase ...
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = arguments, -- Use default cases.
title_memo = "modes_known_arguments_report_title", -- "modes.known_arguments_report(t) Report of main known args.", -- en
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.
end,
rowGroup = {},
-- 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_arguments", lua_table.level_count(p.known_arguments) ) .. viewers.ta("arguments", lua_table.level_count(arguments) )
Ligne 6 005 ⟶ 6 418 :
t = t .. viewers.ta(tostring(count), n)
end
t = t .. "\n* Final content of arguments{}."
for key,
t = t .. viewers.ta(tostring(key),
end
viewers.restore_configs(memo, "modes.
return t
end -- t = t .. modes.
-- res = res .. drop_box.new(selector, "modes_known_arguments_report_title", modes.known_arguments_report)
function modes.mix_args(mix, mode_name, args_template) -- Mix arguments from options_for_modes, args_template S170710mix
local mix = mix or {}
modes.mix = mix
Ligne 6 046 ⟶ 6 459 :
end -- local mix = modes.mix_modes(mix, mode_name, args_template)
function modes.mix_options(mix, old_group, new_group) -- Mix 2 groups of options from diverse origins S170710mix
mix = mix or {}
if (type(old_group) ~= "string") then old_group = "" end
Ligne 6 072 ⟶ 6 485 :
mix.no_options = table.concat(no_options_tab, " ")
return mix
end -- active_options = modes.mix_options(old_group, new_group) -- S170710mix
function modes.init_args_mode_options(mix, mode_name, args_template) -- Imports and mixes args mode and options from template and invoke
--
-- This function allows any module to modify this process.
-- The default process gives the priority to options from arguments.
Ligne 6 085 ⟶ 6 498 :
-- Steps to mix modes values
--
-- Once run mix_args and mix_modes, in case a mode option would change the
mix = modes.mix_args(mix, mode_name, args_template) -- Mix arguments from options_for_modes, args_template
mix = modes.mix_modes(mix, mode_name, args_template) -- Mix some modes from several origins S170710mix
modes.options = modes.options_for_modes[modes.mode_name] -- options from mode
--
-- Once repeat mix_args and mix_modes, in case the mode changes through them.
mix = modes.mix_args(mix, mode_name, args_template) -- Mix arguments from options_for_modes, args_template
mix = modes.mix_modes(mix, mode_name, args_template) -- Mix some modes from several origins S170710mix
modes.options = modes.options_for_modes[modes.mode_name] -- options from mode
mix = modes.mix_options(mix, modes.options, modes.args_template.options ) -- Mix options from template
Ligne 6 112 ⟶ 6 525 :
function modes.args_mixer(args_template) -- S170703amo
--
-- This function allows any module to modify this process.
-- The default process gives the priority to templates arguments.
Ligne 6 147 ⟶ 6 560 :
function modes.options_mixer(args_template) -- S170703amo
--
-- This function allows any module to modify this process.
-- The default process gives the priority to options from arguments.
Ligne 6 188 ⟶ 6 601 :
function modes.import_args_mode_options(args_template) -- Import and mix args mode and options from template and invoke -- S170703amo
--
-- This function allows any module to modify this process.
-- The default process gives the priority to options from arguments.
Ligne 6 214 ⟶ 6 627 :
local min1, min2, min3 = 99, 99, 99
if (type(search) ~= "string") then search = "" end
local diffmaxi = modes.
local t = ", " .. tostring(diffmaxi) .. " / " .. tostring(length) .. " "
for key, arglingual in pairs(list) do
Ligne 6 229 ⟶ 6 642 :
end
t = t .. "<br>" .. viewers.ta("cherche", cherche) .. viewers.ta("trouve1", trouve1) .. viewers.ta("min1", min1) .. viewers.ta("trouve2", trouve2) .. viewers.ta("min2", min2) .. " " .. t
if trouve1 and
if trouve1 and
if trouve2 and
if trouve3 and
return trouve1, min1, trouve2, min2, t
end -- function modes.similar_args_search(search, list)
function modes.import_arguments(known_arguments, args_source, content_translations, args_wikidata) -- Import all arguments from template, or invoke, or wikidata
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments
modes.known_arguments = known_arguments
local args_wikidata = args_wikidata or modes.args_wikidata or p.args_wikidata or {} -- optional value from p.known_arguments
modes.args_wikidata = args_wikidata
local args_import = args_import or modes.args_import or {} -- optional value from p.known_arguments
modes.args_import = args_import
-- default parameters
Ligne 6 247 ⟶ 6 660 :
content_translations = content_translations or langs.content_translations
-- Mix args_source in args_import, with priority for present args_source.
local err = nil
local cats = ""
modes.nowyear = tonumber(os.date("%Y") ) -- now_date = os.date("%Y-%m-%d %H:%M:%S")
ARGS.add(viewers.ARGS, 1, "import_arguments", { ["argsknown"] = known_arguments, ["argssource"] = args_source, ["argswikidata"] = args_wikidata, ["nowyear"] = modes.nowyear, } ) -- ARGS.t
modes.import_arguments_err = ""
modes.import_arguments_track = ""
Ligne 6 264 ⟶ 6 678 :
local key_N, key_NN = 0, 0
local arg_found, rec_found, already_found = false, false, false
-- initialize all arguments to "not found" before import them from p.known_arguments
for key_known, argm in pairs(known_arguments) do
if type(argm) == "table" then argm.found = 0 end
Ligne 6 274 ⟶ 6 688 :
datas.prop, datas.props = datas.get_item(modes.args_unknown, QITEM) -- Get datas from mw.wikibase for the page.
-- Try to read all known arguments. Intentar leer todos los argumentos conocidos. Essayer de lire tous les arguments connus.
for key_known, argm in pairs(known_arguments) do
if type(argm) == "table" then
argm.src = nil
argm.trk = " n"
key_known_init = key_known
-- first initialise each known argument
modes.import_arguments_track = tostring(modes.import_arguments_track) .. " - " .. tostring(key_known)
ARGS.add(viewers.ARGS, 1, "known_arguments for", { key = key_known,
if
-- Name an unnamed argument, positional, by its synonym. Nommer un argument non nommé, numéroté, par son synonyme.
-- Rename a named argument, by its synonym. Renommer un argument nommé, par son synonyme.
--
key_known =
-- synonyms are defined with the stamp "syn = 2", then here stamp the basic argument with "syn = 1".
known_arguments[key_known].syn = 1
modes.import_arguments_track = tostring(modes.import_arguments_track) .. ">" .. tostring(key_known)
end
Ligne 6 311 ⟶ 6 712 :
arg_found = false
argval = nil
-- Import a wikidata argument. Importer un argument wikidata
if type(datas.props) == "table" and datas.props[key_known] then
argval = datas.props[key_known]
if
-- known_arguments[
-- known_arguments[
end
arg_found = true
Ligne 6 332 ⟶ 6 733 :
-- if argval then -- the argument value exist and come from template else from invoke else from wikidata
argval = args_source[arglingual]
arg_found = true
local arg_values = content_translations[
if
-- The argument is limited to multiple values with arg_values and keys_values, and the values are defined.
local pos = string.find(arg_values, argval)
if pos then
-- The value of the argument is in the multiple values of the arguments.
--
-- arg_found = true
if
-- known_arguments[
-- known_arguments[
end
else
events.add_err("modes_args_values_err",
-- argval = nil
end
else
--
-- arg_found = true
if
-- known_arguments[
-- known_arguments[
end
end
Ligne 6 370 ⟶ 6 767 :
-- events.add_err("versions_module_miss_i18n_trad_err", key_known)
-- Generate a category to list all modules with missing translation
cats = cats .. events.add_cat( "versions_err_module_miss_i18n_cat" )
end
key_N = tonumber(key_known_init)
if key_N and not known_arguments[key_N] then
events.add_err("modes_too_unnamed_arguments_err", key_N, argval)
events.add_cat("versions_with_usage_error_cat")
end
-- Record the argument. Guarde el argumento. Enregistrer l'argument.
if arg_found == true then
args_import[key_known] = argval -- received international arguments table
if modes.args_unknown[arglingual] then
Ligne 6 389 ⟶ 6 786 :
end
-- modes.import_arguments: after import itself, some surrounding checks.
for key_known,
-- 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
if
events.add_err("modes_value_re_defined_err", (
cats = cats .. events.add_cat("versions_with_usage_error_cat")
end
else
if
events.add_err("modes_value_re_defined_err", (
cats = cats .. events.add_cat("versions_with_usage_error_cat")
end
end
Ligne 6 407 ⟶ 6 804 :
-- need = 2 necessary from argument or module interaction
-- Missing Arguments. Argumentos que faltan. Arguments manquants.
if
arglingual = content_translations[key_known]
if arglingual then
events.add_err("modes_need_arg_value_err", arglingual)
cats = cats .. events.add_cat("versions_with_usage_error_cat")
end
end
Ligne 6 424 ⟶ 6 821 :
if not key_N then
events.add_err("modes_unknown_argument_err", arglingual, val_src)
cats = cats .. events.add_cat("versions_with_usage_error_cat")
-- "Error: parameter <b>%1</b> is unknown in this template. Check the name or flag this gap.",
-- Look for a known and similar name argument
local diffmaxi = modes.
local trouve1, min1, trouve2, min2 = modes.similar_args_search(arglingual, args_list)
if min1 and (min1 <= diffmaxi) then
Ligne 6 452 ⟶ 6 849 :
local tab_view = { -- Group datas and options for a table view with lines and columns.
test_group = modes.args_unknown, -- Use default cases.
form_one_case = function(case) -- Convert a case from test_group to rowGroup.
return { case.i, case.where, case.save, }
Ligne 6 459 ⟶ 6 855 :
headers = "modes_args_unknown_report_headers",
headers = "i;where;save",
rowGroup = {},
-- track_on == "details",
}
t = t .. "<br/>" .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns.
Ligne 6 490 ⟶ 6 888 :
if type(module_name) ~= "string" then module_name = "Central" end
local n, t, val = 0, "", ""
if type(known_arguments) ~= "table" then t = t.."
if type(known_arguments) ~= "table" then known_arguments = modes.known_arguments end -- optional arguments
local key, argknw, argval, arglingual = "", "", ""
Ligne 6 500 ⟶ 6 898 :
if n then key = tostring(parm["keyword"]) end -- key for unnamed arguments, in numeric sort
argknw = known_arguments[key]
arglingual = viewers.form9user(arglingual) -- multilingual name of the
if arglingual == "nil" then arglingual = key end -- if argument is translatable
val = parm -- tostring(args_import[key])
Ligne 6 631 ⟶ 7 029 :
args = mw.clone(known_arguments)
local arglst = {}
for key, elem in pairs(known_arguments) do
elem.key = tostring(key)
descr = key .. "_descr" -- key for description of an argument
Ligne 6 784 ⟶ 7 181 :
end -- function modes.init_modes_translate_events(frame, Central_version, mode_name, known_arguments, options_for_modes, QITEM)
-- p_template_drop_box_name = 'Cuadro desplegable', -- Equivalent templates exist in other wikis
-- p_template_drop_box_name = 'Boîte déroulante', -- Modèle:Boîte déroulante for drop_box.form
-- p_template_drop_box_name = 'Drop-down box', -- Template: Drop-down box for drop_box.form
-- p_template_drop_box_name = 'Cuadro desplegable', -- Modelo: cuadro desplegable :Boîte déroulante for drop_box.form
-- cut_libraries
Ligne 7 534 ⟶ 7 211 :
versions.i18n = {} -- Translations for versions library
versions.i18n.br = {
-- Principaux textes, erreurs et catégories des outils
versions_module_with_error_err = "Module avec erreur",
Ligne 7 590 ⟶ 7 265 :
} -- versions.i18n.br
versions.i18n.de = {
-- Principaux textes, erreurs et catégories des outils
versions_module_with_error_err = "Modul mit Fehler",
Ligne 7 646 ⟶ 7 319 :
} -- versions.i18n.de
versions.i18n.en = {
-- Main string, errors and categories of tools
versions_module_with_error_err = "Module with error",
Ligne 7 677 ⟶ 7 348 :
versions_module_miss_i18n_none_err = "OK, none missing translations.",
versions_module_miss_i18n_trad_err = "Internal Error: Module missing i18n translation for the argument <b>i18n.%1.%2</b>.",
versions_err_module_miss_i18n_cat = "Module missing i18n translation",
versions_err_module_miss_i18n_cat = "Module with internal error",
versions_module_miss_i18n_mini_err = "Error: I18n table has only <b>1%</b> translations.",
Ligne 7 698 ⟶ 7 370 :
} -- versions.i18n.en
versions.i18n.es = {
-- Textos principales, errores y categorías de instrumentos
versions_module_with_error_err = "Módulo con error",
Ligne 7 754 ⟶ 7 424 :
} -- versions.i18n.es
versions.i18n.fr = {
-- Principaux textes, erreurs et catégories des outils
versions_module_with_error_err = "Module avec erreur",
Ligne 7 810 ⟶ 7 478 :
} -- versions.i18n.fr
versions.i18n.hu = {
-- Fő szövegek, hibák és szerszámkategóriák
versions_module_with_error_err = "A modul hibás",
Ligne 7 866 ⟶ 7 532 :
} -- versions.i18n.hu
versions.i18n.vi = {
-- Các văn bản, lỗi và danh mục chính của công cụ
versions_module_with_error_err = "Mô-đun có lỗi",
Ligne 7 991 ⟶ 7 655 :
headers = " insub; sub; sought; known; errors ",
headers_class = "wikitable alternative center sortable",
--
}
--
Ligne 8 202 ⟶ 7 865 :
versions.bindable_libraries = { -- New libraries to record in package.loaded[]
["activity"] = "The <b>activity</b> library supports Lua-coders sub-tasks for central modules in international interactions.",
["datas"] = "The <b>datas</b> library formats some viewers for tables(in lines and columns), luatables...",
["drop_box"] = "The <b>drop_box</b> library formats Drop-boxes as objects, inside the viewers library",
Ligne 8 398 ⟶ 8 060 :
end
function versions.setup_central_libraries(bindable_libraries, opt) --
-- Record centralisable libraries if they are not included in standard mw.Extension:Scribunto
-- RunOnce : Do not repeat this function to not disturb subsequent processes.
Ligne 8 410 ⟶ 8 072 :
args = central_library.new("args", args) -- Lock in _G and package.loaded
table.insert(sorted_bind_libraries, args) -- Record all libraries
central_library = central_library.new("central_library", central_library) -- Lock in _G and package.loaded
table.insert(sorted_bind_libraries, central_library) -- Record all libraries
Ligne 8 478 ⟶ 8 138 :
-- - - - ------------------ - - - - ------------------ - - - - -----------------------------
--
-- In all cases the main module protects all original tables, including for itself.
-- Permit modules without versions for many existing modules. Modules are also simply tables for data-modules or PageData in Json.
Ligne 8 536 ⟶ 8 196 :
local result_cases = result_cases or versions.args_changes or {}
local tests_cases = {
["birthyear"] = { ["typ"] = "dat", ["need"] =
["deathyear"] = { ["typ"] = "dat", ["need"] =
["lastname"] = { ["typ"] = "dat", ["need"] =
["firstname"] = { ["typ"] = "dat", ["need"] =
}
local tab_view = { -- Group datas and options for a table view with lines and columns.
Ligne 8 548 ⟶ 8 208 :
headers = "module; arg; change; results; errors", -- "OK or error/s"
rowGroup = {},
-- ccc = {}, -- to remember
}
-- Runs tests cases and formats a table view with lines and columns.s
Ligne 8 643 ⟶ 8 303 :
headers = "versions_sort_central_modules_headers", -- "Title; Version; Date; Translations / Languages",
form_elem_detail = "versions_sort_central_modules_counts", -- "this + %2/%3 T/L, "
}
function tab_view.form_one_case(get) -- Convert a case from test_group to rowGroup.
Ligne 8 675 ⟶ 8 333 :
return res
end -- function versions.tasks_changes_report(t)
function modes.get_one_arg(known_arguments, keyword) -- Gets versatile adaptations for one argument
local memo = viewers.save_configs("modes.get_default_args") -- Save global configuration before eventual changes.
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments = { }
local get_keyword = tostring(keyword) -- Select the argument to use
local one_argument = {} -- To capture the argument to use
-- ["QITEM"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "QITEM", ["prop"] = "QITEM", ["prop_default"] = "Q307", },
-- keep Galilée (Q307), avoid Victor Hugo (Q535), Rudyard Kipling (Q34743),
-- Galilée (Q307), Victor Hugo (Q535), Aristote (Q868), Albert Einstein (Q937), Mohandas Karamchand Gandhi (Q1001), Christophe Colomb (Q7322),
-- Nelson Mandela (Q8023), Rudyard Kipling (Q34743), Martin Fleischmann (Q899264), Emmanuel Macron (Q3052772)
-- ["QITEM"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "QITEM", ["prop"] = "QITEM", prop_default = "Q34743", },
for key, one_arg in pairs(known_arguments) do -- DODO
if type(one_arg) == "table" then -- Checks for abnormal structure of known_arguments
if one_arg["keyword"] == one_arg[get_keyword] then -- This argument is the one to use
-- Tactic .is_in(
if one_arg["Tactic"] and ( type(one_arg["Tactic"] == "string") ) then -- If the argument need a Tactic
if viewers.is_in_sp(one_arg["prop_default"], one_arg["Tactic"], ";") then -- Which Tactic to use : enforce prop_default value
-- versatile adaptations
if type(one_arg.default_item == "string") then datas.prop_default = one_arg.default_item end -- versatile for datas like "Q34743" -- Rudyard Kipling **
-- use one_arg["prop_default"]-- DODO
-- end
end -- activate_known_arguments
one_argument = one_arg
end
end
end
end
table.sort(arguments, function (a, b) return ( tostring(a.keyword) < tostring(b.keyword) ) end ) -- alphabetic sort of translated arguments
modes.arguments = arguments
viewers.restore_configs(memo, "modes.get_default_args") -- Restore global configurations after eventual changes.
return arguments, counts, tt -- With one_arg.val and one_arg.src
end -- local arguments = modes.get_default_args(known_arguments) -- Gets default arguments values
-- function versions.init(frame, mode_name, known_arguments, options_for_modes, QITEM)
function versions.init(frame, Central_version, mode_name, known_arguments, options_for_modes, QITEM)
-- Initializes translations, bind_libraries, bind_sub_modules, get arguments, modes, options.
-- Imports arguments from wikidata, module and template with increasing priorities.
Ligne 8 694 ⟶ 8 384 :
ARGS.add(ARGS, 1, "versions.init before import_arguments") -- ARGS.t
-- res = res .. langs.init_content_page_user_lang() -- content_lang, page_lang, user_lang, "versions.init")
local mix = modes.init_args_mode_options(mix, mode_name, args_template) -- Import and mix args mode and options -- S170710mix
-- ["QITEM"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "QITEM", ["prop"] = "QITEM", prop_default = "Q34743", },
-- like function modes.get_default_args(known_arguments) -- Gets default arguments values
local mix = mix or {}
modes.mix = mix -- To easy get, track and test the init_args_mode_options process
local mix = modes.init_args_mode_options(mix, mode_name, args_template) -- S170703amo MAMO.t
-- res = res .. langs.init_content_page_user_lang() -- content_lang, page_lang, user_lang, "versions.init")
langs.main_i18n_complete = true -- Unmask all views after enough init.
Ligne 8 772 ⟶ 8 457 :
headers = "versions_versions_management_headers", -- "sought; versions; process; comments",
headers_class = "wikitable alternative center sortable",
--
}
function tab_view.form_one_case(vers_test) -- Convert a case from test_group to rowGroup.
Ligne 9 197 ⟶ 8 881 :
-- cut_libraries
-- - - - ------------------ - - - - ---------------------------------
-- - - - ------------------ - - - - ---------------------------------
-- The Library:viewers supports Lua-coders sub-tasks and inter-wikis central modules.
-- - - - ------------------ - - - - ---------------------------------
-- - - - ------------------ - - - - ---------------------------------
-- These Module:Centralizer/I18N translations for viewers library update and complete Module:Centralizer translations.
Ligne 9 212 ⟶ 8 904 :
-- Ne pas traduire ces noms de bibliothèques
viewers_section_title_library_activity = "Library:activity",
viewers_section_title_library_datas = "Library:datas",
viewers_section_title_library_langs = "Library:langs",
Ligne 9 248 ⟶ 8 939 :
-- Übersetzen Sie diese Bibliotheken nicht
viewers_section_title_library_activity = "Library:activity",
viewers_section_title_library_datas = "Library:datas",
viewers_section_title_library_langs = "Library:langs",
Ligne 9 284 ⟶ 8 974 :
-- Do not ranslate these libraries names
viewers_section_title_library_activity = "Library:activity",
viewers_section_title_library_datas = "Library:datas",
viewers_section_title_library_langs = "Library:langs",
Ligne 9 318 ⟶ 9 007 :
-- No traduzca estos nombres de bibliotecas
viewers_section_title_library_activity = "Library:activity",
viewers_section_title_library_datas = "Library:datas",
viewers_section_title_library_langs = "Library:langs",
Ligne 9 354 ⟶ 9 042 :
-- Ne pas traduire ces noms de bibliothèques
viewers_section_title_library_activity = "Library:activity",
viewers_section_title_library_datas = "Library:datas",
viewers_section_title_library_langs = "Library:langs",
Ligne 9 390 ⟶ 9 077 :
-- Ne fordítsa le ezeket a könyvtárak nevét
viewers_section_title_library_activity = "Library:activity",
viewers_section_title_library_datas = "Library:datas",
viewers_section_title_library_langs = "Library:langs",
Ligne 9 426 ⟶ 9 112 :
-- Không dịch các tên thư viện này
viewers_section_title_library_activity = "Library:activity",
viewers_section_title_library_datas = "Library:datas",
viewers_section_title_library_langs = "Library:langs",
Ligne 9 488 ⟶ 9 173 :
function viewers.phab_task(task, comment) -- Forms a link to a Phabricator task.
local t = "" -- example: "[[phab:T135845|T135845 Convert]]"
if ( type(comment) ~= "string" ) then comment = "" end
-- The task id is a string with "T" and a number. We check this syntax:
if ( type(task) == "string" ) and ( string.find("T", "%s", 1, true) == 1 ) and tonumber( string.sub( s, 2, -1 ) ) then task = task else task = "T000" end
t = "[[phab:" .. task .. "|" .. task .. " " .. comment .. "]]"
return t -- replace anywhere : "[[phab:" by "viewers.phab_task(task, comment)" then update all
end -- t = t .. ;viewers.phab_task(task, comment) -- Forms a link to a Phabricator task.
Ligne 9 642 ⟶ 9 326 :
end -- function viewers.date_to_part(date, part)
function mw.text.sortCommaList(list, sep1, sep2, sep3) -- Sort without repeat a list with separators like "Central01;versions 2.4;tools;two words"
Ligne 9 753 ⟶ 9 375 :
return output -- .. t
end -- function viewers.simple_list(list, sep1, sep2, sep3)
function viewers.form_one_case(case) -- Convert a case from test_group to rowGroup.
case.res1 = case.result[1] or "res1" -- DEBUG : mathroman.int2roman() can fail without blocking page.
case.err2 = case.result[case.errorsKey] or "err2" -- DEBUG : mathroman.int2roman() can fail without blocking page.
Ligne 9 906 ⟶ 9 456 :
end
end
t = string.gsub(t, p.version.versionName, langs.Central_version or Central.
return t
end -- function viewers.trans9vars(translations, key, ...)
Ligne 9 918 ⟶ 9 468 :
end
function viewers.form9en(ref, ...) -- Replace %1 to %9 by arguments. Always in english
if not langs.main_i18n_complete then return "" end -- Avoid to fail in init phase.
local t, n = "", 0
Ligne 10 002 ⟶ 9 552 :
-- headers_class = "wikitable alternative center sortable",
rowGroup = {},
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 10 075 ⟶ 9 624 :
-- headers_class = "wikitable alternative center sortable",
rowGroup = {},
}
function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup.
Ligne 10 101 ⟶ 9 650 :
end
function viewers.doc_section(selector, section, style, mask_sections) --
local
local selector, section, style
if mask_sections then return
if selector == "never" then return
local select = (selector == true) or (selector == title) or viewers.is_in_sp(selector, "allwaysview alltestsview enforcerun failinref nocontent")
if type(style) ~= "string" then style = "h3" end
local n = tonumber( string.sub(style, 2, 2) )
style = "" ; for i = 1, n do style = style .. "=" end
t = t .. "\n" .. style .. section .. " " .. style .. "\n" -- style OK
-- t = t .. "\n* ModuleCentralizer only tests sections doc_section"
return t
end -- res = res .. viewers.doc_section(selector, "viewers_section_title_page", "h2", mask_sections) -- example
function drop_box.dh( opt )
Ligne 10 125 ⟶ 9 670 :
return val
end
dh = drop_box.dh
function drop_box.html(title, content_or_func) -- Builds the drop box at the html level.
Ligne 10 228 ⟶ 9 774 :
end
end
-- p_template_drop_box_name = 'Boîte déroulante', -- Modèle:Boîte déroulante for drop_box.form
local dropbox_title
--[ [
-- local dropbox_title = viewers.form9content("p_template_drop_box_name")
t = t .. mw.getCurrentFrame():expandTemplate{ title = dropbox_title, args = {
["label"] = d.label, ["titre"] = d.title, ["contenu"] = d.content,
Ligne 10 247 ⟶ 9 795 :
function drop_box.new(selector, title, content_or_func, ...) -- Formats a drop_box for a doc or a group of tests. Take apart dropit options.
-- From 20180503 a bug (in Module:Centralizer or MediaWiki) some Dropboxes display twice : modes.
-- From 20180503 a bug (in Module:Centralizer or MediaWiki) See CentralManual display twice : modes.
-- selector = "allwaysview" -- To allways display one view. -- selector = "enforcerun" -- To debug one box with INTERNAL ERROR.
local memo = viewers.save_configs("drop_box.new") -- Save global configuration before eventual changes.
Ligne 10 458 ⟶ 10 006 :
t = t .. viewers.table_row()
for col, val in ipairs(columns_i) do
t = t .. viewers.table_dat(val or tostring(val) or "-") -- each value in columns of row_i
end
end
Ligne 10 469 ⟶ 10 017 :
function tableview.new(tab_view) -- Formats a table with lines and columns. S170610tvf
local memo = viewers.save_configs("tableview.
if type(tab_view) ~= "table" then tab_view = {} end -- tab_view must be a table
tab_view.t = (tab_view.t or "") .. viewers.ta("tableView: ", "start")
Ligne 10 480 ⟶ 10 028 :
if tab_view.track_on then t = t .. tab_view.t end
-- Counts of selected and sorted sub-tasks: , #test_group = 43 , #rowGroup = 0
viewers.restore_configs(memo, "tableview.
return t, err, tab_view
end -- t, err, tab_view = function tableview.new(tab_view)
Ligne 10 489 ⟶ 10 037 :
res = res .. drop_box.new(selector, "datas.available_props_report(t) Reports availables datas properties **", datas.available_props_report)
-- res = res .. drop_box.new(selector, "modes_known_arguments_report_title", modes.known_arguments_report)
res = res .. drop_box.new(selector, "modes_get_args_report_title", modes.
res = res .. drop_box.new(selector, "modes_used_options_list_title", modes.used_options_list )
res = res .. drop_box.new(selector, "modes_list_all_args_main_title", modes.list_all_args_main)
Ligne 10 501 ⟶ 10 049 :
function viewers.doc_module(selector, mask_sections) -- Formats some Dropboxes of tests to document a module.
local res = ""
if not mask_sections then res = res .. viewers.doc_section(selector, "viewers_section_title_module", "h2") end
res = res .. drop_box.new(selector, "p.Init_central_module_tests_title **", p.Init_central_module_tests) -- doc link
res = res .. drop_box.new(selector, "modes_args_unknown_report_title", modes.args_unknown_report)
res = res .. drop_box.new(selector, "versions_support_desk_title", versions.form_support_desk_report)
Ligne 10 520 ⟶ 10 069 :
res = res .. drop_box.new(selector, "activity_MW_Versions_report_title", activity.MW_Versions_report)
res = res .. drop_box.new(selector, "activity_central_functions_report_title", activity.central_functions_report)
-- if 1 then return res end -- try to find : {{Centralizer|tests|itemid=Q535}} Erreur Lua : not enough memory
--
if not mask_sections then res = res .. viewers.doc_section(selector, "Library:datas", "h3") end -- .get_item(
res = res .. drop_box.new(selector, "
-- res = res .. drop_box.new(selector, "datas_update_Special_PageData_title", datas.update_PageData)
--
--
-- res = res .. drop_box.new(selector, "langs_selectLang_tests_title", langs.select_lang_test) -- lang %1 %2 %3
--
if not mask_sections then res = res .. viewers.doc_section(selector, "Library:langs", "h3") end
res = res .. drop_box.new(selector, "langs_translations_counts_title", langs.translations_counts) -- S170618ltc
-- res = res .. drop_box.new(selector, "langs_changing_translations_title", langs.changing_translations) -- no tabview
Ligne 10 561 ⟶ 10 108 :
if not mask_sections then res = res .. viewers.doc_section(selector, "Library:modes", "h3") end -- function viewers.doc_section(
-- if not mask_sections then res = res .. viewers.doc_section(selector, "viewers_section_title_library_modes", "h3") end
res = res .. drop_box.new(selector, "
res = res .. drop_box.new(selector, "
res = res .. drop_box.new(selector, "modes_used_options_list_title", modes.used_options_list)
-- res = res .. drop_box.new(selector, "modes.bind_known_arguments_one_lib_report(t) Report the binding of one library known args. **", modes.bind_known_arguments_one_lib_report)
Ligne 10 573 ⟶ 10 117 :
-- res = res .. drop_box.new(selector, "versions_bind_arguments_tests_title", versions.bind_arguments_tests)
res = res .. drop_box.new(selector, "modes_options_uses_tests_title", modes.options_from_mode_tests)
-- res = res .. drop_box.new(selector, "modes_options_uses_tests_title", modes.options_from_mode_tests,
-- d.bg1="yellow", d.border_color="red", d.border_radius="10px 10px 10px 10px", image="Sanscrit dha.svg", } ) -- , cssview=true
-- arguments list
-- res = res .. drop_box.new(selector, "modes_all_categories_list_title", modes.all_categories_list) -- n = 0
Ligne 10 578 ⟶ 10 124 :
-- arguments support
-- res = res .. drop_box.new(selector, "modes_multiple_selection_tests_title", modes.multiple_selection_tests)
res = res .. drop_box.new(
res = res .. drop_box.new(selector, "modes_levenshtein_similar_tests_title", modes.levenshtein_similar_tests)
res = res .. drop_box.new(selector, "modes_namespaces_page_list_title", modes.namespaces_page_list)
res = res .. drop_box.new(selector, "modes_recursive_normal_tests_title", modes.recursive_normal_tests) -- only errors
-- res = res .. drop_box.new(selector, "modes_recursive_normal_tests_title", modes.recursive_normal_tests) -- only errors
-- res = res .. drop_box.new(selector, "modes_namespaces_page_list_title", modes.recursive_normal_tests) -- only errors
-- function tab_view.form_one_case)
-- "enforcerun"
if not mask_sections then res = res .. viewers.doc_section(selector, "Library:versions", "h3") end
-- if not mask_sections then res = res .. viewers.doc_section(selector, "viewers_section_title_library_versions", "h3") end
Ligne 10 593 ⟶ 10 138 :
res = res .. drop_box.new(selector, "versions_all_G_and_loaded_list_title", versions.all_G_and_loaded_list)
-- res = res .. drop_box.new(selector, "versions_central_changes_title", versions.central_changes) --RIC mw.loadData(
-- res = res .. drop_box.new(selector, "versions_bind_modules_tests_title", versions.bind_modules_test )
res = res .. drop_box.new(selector, "versions_sort_central_modules_title", versions.sort_central_modules_report ) -- S170606cmr
Ligne 10 604 ⟶ 10 148 :
res = res .. drop_box.new(selector, "langs_form99user_tests_title", viewers.form99user_test )
res = res .. drop_box.new(selector, "viewers_parts_of_date_tests_title", viewers.parts_of_date_tests)
res = res .. drop_box.new("never", "viewers_table_tab_options_title", viewers.table_test )
res = res .. drop_box.new(selector, "viewers_save_restore_balance_title", viewers.save_restore_balance_report) -- to_debug_on_20170507
Ligne 10 653 ⟶ 10 195 :
p.options_for_modes = { -- module options_for_modes
}
function p.box_read(prop, title) -- Draw the main box one. -- ric (p.box_read)
-- Galilée (Q307), Victor Hugo (Q535), Aristote (Q868), Albert Einstein (Q937), Mohandas Karamchand Gandhi (Q1001), Christophe Colomb (Q7322),
-- Nelson Mandela (Q8023), Rudyard Kipling (Q34743), Martin Fleischmann (Q899264), Emmanuel Macron (Q3052772)
datas.QITEM = mw.wikibase.getEntityIdForCurrentPage() -- use props.QITEM Returns the Item id as string, like "Q42"
local QITEM = datas.QITEM or datas.default_item or "Q307" -- Keep Galilée (Q307)
datas.prop, datas.props = datas.get_item(modes.known_arguments, QITEM) -- Get datas from mw.wikibase for the page.
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang()
local prop = datas.prop
local res = "(p.box_read) "
local flag = viewers.form_image("Flag_of_England.svg", 50)
-- local flag = viewers.form_image(viewers.form9user("flag_of_country"), 50)
-- known_arguments_country = "England", -- English
-- known_arguments_flag = "Flag_of_England.svg", -- English
-- known_arguments_monument = "St_Pauls_aerial_%28cropped%29.jpg", -- English St Paul's Cathedral
-- known_arguments_town = "London", -- English
local image = viewers.form_image(prop.image, 50)
local birthyear_deathyear = " ( " .. (prop.birthyear or "birthyear") .. " - " .. (prop.deathyear or "deathyear") .. " ) "
local phabtask = " - [[d:" .. QITEM .. "|Datas]] "
res = res .. "<br/><center><b>firstname: " .. (prop.firstname or "firstname") .. "</b>, "
res = res .. "<b>sitelink: " .. prop.sitelink .. phabtask .. "</b></center>"
res = res .. "<br/><center>Labels in langs: <b>" .. prop.labelbylang .. "</b>, user: <b>" .. prop.labeluser .. "</b>, content: <b>" .. prop.labelcontent .. "</b>, page: <b>" .. prop.labelpage .. "</b>"
res = res .. "<br/><center><b>description: " .. prop.description .. birthyear_deathyear .. "</b></center>"
res = res .. " <br/><center>" .. flag .. " * used languages: user:<b>" .. langs.user_lang .. "</b>, content:<b>" .. langs.content_lang .. "</b>, page:<b>" .. langs.page_lang .. "</b> * " .. image .. "</center>"
-- res = res .. "<br/><center>languages:<b>" .. langs.main_i18n_languages_list() -- List available translations languages
res = '<div style="border-radius:0.7em; margin-right:5px; box-shadow:0.2em 0.3em 0.2em #B7B7B7; background-color:#F1F1DE; padding:0.3em; width=90%; overflow-x:hidden; ">' .. res .. '</div>'
return res
end -- function p.box_read(known_arguments, title)
-- Display the documentation in an infobox, similar to edit-boxs
-- Affichage de documentation dans un cadre (box), semblable aux boites d'edition
function p.box_edit(known_arguments)
-- read = " box1 ",
-- edit = " box1 docdef docline docsrc docdata catview docview : ",
-- doc = " nobox1 noerr nocatview ",
-- tests = " box1 docdef docline docsrc docdata catview docview : tests ",
local res, props = "", datas.props
if type(known_arguments) ~= "table" then known_arguments = modes.known_arguments end -- optional arguments
langs.init_content_page_user_lang(modes.args_source.contentlang, modes.args_source.pagelang, modes.args_source.userlang)
-- res = res .. "<center><small>" .. viewers.discreet_main_version() .. viewers.ta("contentlang", langs.content_lang) .. viewers.ta("pagelang", langs.page_lang) .. viewers.ta("userlang", langs.user_lang)
res = res .. "<center>" .. viewers.discreet_main_version() .. viewers.ta("content", langs.content_lang) .. viewers.ta("page", langs.page_lang) .. viewers.ta("user", langs.user_lang)
res = res .. " - [https://fr.wikisource.org/wiki/MediaWiki:Scribunto/Central_modules_reference_manual User manual]"
res = res .. " - viewers.phab_task('T135845', 'Convert')"
res = res .. " - viewers.phab_task('T198107', 'Begin to use')" .. "</center>"
res = res .. viewers.styles_color_error("<center><b>" .. viewers.form9user("modes_delete_docbox_wng") .. "</b><br/></center>")
res = res .. drop_box.form(drop_box.new_title(), versions.form_support_desk_report() )
if modes.option("debug") then res = res .. "\n*" .. viewers.ta("modes.cat_view", modes.cat_view) .. viewers.ta("modes.template_options", modes.template_options) .. viewers.ta("modes.mode_options", modes.mode_options) end
local lnk = props.QITEM
if modes.option("docdata") then res = res .. "\n*" .. modes.generDoc(" docdef docline ", datas.args_wikidata, datas_link) end
res = res .. ", " .. viewers.form9user(" (%1 properties)", (datas.propss_count_all or "") ) -- datas_structured_data_txt
if modes.option("docview") then res = res .. "\n*" .. modes.generDoc("", known_arguments, "Arguments") end
if not modes.option("noerr")then res = res .. "\n*" .. events.errors_lister() end
local t = "" -- Formats events views
-- local wng, err, cat = events.sort_typ() -- Sort events by type in wng, err, cat.
-- if one_event.typ == "wng" then one_event.res = viewers.styles_color_warning(one_event.user_wkt) end
-- if new_one_event then table.insert(events.all_events_group, one_event) end
for key, one_event in pairs(events.all_events_group) do
if one_event.typ == "wng" then
one_event.res, one_event = events.formats(one_event)
if one_event.res then t = t .. "<br>* " .. tostring(one_event.res) end
end
end
--
for key, one_event in pairs(events.all_events_group) do
if one_event.typ == "err" then
one_event.res, one_event = events.formats(one_event)
if one_event.res then t = t .. "<br>* " .. tostring(one_event.res) end
end
end
--
for key, one_event in pairs(events.all_events_group) do
if one_event.typ == "cat" then
one_event.res, one_event = events.formats(one_event)
if one_event.res then t = t .. "<br>* " .. tostring(one_event.res) end
end
end
t = t .. langs.main_i18n_languages_list() -- List available translations languages
res = res .. t
res = '<div style="border-style: solid; border-width: 1px; background-color:#FAFAFA; padding:0.3em; width=90%; overflow-x:hidden; ">' .. res .. '</div>'
-- local result = "\n------ " -- This code interact with drop_box and debug the bug T20151215 2016-11-13 17:57.
-- result = result .. '<div class="CentralDocBox" style=" width=90%; border: 1px solid #AAAAAA; margin:1em; background-color:#F1F1F1; padding:0.3em; ">' .. res .. '</div>'
-- result = result .. "\n* " .. events.categories_lister(":")
return res
end -- function p.box_edit(known_arguments)
function p.form_result(known_arguments, main_module) -- Formats all results of this module and its sub-modules.
local res = ""
local memo = viewers.init_configs("p.form_result") -- Initialize global configurations and save them before eventual changes.
local known_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- for A in FAMLTVQDR Arguments definitions at module level p.known_arguments - = {...}
datas.default_item = datas.default_item or "Q307" -- Keep Galilée (Q307)
main_module = main_module or versions.main_module
if type(known_arguments) ~= "table" then known_arguments = modes.known_arguments end -- optional arguments
res = res .. viewers.ta("modes.mode_name", modes.mode_name) .. viewers.ta("modes.options", modes.options)
-- if modes.option("box1") then res =
if modes.option("box1") then res = res .. p.box_read(prop, title) end -- Draw the main box one. -- ric (p.box_read)
if modes.option("box1") or modes.option("catview")
then res = res .. " catview = " .. events.categories_lister(":") end -- Display categories
Ligne 10 682 ⟶ 10 301 :
res = res .. "\n* datas.default_item = <b>" .. datas.default_item .. "</b>, datas.default_name = <b>" .. datas.default_item .. "</b>\n"
res = res .. p.box_edit(modes.known_arguments)
elseif modes.option("read") or (modes.known_arguments.mode == "read") then -- (box_edit)
res = res .. "\n* datas.default_item = <b>" .. datas.default_item .. "</b>, datas.default_name = <b>" .. datas.default_item .. "</b>\n"
res = res .. p.box_read(modes.known_arguments)
Ligne 10 690 ⟶ 10 309 :
if modes.option("tests") then -- or (modes.known_arguments.mode == "tests") --
res = res .. viewers.doc_group("allwaysview") -- viewers.doc_group(selector, mask_sections) -- To enforce title of sections
-- res = res .. viewers.doc_page("allwaysview") -- included in viewers.doc_group
-- res = res .. viewers.doc_module("allwaysview") -- included in viewers.doc_group
-- res = res .. viewers.doc_internal("allwaysview") -- included in viewers.doc_group
res = res .. versions.running_times(false, "")
end
viewers.restore_configs(memo, "p.form_result") -- Restore global configurations after eventual changes.
Ligne 10 854 ⟶ 10 473 :
p.i18n.br = { -- Translations in breton
-- Arguments to import, do not translate. Arguments à importer, ne pas traduire.
["modules_guide"] = { ["typ"] = "ctr", ["need"] =
['p_template_drop_box_name'] = 'Boîte déroulante', -- Modèle:Boîte déroulante for drop_box.form
['c'] = 'c',
Ligne 10 912 ⟶ 10 531 :
p.i18n.en = { -- Translations in English
-- Arguments to import, do not translate.
["modules_guide"] = { ["typ"] = "ctr", ["need"] =
['p_template_drop_box_name'] = '
['c'] = 'c',
['mode'] = 'mode',
Ligne 10 969 ⟶ 10 588 :
p.i18n.es = { -- Translations in espagnol
-- Importar estos argumentos. No traducir.
["modules_guide"] = { ["typ"] = "ctr", ["need"] =
['p_template_drop_box_name'] = '
['c'] = 'c',
['mode'] = 'mode',
Ligne 11 027 ⟶ 10 646 :
p.i18n.fr = { -- Translations in français
-- Arguments to import, do not translate. Arguments à importer, ne pas traduire.
["modules_guide"] = { ["typ"] = "ctr", ["need"] =
['p_template_drop_box_name'] = 'Boîte déroulante', -- Modèle:Boîte déroulante for drop_box.form
['c'] = 'c',
Ligne 11 086 ⟶ 10 705 :
p.i18n.vi = {
-- Arguments to import, do not translate. Arguments à importer, ne pas traduire.
["modules_guide"] = { ["typ"] = "ctr", ["need"] =
['p_template_drop_box_name'] = '
['c'] = 'c',
['mode'] = 'mode',
Ligne 11 151 ⟶ 10 770 :
-- - - - ------------------ - - - - ---------------------------------
p.known_arguments = { -- Table of the definitions of all known arguments at module level.
-- Arguments in order without names, with their keyword for use as other arguments.
-- Arguments dans l'ordre, non nommés, avec leur keyword pour traitement comme les autres arguments.
[1] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = 1, ["syn"] = "mode", ["1_default"] = "read", }, -- for {{Centralizer|doc|... default mode
[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.
-- Guideline for default arguments values: each main_module can replace any option of any argument from Centralizer.
-- Guideline for these changes: Centralizer is always protected against any change.
--
-- Special arguments to modify the fonctions and outputs of this module.
-- Arguments speciaux pour modifier le fonctionnement et les sorties de ce module.
["
["category"] = { ["typ"] = "ctr", ["need"] = 0, ["keyword"] = "category"},
["debug"] = { ["typ"] = "opt", ["need"] = 0, ["keyword"] = "debug"},
["c"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "c"},
["docfunc"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "docfunc"},
["docitem"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "docitem"},
["dockey"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "dockey"},
["itemid"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "itemid"}, -- Property:P2959 points to a double of the item.
["mode"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "mode"},
["options"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "options"},
["knownversions"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "knownversions"},
["soughtversions"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "soughtversions"},
["contentlang"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "contentlang"},
["pagelang"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "pagelang"},
["userlang"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "userlang"},
["known_arguments_country"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "known_arguments_country", ["prop"] = "P18", },
["known_arguments_flag"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "known_arguments_flag", ["prop"] = "P18", },
["known_arguments_monument"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "known_arguments_monument",["prop"] = "P18", },
["known_arguments_town"] = { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "known_arguments_town", ["prop"] = "P18", },
--
-- All arguments have a keyword identical to the registration name, except synonyms.
-- Tous les arguments ont un keyword identique au nom d'enregistrement, sauf les synonymes.
["
["
["
["
["
["
["
["
["
["
["
["
["
["
["
["
["
["
-- Galilée (Q307), Victor Hugo (Q535), Aristote (Q868), Albert Einstein (Q937), Mohandas Karamchand Gandhi (Q1001), Christophe Colomb (Q7322),
-- Nelson Mandela (Q8023), Rudyard Kipling (Q34743), Martin Fleischmann (Q899264), Emmanuel Macron (Q3052772)
["sitelink"] = { ["typ"] = "dat", ["
["uri"] = { ["typ"] = "dat", ["
["sex"] = {["keyword"] = "sex", ["typ"] = "dat", ["need"] =
["arg_values"]
["region"] = {["keyword"] = "region", ["typ"] = "dat", ["need"] =
["arg_values"]
["rights"] = {["keyword"] = "rights", ["typ"] = "dat", ["need"] =
["arg_values"]
["delay_values"] = "0;0;0;0;50;50;70;70;95", ["arg_uses"] = "none;none;none;none;cn;cn;us;us;mpf
["known_arguments_monument"] = { ["typ"] = "dat", ["need"] =
["labelbylang"] = { ["typ"] = "dat", ["need"] =
-- known_arguments_monument = "Tour Eiffel", -- French
-- known_arguments_town = "Paris", -- French
} -- #p.known_arguments
function p.form_support_desk_report(t) return versions.form_support_desk_report(t) end
Ligne 11 218 ⟶ 10 852 :
t = t .. "\n* " .. viewers.ta("Main module Description", version.mainDescription) .. viewers.ta("function", version.functionDescription) .. viewers.ta("task", version.taskDescription)
t = t .. "\n* MediaWiki_version: " .. versions.MediaWiki_version() -- Formats MediaWiki_version, in error color if it changes.
t = t .. "\n*" .. langs.
t = t .. "\n* Start versions from the main module: " .. (versions.bind_verif_modules_report_start or " bind_verif_modules_report_start missing ")
t = t .. versions.versions_management_report()
Ligne 11 227 ⟶ 10 861 :
return t, details
end
function p.form_tests_init(res, args_source)
Ligne 11 356 ⟶ 10 893 :
-- - - - ------------------ - - - - ---------------------------------
-- - - - ------------------ - - - - ---------------------------------
local versatile_arguments = {}
modes.versatile_arguments = versatile_arguments
-- FAMLTVQDR Tactic only once steps : Frame Mode-from-Frame Args Libraries Translations Versions QITEM Datas Results
-- { "20181220", "20181221", "NOW", "Rical", "S181220oso", "select only sub-functions in the right order in function p.Init_central_module()", },
function 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.
Ligne 11 391 ⟶ 10 938 :
local loaded_pack = versions.loaded_modules_and_libraries
versions.bind_reverse_i18n_translations(main_versions, loaded_pack) -- Bind all i18n translations from modules and their /I18N translations sub-modules
res = res .. "\n* Counts main_versions : " .. viewers.ta("n", lua_table.level_count(main_versions) )
ARGS = tracker.initadd({ ["name"] = "ARGS", limit = 2, }) -- Initialize a track and its track lines.
ARGS.add(ARGS, 1, "versions.init before import_arguments") -- ARGS.t
-- res = res .. langs.init_content_page_user_lang() -- content_lang, page_lang, user_lang, "versions.init")
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
return res
end --
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_arguments, 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_arguments = known_arguments or modes.known_arguments or p.known_arguments or {} -- optional value from p.known_arguments = {...}
local options_for_modes = options_for_modes or modes.options_for_modes or p.options_for_modes
res = res .. versions.init(frame,
versions.memo_i18n = mw.clone(versions.main_i18n or langs.main_i18n)
langs.main_i18n = versions.memo_i18n ; versions.main_i18n = versions.memo_i18n
-- local datas = mw.clone(datas)
res = res .. modes.init_modes_translate_events(frame, Central_version, mode_name, modes.known_arguments, options_for_modes, QITEM or itemid)
datas.props = datas.get_item(known_arguments, QITEM) -- Get datas from mw.wikibase for the page.
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_arguments, args_source, content_translations, args_wikidata) -- function modes.import_arguments()
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang()
res = res .. (datas.props_trk or "")
Ligne 11 457 ⟶ 11 084 :
-- Helpers or admins can add options to include edit or tests or user language...
local res = ""
local t = Central.init(frame, Central.
-- res = res .. t
res = res .. p.form_result(modes.known_arguments)
Ligne 11 467 ⟶ 11 094 :
local res = "</b>"
res = res .. "Library:langs"
local t = Central.init(frame, Central.
-- res = res .. t
res = res .. p.form_result(modes.known_arguments)
return res
end -- function Central.edit(frame)
-- ["docfunc"] = { ["typ"] = "config", ["need"] =
-- ["
-- ["dockey"] = { ["typ"] = "config", ["need"] = 0, ["keyword"] = "dockey"},
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_arguments, p.options_for_modes) -- QITEM
langs.init_content_page_user_lang() -- function langs.init_content_page_user_lang()
modes.change_itemid() -- default = "Q41568"
-- {{Central|doc|versions_support_desk_title}}
local docfunc = modes.known_arguments.docfunc or modes.known_arguments[3] or modes.args_import.docitem or modes.args_import[3]
local docitem = modes.known_arguments.docitem or modes.known_arguments[2] or modes.args_import.docitem or modes.args_import[2] or datas.default_item
local dockey = modes.known_arguments.dockey or modes.known_arguments[1] or modes.args_import.dockey or modes.args_import[1]
local QITEM = modes.known_arguments.QITEM or modes.known_arguments.docitem or docitem
QITEM = mw.text.trim(QITEM) -- clean spaces in each name
if dockey then
local selector = mw.text.trim(dockey)
end
return res
end -- function Central.doc(frame)
function Central.tests(frame)
local res = ""
res = res .. tracker.init_trakers() -- Initialize some trakers. To run in Central.init()
local t = Central.init(frame, Central.
res = res .. t
-- res = res .. "\n* getEntityIdForCurrentPage = " .. tostring( mw.wikibase.getEntityIdForCurrentPage() ) -- Returns the Item id as string, like "Q42"
Ligne 11 517 ⟶ 11 136 :
return res
end -- function Central.tests(frame)
function versions.detect_MediaWiki_changes()
Ligne 11 681 ⟶ 11 294 :
function viewers.doc_group(selector, mask_sections) -- function viewers.doc_internal(selector, mask_sections)
local res = ""
local selector = selector or "enforce"
local mask_sections = mask_sections or nil
if p.teststests == "not FAMLTVQDR" then -- DODO
res = res .. "\n* Displays internal tests FAMLTVQDR activated."
res = res .. drop_box.new(selector, "modes_known_arguments_report_title", modes.known_arguments_report)
res = res .. drop_box.new(selector, "p_Init_central_module_report **", p.Init_central_module_report) -- for phase = mode or argument or QITEM or property
res = res .. drop_box.new(selector, "p.Init_central_module_tests_title **", p.Init_central_module_tests) -- doc link
res = res .. drop_box.new(selector, "langs_main_i18n_languages_list", langs.main_i18n_languages_list ) -- OK, show in table ?
res = res .. drop_box.new(selector, "langs_list_MediaWiki_languages_title", langs.list_MediaWiki_languages ) -- OK, show in table ?
res = res .. drop_box.new(selector, "modes Init Frame Args Mode Libraries **", p.init_central_module_tests)
res = res .. drop_box.new(selector, "modes_get_args_datas_tests_title", modes.get_args_datas_tests)
Ligne 11 690 ⟶ 11 310 :
else
res = res .. viewers.doc_section(selector, "Tests of this page", "h2", mask_sections) -- function viewers.doc_section(
res = res .. drop_box.new(selector, "activity_report_subtasks_title", activity.central_subtasks_report) -- to try if needed
res = res .. viewers.doc_page(selector, mask_sections) -- mask for time limit
|