Module:Multilingual

Une page de Wikiversité, la communauté pédagogique libre.

local p = {}▲ avant 2020 ? -- 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 Mdc.lua Mdc function p.box_read(prop, title) -- GOOD but viewers.form9user(d.content) NO 20200101 2010.lua


|---------------|------------------------------ typical length --------------------------|---------------------------max| DODO

--[[ modes.getTitle() = function() begin return p.mainmodule_name end this is the title of the module invoked


function viewers.drop(selector title content_or_func very good but l 1320 got nil

Erreur Lua : bad argument #1 to 'gsub' (st parcel edit with a good drop box+Box Very good (p.box_read) langs names links OK OK expected, got nil) local t = versions.init_multilingual_module("read", args_known) -- l 10248 function versions.versions_support_test(t) -- Tests various combinations of mod-- frame:getTitle() ---- if frame then local title = frame:getTitle() -- local main_module = modes.getTitle() -- this is the title of the module invoked -- if 'main_versions' (a nil value). replace main_versions by from 20171224 infos p.["infos"]["versions"]["libname"] -- function viewers.form9user(_test(t) -- Tests of viewers.form9user_test(). at 20190830 0809 -- to delete after import of OK OK  : tests_groups 647d3c2 box_view t = t or compete at 20190831 1751 --protopyte of tab_view for all tests to standardize unic key : TVTV _test1 to ckeck after " local tab_view = " local tab_view = { -- Group datas and options for a table view with lines and columns. title_memo = "modes_args_unknown_report_title", 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, } end, -- headers = "activity_monitor_central_libraries_headers", -- " Name; Description of the library ", headers = " Name; Description of the library ", headers_class = "wikitable alternative center sortable", rowGroup = {}, -- track_on == "details", } t = t .. "
" .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns. return t --]] -- local title = frame:getTitle() -- this is the title of the module invoked -- local main_module = versions.get_one_module_or_library(title) -- Get the main module. versions.bind_all_i18n()better --[[after OK : standard tabview, search all residual anomalies in all tests, clean comments for a normal understanding, /I18N, UMUM -- then share with the first team of good lua coders, 3*3*3 are OK ,close the begin task. Then split Centralizer in independant libraries. -- Then Rical, half the time, can begin Teslain with perhaps Jean Louis Naudin, Yves, Lucien, Pascal and the security team. -- Continue, half the time, to support other lua coders, like all the fist team ... -- frame:getTitle() -- function versions.bind_the_main_module() -- Bind the main module, all sub-modules and all their i18n. local t = t -- t or if type(t) ~= "string" then t = '\n* langs.translations_counts("activity.i18n") : Counts of contents of some tables' end -- UMUM : means to report in the CentralManual. -- MWMW : means add a mw version in the table activity.MediaWiki_Versions = { ... } -- COCO : is the present change point of Lua codage. hh -- COCO Story : function activity.phabricator_tasks_report(t, short) -- OK -- arbitrary end added in main Loop pairs(args_known) -- function versions.init_multilingual_module( MdCentral function viewers.form9content(ref, ...) in debug ERR 201901321.lua -- %x: (where x is any non-alphanumeric character) represents the character x. This is the standard way to escape the magic characters. -- x: (where x is not one of the magic characters ^$()%.[]*+-?) represents the character x itself. THEN "%%" give "%" -- viewers_form9user_abnormal_ref_i_cat = "In the function viewers.form9user(ref, ...) function the reference is abnormal", else d.header = viewers.form9user("viewers_dropdown_missing_header") end -- "Missing title for this drop_box" function viewers.drop(selector, title, content_or_func, ...) -- Formats a drop_box for a doc or a group of tests t = t .. viewers.insert_image(d.image, "22px", d.style, ...) -- example of use if (type(t) ~= "string") then t = '\n* langs.translations_counts("activity.i18n") Counts of contents of some tables, from their names: ' end function viewers.form9content(ref, ...) and other functional languages seem ok function modes.namespaces_page_list(t) -- List namespaces for the actual page. datas.available_props_report(t) -- Reports availables datas properties **" does not exist

res = res .. "\n*

"

local i18n = langs.main_i18n or versions.main_i18n or versions.memo_i18n from ModuleCentralizer Levenshtein 20181016 ok idem 20190723 1004.lua -- debug t = function activity.central_subtasks_report(t) seams ok 20190729 1702 function modes.namespaces_page_list(t) -- List namespaces for the actual page. seems OK at 20190723 0820 no a nil value function versions.bind_all_sub_modules(sub_modules, iftest) -- Bind all sub-modules of the main module.seems OK at 20190723 0816 local success, result = viewers.AntiCrash(protected_func, selector, mask_sections) -- function viewers.AntiCrash( seems ok : modes.all_categories_list(t) langs.translations_statistics_report(t) activity.phabricator_tasks_report(t, short) return res used in all main viewers, probably good, then residual debug starts on 21/07/2019

--Module:Centralizer à la ligne 10937 -- res = res .. p.form_result(args_known fail ligne 10956 -- The main central module is mainly an installer of central libraries and a small demonstrator. -- The current debugs change only small adjustments in new functions ... -- ********** before 3 3 3 install verify all tests + ;viewers...; + UMUM ********* apres manger . . . function viewers.drop(

-- === Références par module -- -- ===

=== Références par balise ===

res = res .. "\n*
=== Références par module ==="

res = res .. "\n*

"

res = res .. "\n*
=== Références par balise ===" res = res .. viewers.drop( -- Running times: start in page = 2421 mS , import + 0 mS , form result + 0 mS , tests + 20 mS , duration = 20 mS ,


|---------------------|------------------------ typical length --------------------------|----------max| DODO

-- We will display, in "err" style, module name + space + line number to link. COCO function viewers.AntiCrash(protected_func, ...) -- Protects the pages of wikipedia against a complete crash, if available. UMUM local args_known = args_known or modes.args_known or p.args_known or {} -- optional value from p.args_known = {...} modes.args_import = modes.args_import or {} seems OK at 20190530 0747 t = t .. "\n* " .. one_elem["key"] .. " = " .. viewers.form9user(one_elem.trans_key) -- seem ok function modes.all_elements_list(base, list_Kind) -- List all eventual categories or others of this wiki to try modes.arguments = arguments -- arguments values sorted by keyword UMUM -- new to try : function modes.all_categories_list(t) -- List all eventual categories of this wiki -- MdCentral function p.form_result() continue OK 0957.lua function viewers.form9user(ref, ...) seems OK argmt, detailed UMUM --]]

-- only for ModuleCentralizer : restart from : ModuleCentralizer function modes.levenshtein_similar_tests OK.lua DODO -- todo : then use function p.Init_central_module() to replace function versions.init_multilingual_module() -- MUMU : means to report in the CentralManual. -- MWMW : means add a mw version in the table versions.MediaWiki_Versions = { ... } -- COCO : is the present change point of Lua codage. -- MUMU : means to report in the CentralManual. -- TCTC : Development Tactic on 20191227 -- cut_libraries

-- - - - ------------------ - - - - ----------------- - - - - ----------------------------- -- Development Tactic on 20180905 -- A central module could need a translation service and a versioning service to enhance its functions or its stability without disturbing the preview normal use. -- A main module can define its sought sub-modules versions names and its known sub-modules versions names. -- The Library:versions installs other libraries, supports versions, binds modules, libraries and i18n translations. -- For this goal a module contains at least one i18n tranlations table. Its /I18N sub-modules contains translations in several languages. -- The adaptation to any number of languages is automatic. -- The highest level is the main module. The lowest level is the libraries level. -- -- Any module or library can contain i18n tables. -- i18n tables are mixed from the lowest to the highest level, to permit at upper module to adapt the meaning of string to a new use. -- Each library is independent of other ones and they can be mixed in any order. -- To avoid conflict of translations keys between libraries, all translations keys names start with the library name. -- -- Tactic for modules, arguments, options and default values 20180908. -- In all cases the main module protects all original tables, including for itself. -- Permit modules without versions for many existing modules. Modules are also simply tables for data-modules or PageData in Json. -- 3 central functions bind sub-modules, translations and arguments in 3 new tables. -- All arguments can have default values, like "prop_default" for "prop" to use it in case of tests or missing value. -- Do not disturb actual modules, libraries, translations ; only add new structures and most explicit tables of args, i18n, modules, libraries... -- -- - - - ------------------ - - - - ------------------ - - - - -----------------------------

-- The central system permits to convert any module as p. -- The Lua part of the central modules support contains some libraries used by central modules. -- The Module:Centralizer installs central libraries (waiting stable Scribunto central repository). -- An object has a function object.new() to form several objects -- A library is unic and come from Scribunto. -- Unique declarations of libraries and objects: -- To split ModuleCentral-s-fr delete activity. on 2018-01-10T09:35:00 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 events = {} -- Object:events from ? "events" langs = {} -- Library:langs from i18n tables on 20130118, br-de-en-es-fr-vi from 20170217, lua_table = {} -- Library:lua_table from lua_table.level_list() from 20170808 mathroman = {} -- Library:mathroman from ? modes = {} -- Library:modes from arguments support on 20130125 in Module:Author, 20130312 in Module:ControlArgs central_library = {} -- Object:central_library from versions.central_library on 20171211 in Module:Centralizer tableview = {} -- Object:tableview from 20170208 tab_view = {} -- Object:tab_view from 20170208 tracker = {} -- Object:tracker from 20170628 versions = {} -- Library:versions from versioning on 20170316. From versions support in Module:Author3 on 20150225. viewers = {} -- Library:viewers from 20170209

versions.memo_i18n = versions.memo_i18n or {} versions.memo_i18n["en"] = {} -- local intern_or_use = versions.memo_i18n["en"][key]

p.infos = { -- Basis of the descrition of the main and the subs versions, from 20171224 infos p.["infos"]["versions"]["libname"] ['versionFrom'] = "MdCentral function modes.levenshtein_similar_tests == OK OK.lua", ['versionName'] = "Centralizer", ['versionNumber'] = "1.0.0(2019-08-31T08:20)", ['versionDate'] = "2019-08-31T08:20", -- UTC version structure MWMW 2019-03-02T09:28:00 ['mainDescription'] = "Begin to use", ['functionDescription'] = "first functional support", ['taskDescription'] = "enough advanced to use in CentralSchool Central School OK", -- p_template_drop_box_name = 'Reference', -- Equivalent templates exist in other wikis ['sought'] = "Centralizer;Centralizer/I18N;Mathroman;TestRequire", -- Sought module and submodules versions ['known'] = "Centralizer;Central-s-fr;Central-14 * Centralizer/I18N;Central/i18n * Mathroman22;Mathroman34", -- Known module and submodules versions ['treebranches'] = { -- For each sought. Replace known. Later on 201811207 { "Centralizer", "Central-s-fr", "Central-2017" }, -- upper { "Centralizer/I18N", "Central-s-fr", "Central-2018" }, -- median luatable { "Mathroman22", "Mathroman34" }, -- lower } -- { site = "www.MediaWiki", verstime = "2019-08-28T19:03:19", versid = "1.34.0-wmf.20 (1488aca)", seen_time = "2019-08-30T08:00:00", }, } -- MWMW "1.34.0-wmf.20 (1488aca)"

if frame then local title = frame:getTitle() -- this is the title of the module invoked versions.main_module = require( title ) -- this is the main module invoked versions.module_name = title -- this is the title of the module invoked

versions.module_version = versions.main_module["infos"]["versions"]["libname"] -- Get the main_version. versions.main_module = versions.main_module -- this is the main module invoked versions.module_name = title -- this is the title of the module invoked versions.module_version = versions.main_module["infos"]["versions"]["libname"] -- Get the version of the main module.

modes.module_version = modes.main_module["infos"]["versions"]["libname"] -- Get the main_version. modes.main_module = modes.main_module -- this is the main module invoked modes.module_name = title -- this is the title of the module invoked modes.module_version = modes.main_module["infos"]["versions"]["libname"] -- Get the version of the main module. versions.main_module = p -- this is the main module invoked versions.main_module.module_name = "Centalizer" -- this is the title of the module invoked modes.main_module = p -- this is the main module invoked --[[ example of use to get the main module or is name main_module = versions.main_module module_name = versions.module_name main_module.title = versions.module_name main_module = modes.main_module module_name = modes.module_name main_module.title = modes.module_name --]] end -- local main_module = versions.get_one_module_or_library(title) -- Get the main module. versions.bind_all_i18n()better

-- cut_libraries

-- - - - ------------------ - - - - --------------------------------- -- - - - ------------------ - - - - --------------------------------- -- The Library:activity supports Lua-coders sub-tasks and inter-wikis central modules. -- - - - ------------------ - - - - --------------------------------- -- - - - ------------------ - - - - --------------------------------- -- Last MediaWiki-Wikisource update/upgrade versions: -- Seen and recorded at each preview to test fr.wikisource.org/wiki/Module:Centralizer-s-fr -- French time UTC +1 or +2 -- See ISO 8601 time format like : 1977-04-22T01:00:00-05:00 (5 shift hours) = 1977-04-22T06:00:00Z local time

versions.MediaWiki_Versions = { -- KEEP FIRST VERSIONS { site = "fr.wikisource", verstime = "2016-06-19", versid = "2016-06-19", seen_time = "2016-06-19", }, { site = "fr.wikisource", verstime = "2017-05-11T00:48:00", versid = "1.29.0-wmf.21 (d6c07d1)", seen_time = "2017-05-11T00:48:00-00:00", task = "T165000", title = "The version date of MW 1.29.0-wmf.21 (d6c07d1) is in the future !", report = "Rical: Schedule in https://www.MediaWiki.org/wiki/MediaWiki_1.29/Roadmap", }, -- function versions.detect_MediaWiki_changes() display only 3 last months { site = "fr.wikisource", verstime = "2018-01-02T18:49:06", versid = "1.31.0-wmf.15 (8e46998)", seen_time = "2018-01-04T14:20:00", }, { site = "fr.wikisource", verstime = "2018-01-04T21:47:05", versid = "1.31.0-wmf.15 (601cf9d)", seen_time = "2018-01-07T18:30:00", }, { site = "fr.wikipedia", verstime = "2018-01-07T20:46:36", versid = "1.31.0-wmf.15 (0953700)", seen_time = "2018-01-09T20:57:00", }, { site = "fr.wikisource", verstime = "2018-01-07T20:46:36", versid = "1.31.0-wmf.15 (0953700)", seen_time = "2018-01-12T07:43:00", }, { site = "fr.wikisource", verstime = "2017-12-15T23:35:09", versid = "1.31.0-wmf.16 (a31d45c)", seen_time = "2018-01-12T07:43:00", task = "T155624", title = "In wikisource/Spécial:Version:wmf.15 (0953700) but Central module mw = 1.31.0-wmf.16 (a31d45c) seen by Rical.", }, { site = "fr.wikisource", verstime = "2019-08-04T20:25:27", versid = "1.32.0-wmf.24 (9291e40)", seen_time = "2019-08-04T20:26:00", }, { site = "fr.wikisource", verstime = "2019-08-04T20:30:15", versid = "1.32.0-wmf.24 (35fb3b6)", seen_time = "2019-08-04T20:50:00", }, { site = "fr.wikisource", verstime = "2019-08-02T19:17:19", versid = "1.34.0-wmf.16 (22b2132)", seen_time = "2019-08-05T08:00:00", }, { site = "fr.wikisource", verstime = "2019-08-06T13:16:22", versid = "1.34.0-wmf.16 (6b18b66)", seen_time = "2019-07-30T09:28:00", }, { site = "www.MediaWiki", verstime = "2019-08-06T19:21:52", versid = "1.34.0-wmf.17 (b1c1329)", seen_time = "2019-08-07T08:00:00", }, { site = "fr.wikisource", verstime = "2019-08-07T01:28:02", versid = "1.34.0-wmf.17 (09c0989)", seen_time = "2019-08-08T05:40:00", }, { site = "fr.wikisource", verstime = "2019-08-09T01:41:20", versid = "1.34.0-wmf.17 (6566628)", seen_time = "2019-08-16T09:20:00", }, { site = "fr.wikisource", verstime = "2019-08-20T13:58:22", versid = "1.34.0-wmf.17 (3ab1ed1)", seen_time = "2019-08-16T06:40:00", }, { site = "fr.wikisource", verstime = "2019-08-22T14:22:26", versid = "1.34.0-wmf.19 (efab97f)", seen_time = "2019-08-23T07:50:00", }, { site = "fr.wikisource", verstime = "2019-08-26T13:22:33", versid = "1.34.0-wmf.19 (451f99e)", seen_time = "2019-08-28T10:00:00", }, { site = "www.MediaWiki", verstime = "2019-08-28T19:03:19", versid = "1.34.0-wmf.20 (1488aca)", seen_time = "2019-08-30T08:00:00", }, { site = "fr.wikisource", verstime = "2019-09-04T19:46:10", versid = "1.34.0-wmf.21 (486add2)", seen_time = "2019-09-07T08:00:00", }, { site = "fr.wikisource", verstime = "2019-09-11T03:14:16", versid = "1.34.0-wmf.22 (12d612c)", seen_time = "2019-09-12T10:30:00", }, { site = "fr.wikisource", verstime = "2019-09-18T19:05:17", versid = "1.34.0-wmf.23 (db0e380)", seen_time = "2019-09-19T09:30:00", }, { site = "fr.wikisource", verstime = "2019-09-19T19:44:08", versid = "1.34.0-wmf.23 (b2b9fbf)", seen_time = "2019-09-20T08:00:00", }, { site = "fr.wikisource", verstime = "2019-09-25T19:04:32", versid = "1.34.0-wmf.24 (9d74db9)", seen_time = "2019-09-26T06:20:00", }, { site = "fr.wikisource", verstime = "2019-10-01T01:21:40", versid = "1.34.0-wmf.24 (48381c8)", seen_time = "2019-10-01T21:00:00", }, { site = "fr.wikisource", verstime = "2019-10-03T01:18:05", versid = "1.34.0-wmf.25 (4750f81)", seen_time = "2019-10-04T06:00:00", }, { site = "fr.wikisource", verstime = "2019-10-07T21:06:43", versid = "1.34.0-wmf.25 (54dbe5f)", seen_time = "2019-10-04T06:00:00", }, { site = "www.MediaWiki", verstime = "2019-10-08T20:09:47", versid = "1.35.0-wmf.1 (64f5c4c)", seen_time = "2019-10-09T06:00:00", }, { site = "fr.wikisource", verstime = "2019-10-22T13:14:28", versid = "1.35.0-wmf.2 (21e7707)", seen_time = "2019-10-23T09:00:34", }, { site = "www.MediaWiki", verstime = "2019-10-22T14:57:49", versid = "1.35.0-wmf.3 (1ed75b4)", seen_time = "2019-10-23T09:00:00", }, { site = "fr.wikisource", verstime = "2019-10-24T13:04:24", versid = "1.35.0-wmf.3 (82aecf8)", seen_time = "2019-10-25T09:30:00", }, { site = "fr.wikisource", verstime = "2019-10-24T13:04:24", versid = "1.35.0-wmf.4 (aef2d22)", seen_time = "2019-10-31T06:00:00", }, { site = "fr.wikisource", verstime = "2019-10-31T19:05:47", versid = "1.35.0-wmf.4 (d11f7c9)", seen_time = "2019-11-01T07:00:00", }, { site = "fr.wikisource", verstime = "2019-11-04T16:26:38", versid = "1.35.0-wmf.4 (7af252a)", seen_time = "2019-11-06T08:00:00", }, { site = "fr.wikisource", verstime = "2019-11-07T20:15:48", versid = "1.35.0-wmf.5 (c5c79e5)", seen_time = "2019-11-09T07:00:00", }, { site = "fr.wikisource", verstime = "2019-11-19T00:24:04", versid = "1.35.0-wmf.5 (5cacfed)", seen_time = "2019-11-19T06:00:00", }, { site = "fr.wikisource", verstime = "2019-11-21T01:00:21", versid = "1.35.0-wmf.5 (8a7d1c0)", seen_time = "2019-11-21T07:00:00", }, { site = "fr.wikisource", verstime = "2019-12-12T17:22:01", versid = "1.35.0-wmf.5 (a473ba0)", seen_time = "2019-12-15T08:00:00", }, { site = "fr.wikisource", verstime = "2019-12-19T13:48:57", versid = "1.35.0-wmf.11 (0cc84b1)", seen_time = "2019-12-24T21:00:00", }, } -- MWMW 1.35.0-wmf.11 (0cc84b1) versions.MediaWiki_version_memo = "1.35.0-wmf.11 (0cc84b1)" versions.MediaWiki_Versions_sort = "<" -- First on end, Last on begin versions.MediaWiki_Versions_sort = ">" -- First on begin, Last on end -- function activity.MW_Versions_report(t) -- Reports versions of MediaWiki for 3 months.

-- cut_libraries

-- - - - ------------------ - - - - --------------------------------- -- - - - ------------------ - - - - --------------------------------- -- The Library:activity supports Lua-coders sub-tasks and inter-wikis central modules. -- - - - ------------------ - - - - --------------------------------- -- - - - ------------------ - - - - ---------------------------------

-- events = {} -- already declared by Scribunto, see central_library.new() -- Record a library in package.loaded

-- The Module:Centralizer/I18N translations for lua_table library update and complete Module:Centralizer translations. events.i18n = {} -- Translations for events library events.i18n.br = { events_test_projects_title = "Tester et afficher les événements tests pour les projets", events_test_projects_headers = "Type: Clé; Nom, test et valeurs, résultat du test", events_test_MediaWiki_title = "Tester et afficher les événements de test pour MediaWiki", events_test_MediaWiki_headers = "Type: Clé; Nom, test et valeurs, résultat du 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 = "type; key; argument; result", events_add_cat_deprecated = "Fonction obsolète dans le module principal.", events_close_without_memo_err = "viewers.restore_configs(memo, where) sans memo dans le module %1.", 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.de = { events_test_projects_title = "Testen und Anzeigen von Tests für Projekte", events_test_projects_headers = "Type; Key; Name Test und Werte; Ergebnis des Tests", events_test_MediaWiki_title = "Testen und Anzeigen von Ereignissen für MediaWiki", events_test_MediaWiki_headers = "Type; Key; Name Test und Werte; Ergebnis des Tests", events_test_categ_Test_title = "categ_Test tist: Klassen in einigen Sprachen", events_all_kinds_tests_title = "events.all_kinds_test() Test: alle Arten von Ereignissen (err, wng, cat)", events_all_kinds_tests_headers = "Art; Schlüssel; Argument; Ergebnis", events_add_cat_deprecated = "Elavult funkció a főmodulban.", events_close_without_memo_err = "viewers.restore_configs(memo, where) ohne memo im Modul %1.", events_antiCrash_protect_err = "The antiCrash() Funktion schützt diese Seite vor einem kompletten Absturz aufgrund eines internen Fehlers: %1.", } -- events.i18n.de events.i18n.en = { 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 = "Test categ_Test: categories 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_add_cat_deprecated = "FObsolete function in the main module.", events_close_without_memo_err = "viewers.restore_configs(memo, where) without memo in the module %1.", events_antiCrash_protect_err = "The antiCrash() function protects this page against complete collapse due to an internal error: %1.", } -- events.i18n.en events.i18n.es = { events_test_projects_title = "Prueba y muestra pruebas de eventos para proyectos", events_test_projects_headers = "Tipo; clave; prueba de nombre y valores; resultado de la prueba", events_test_MediaWiki_title = "Prueba y muestra pruebas de eventos para MediaWiki", events_test_MediaWiki_headers = "Tipo; clave; prueba de nombre y valores; resultado de la prueba", 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 = "arte; clave; argumento; resultado", events_add_cat_deprecated = "Función obsoleto en módulo principal.", events_close_without_memo_err = "viewers.restore_configs(memo, where) sin memo en el módulo %1.", 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_projects_title = "Tester et afficher les événements tests pour les projets", events_test_projects_headers = "Type: Clé; Nom, test et valeurs, résultat du test", events_test_MediaWiki_title = "Tester et afficher les événements de test pour MediaWiki", events_test_MediaWiki_headers = "Type: Clé; Nom, test et valeurs, résultat du 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 = "type; key; argument; result", events_add_cat_deprecated = "Fonction obsolète dans le module principal.", events_close_without_memo_err = "viewers.restore_configs(memo, where) sans memo dans le module %1.", 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_projects_title = "A tesztelés és a megjelenítés teszteli a projektek eseményeit", events_test_projects_headers = "Típus; Kulcs; Névvizsgálat és értékek; A vizsgálat eredményei", events_test_MediaWiki_title = "A tesztelés és a megjelenítés teszteli a MediaWiki", events_test_MediaWiki_headers = "Típus; Kulcs; Névvizsgálat és értékek; A vizsgálat eredményei", events_test_categ_Test_title = "Test categories_Test: kategóriák egyes nyelveken", events_all_kinds_tests_title = "events.all_kinds_test() Teszt: mindenféle esemény (err, wng, cat)", events_all_kinds_tests_headers = "Art; kulcs; érv, eredmény", events_add_cat_deprecated = "Elavult funkció a főmodulban.", events_close_without_memo_err = "viewers.restore_configs(memo, where) memo </ b> nélkül a modulban %1.", events_antiCrash_protect_err = "Az antiCrash() függvény megóvja ezt az oldalt a teljes összeomlás ellen a belső hiba miatt: %1.", } -- events.i18n.hu events.i18n.vi = { events_test_projects_title = "Kiểm tra và hiển thị các sự kiện kiểm tra cho các dự án", events_test_projects_headers = "Type; Key; Kiểm tra tên và các giá trị; kết quả để phép thử", events_test_MediaWiki_title = "Kiểm tra và hiển thị các sự kiện kiểm tra cho MediaWiki", events_test_MediaWiki_headers = "Type; Key; Kiểm tra tên và các giá trị; kết quả để phép thử", events_test_categ_Test_title = "Kiểm tra categ_Test: danh mục bằng một số ngôn ngữ", events_all_kinds_tests_title = "events.all_kinds_test() Kiểm tra: tất cả các loại sự kiện (err, wng, cat)", events_all_kinds_tests_headers = "nghệ thuật; chính; đối số, kết quả", events_add_cat_deprecated = "Chức năng lỗi thời trong mô-đun chính.", events_close_without_memo_err = "viewers.restore_configs(memo, where) không có memo trong mô-đun %1.", events_antiCrash_protect_err = "Hàm antiCrash() bảo vệ trang này khỏi sự sụp đổ hoàn toàn do lỗi nội bộ: %1.", } -- events.i18n.vi

-- These Module:Centralizer/I18N translations for viewers library update and complete Module:Centralizer translations. viewers.i18n = {} viewers.i18n.br = { -- Principaux textes, erreurs et catégories des outils viewers_test_no_values = "Test: sans valeurs", viewers_test_the_value_is_table = "Test: la valeur est une table", viewers_test_all_types_values = "Test: valeurs de tous types", viewers_Dropbox_label_Unwrap = "Dérouler/Enrouler", viewers_page_tests_title = "Tests et informations liées à cette page :", viewers_section_title_page = "Tests de cette page", viewers_section_title_module = "Tests de ce module", viewers_section_title_internal = "Tests internes", -- 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", viewers_section_title_library_lua_table = "Library:lua_table", viewers_section_title_library_mathroman = "Library:mathroman", viewers_section_title_library_modes = "Library:modes", viewers_section_title_library_versions = "Library:versions", viewers_section_title_library_wiewers = "Library:wiewers", viewers_section_title_is_missing = "Cette section manque de titre", viewers_dropdown_missing_title = "Titre manquant pour cette boite déroulante", -- Titres des tests viewers_page_tests_title = "Tests et informations liées à cette page :", viewers_module_tests_title = "Tests et informations liées à ce module :", viewers_internal_tests_title = "Tests internes de non régression :", viewers_tableView_default_headers = "A; B; C; D; E", viewers_tableView_tests_title = "tableview.new() Test: former un tableau avec lignes et colonnes.", viewers_tab_view_form_elem_detail = "détail = %1 | %2 | %3 | %4 | %5.", viewers_tableView_tests_err = "Erreur interne: tableview.new() échec anormal.", viewers_format_time_tests_title = "viewers.formatDate() Tests de codage et conversions de dates", viewers_parts_of_date_tests_title = "viewers.date_to_part() Tests de date vers jour, mois, année ou ère", viewers_simpleList_tests_title = "viewers.simple_list() Test: Trier une liste de mots sans répétition", viewers_save_restore_balance_title = "viewers.save_restore_balance_report() Test: sauver et restaurer, équilibre des configurations", viewers_save_restore_balance_headers = "i; où; enregistre; restaure; erreurs", } -- viewers.i18n.br viewers.i18n.de = { -- Haupttexte, Fehler und Kategorien von Werkzeugen viewers_test_no_values = "Test: ohne Werte", viewers_test_the_value_is_table = "Test: Der Wert ist eine Tabelle", viewers_test_all_types_values = "Test: Werte aller Arten", viewers_Dropbox_label_Unwrap = "Erweitern / Wrap", viewers_page_tests_title = "Tests und Informationen zu dieser Seite:", viewers_section_title_page = "Tests dieser Seite", viewers_section_title_module = "Tests dieses Moduls", viewers_section_title_internal = "Interne Tests", -- Ü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", viewers_section_title_library_lua_table = "Library:lua_table", viewers_section_title_library_mathroman = "Library:mathroman", viewers_section_title_library_modes = "Library:modes", viewers_section_title_library_versions = "Library:versions", viewers_section_title_library_wiewers = "Library:wiewers", viewers_section_title_is_missing = "Dieser Abschnitt fehlt der Titel", viewers_dropdown_missing_title = "Titel fehlt für diese Dropdown-Box", -- Titel der Tests viewers_page_tests_title = "Tests und Informationen zu dieser Seite:", viewers_module_tests_title = "Tests und Informationen zu diesem Modul:", viewers_internal_tests_title = "Interne Regressionstests:", viewers_tableView_default_headers = "A; B; C; D; E", viewers_tableView_tests_title = "tableview.new() Test: Bilden Sie eine Tabelle mit Zeilen und Spalten.", viewers_tab_view_form_elem_detail = "Detail = %1 | %2 | %3 | %4 | %5.", viewers_tableView_tests_err = "Interner Fehler: tableview.new() abnormaler Fehler.", viewers_format_time_tests_title = "viewers.formatDate() Codierungstests und Datumskonvertierungen", viewers_parts_of_date_tests_title = "viewers.date_to_part() Datum Tests zu Tag, Monat, Jahr oder Zeit", viewers_simpleList_tests_title = "viewers.simple_list() Test: Sortiere eine Liste von Wörtern ohne Wiederholung", viewers_save_restore_balance_title = "viewers.save_restore_balance_report() Test: Speichern und Wiederherstellen, Balance der Konfigurationen", viewers_save_restore_balance_headers = "i; wo; registrieren; wiederherzustellen; Fehler", } -- viewers.i18n.de viewers.i18n.en = { -- Main string, errors and categories of tools viewers_test_no_values = "Test: without values", viewers_test_the_value_is_table = "Test: the value is a table", viewers_test_all_types_values = "Test: values of all types", viewers_Dropbox_label_Unwrap = "Unwrap/Wrap", viewers_page_tests_title = "Testing and information related to this page:", viewers_section_title_page = "Tests of this page", viewers_section_title_module = "Tests of this module", viewers_section_title_internal = "Internal tests", -- 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", viewers_section_title_library_lua_table = "Library:lua_table", viewers_section_title_library_mathroman = "Library:mathroman", viewers_section_title_library_modes = "Library:modes", viewers_section_title_library_versions = "Library:versions", viewers_section_title_library_wiewers = "Library:wiewers", viewers_dropdown_missing_title = "Missing title for this drop_box", -- Titles of tests viewers_module_tests_title = "Testing and information related to this module:", viewers_internal_tests_title = "Internal regression tests:", viewers_tableView_default_headers = "A; B; C; D; E", viewers_tableView_tests_title = "tableview.new() Test: Formats a table with lines and columns.", viewers_tab_view_form_elem_detail = "detail = %1 | %2 | %3 | %4 | %5.", viewers_tableView_tests_err = "Internal error : tableview.new() abnormal fail.", viewers_format_time_tests_title = "viewers.formatDate() Tests of coding and conversion of dates", viewers_parts_of_date_tests_title = "viewers.date_to_part() Tests of date to day, month, year or era", viewers_simpleList_tests_title = "viewers.simple_list() Test: Sort a list of words without repetition", viewers_save_restore_balance_title = "viewers.save_restore_balance_report() Test: save and restore, balance of configurations", viewers_save_restore_balance_headers = "i;where;save;restore;errors", } -- viewers.i18n.en viewers.i18n.es = { -- Textos principales, errores y categorías de instrumentos viewers_test_no_values = "Prueba: sin valores", viewers_test_the_value_is_table = "Prueba: el valor es una tabla", viewers_test_all_types_values = "Prueba: valores de todos los tipos", viewers_Dropbox_label_Unwrap = "Desenvolver/Envolver", viewers_page_tests_title = "Pruebas y información relacionada con esta página:", viewers_section_title_page = "Pruebas de esta página", viewers_section_title_module = "Pruebas de esta módulo", viewers_section_title_internal = "Pruebas internas", -- 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", viewers_section_title_library_lua_table = "Library:lua_table", viewers_section_title_library_mathroman = "Library:mathroman", viewers_section_title_library_modes = "Library:modes", viewers_section_title_library_versions = "Library:versions", viewers_section_title_library_wiewers = "Library:wiewers", viewers_section_title_is_missing = "This section misses of title", viewers_dropdown_missing_title = "Falta el título para este drop_box", -- Titres des pruebas viewers_page_tests_title = "Pruebas y información relacionada con esta página:", viewers_module_tests_title = "Pruebas y información relacionada con esto módulo:", viewers_internal_tests_title = "Pruebas de no regresión internas:", viewers_tableView_default_headers = "A; B; C; D; E", viewers_tableView_tests_title = "tableview.new() Prueba: Formar una tabla con líneas y columnas.", viewers_tab_view_form_elem_detail = "detalle = %1 | %2 | %3 | %4 | %5.", viewers_tableView_tests_err = "Error interno: tableview.new() error anormal.", viewers_format_time_tests_title = "viewers.formatDate() Pruebas de codificación y conversión fechas", viewers_parts_of_date_tests_title = "viewers.date_to_part() Pruebas de fecha a día, mes, año o época", viewers_simpleList_tests_title = "viewers.simple_list() Prueba: Ordenar una lista de palabras sin repetición", viewers_save_restore_balance_title = "viewers.save_restore_balance_report() Prueba: guardar y restaurar, equilibrio de configuraciones", viewers_save_restore_balance_headers = "i; dónde; guardar; restaurar; errores", } -- viewers.i18n.es viewers.i18n.fr = { -- Principaux textes, erreurs et catégories des outils viewers_test_no_values = "Test: sans valeurs", viewers_test_the_value_is_table = "Test: la valeur est une table", viewers_test_all_types_values = "Test: valeurs de tous types", viewers_Dropbox_label_Unwrap = "Dérouler/Enrouler", viewers_page_tests_title = "Tests et informations liées à cette page :", viewers_section_title_page = "Tests de cette page", viewers_section_title_module = "Tests de ce module", viewers_section_title_internal = "Tests internes", -- 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", viewers_section_title_library_lua_table = "Library:lua_table", viewers_section_title_library_mathroman = "Library:mathroman", viewers_section_title_library_modes = "Library:modes", viewers_section_title_library_versions = "Library:versions", viewers_section_title_library_wiewers = "Library:wiewers", viewers_section_title_is_missing = "Cette section manque de titre", viewers_dropdown_missing_title = "Titre manquant pour cette boite déroulante", -- Titres des tests viewers_page_tests_title = "Tests et informations liées à cette page :", viewers_module_tests_title = "Tests et informations liées à ce module :", viewers_internal_tests_title = "Tests internes de non régression :", viewers_tableView_default_headers = "A; B; C; D; E", viewers_tableView_tests_title = "tableview.new() Test: former un tableau avec lignes et colonnes.", viewers_tab_view_form_elem_detail = "détail = %1 | %2 | %3 | %4 | %5.", viewers_tableView_tests_err = "Erreur interne: tableview.new() échec anormal.", viewers_format_time_tests_title = "viewers.formatDate() Tests de codage et conversions de dates", viewers_parts_of_date_tests_title = "viewers.date_to_part() Tests de date vers jour, mois, année ou ère", viewers_simpleList_tests_title = "viewers.simple_list() Test: Trier une liste de mots sans répétition", viewers_save_restore_balance_title = "viewers.save_restore_balance_report() Test: sauver et restaurer, équilibre des configurations", viewers_save_restore_balance_headers = "i; où; enregistre; restaure; erreurs", } -- viewers.i18n.fr

function viewers.is_in(word, text) -- The word is it in the text, even inside another word? local bug = "Erreur Lua dans Module:Centralizer-s-fr à la ligne 7444 : attempt to call field 'find' (a nil value)." local i = string.find(text or "", word or "", 1, true) return (i and true) end

function viewers.is_in_sp(word, text, sep) -- The word is it in the text, beetwen spaces or separators, not inside another word? sep = sep or " " -- default separator is space. But could be * ; , or even any string. if type(word) ~= "string" then word = "" end if type(text) ~= "string" then text = "" end local i = string.find(sep .. text .. sep, sep .. word .. sep, 1, true) if i then i = true else i = false end return i end

function viewers.is_def(x) -- x is defined or no. x est défini ou non return (type(x) == "string") and (x ~= "") and (x ~= " ") and (x ~= "nil") end

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)

function viewers.phab_task(task, comment) -- Forms a link to a Phabricator task. local t = "" -- example: "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 = "" .. 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.

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) .. " " .. tostring(val) .. " " .. ", " end

function viewers.tam(txt, val, sep) -- Formats an argument and its value, or mask it if nil. if not val then return "" end return viewers.ta(txt, val, sep) end

-- Fonctional styles in central modules. viewers.usual_colors = { -- Available usual fonctional styles for central modules and those using them. ["add"] = "blue", -- Usual fonctional style for add in blue; blue/yellow are more accessible, see T156048. ["delete"] = "#C0C000", -- Usual fonctional style for delete in yellow; blue/yellow are more accessible, see T156048. ["discreet"]= "#B0B0B0", -- Usual fonctional style for discreet in light grey. ["error"] = "#AA6688", -- Usual fonctional style for error in modified red. ["invoke"] = "#804020", -- Usual fonctional style for invoke args in brown. ["mask"] = "white", -- Usual fonctional style for mask standard in white. ["normal"] = "black", -- Usual fonctional style for other standard in black. ["warning"] = "#804020", -- Usual fonctional style for warnings in brown. ["wikidata"]= "green", -- Usual fonctional style for wikidata in green. } viewers.usual_colors_memo = "add delete discreet error invoke mask normal warning wikidata"

function viewers.usual_color(t, usual) -- Fonctional style for available usual cases. if type(usual) ~= "string" then usual = "normal" end local t = tostring(t) -- template style: ' usual ' -- template style local usual_in_style = '' .. t .. '' -- default style if viewers.usual_colors[usual] then -- Adapt the style of usual, if it exists. usual_in_style = '' .. t .. '' -- actual style end -- Style for add in blue; blue/yellow are more accessible, see T156048. return usual_in_style end -- function viewers.usual_color(t, usual)

viewers.styles_colors = "add delete discreet error invoke normal warning wikidata" viewers.styles_formats = "big bold small up" function viewers.styles(t, styles) -- Fonctional styles for usual cases. local t = tostring(t) local styles_split = mw.text.split(styles, "%s") for i, style in ipairs(styles_split) do if viewers.is_in_sp(style, viewers.styles_colors) then t = viewers.usual_color(t, style) end if viewers.is_in_sp(style, viewers.styles_formats) then if style == "big" then t = "" .. t .. "" end if style == "bold" then t = "" .. t .. "" end if style == "small" then t = "" .. t .. "" end if style == "up" then t = "<up>" .. t .. "</up>" end end end return t end -- function viewers.styles(t, opt)

-- These corresponding functions change the colors of a displayed text for available functional styles: function viewers.styles_color_add(t) return viewers.usual_color(t, "add") end

function viewers.styles_color_delete(t) return viewers.usual_color(t, "delete") end

function viewers.styles_color_discreet(t) return viewers.usual_color(t, "discreet") end --For attentive readers only. function viewers.styles_color_error(t) return viewers.usual_color(t, "error") end

function viewers.styles_color_colargs(t) return viewers.usual_color(t, "colargs") end

function viewers.styles_color_mask(t) return viewers.usual_color(t, "mask") end

function viewers.styles_color_normal(t) return viewers.usual_color(t, "normal") end

function viewers.styles_color_warning(t) return viewers.usual_color(t, "warning") end

function viewers.styles_color_wikidata(t) return viewers.usual_color(t, "wikidata") end -- Formats also functional styles for boxes

function viewers.styles_small_caps(t) -- Display a text in small-caps style. return '' .. t .. '' end

-- Extract a part of date following a pre-defined format which starts with separator function viewers.date_split(date, format) -- local dd, mmmm, yyyy, era = viewers.date_split(a.birthdate, " dd mmmm yyyy") local dd, mmmm, yyyy, era local format_split = mw.text.split(format, "%s") local split = mw.text.split(date, "%s") for i, date_part in ipairs(split) do if format_split[i] == "dd" then dd = tonumber(date_part) end if format_split[i] == "mmmm" then mmmm = date_part end if format_split[i] == "yyyy" then yyyy = tonumber(date_part) end if format_split[i] == "era" then era = date_part end end return dd, mmmm, yyyy, era end -- function viewers.date_split(date, format)

function viewers.date_to_part(date, part) -- Extracts a part of date following a pre-defined format which starts with separator -- local t, err = viewers.date_to_part(a.birthyear, " dd mmmm yyyy", "yyyy") part = part or "yyyy" local dd, mmmm, yyyy, era local found = false -- local err = "modes_date_to_part_not_found_err" if not found then dd, mmmm, yyyy, era = viewers.date_split(date, "dd mmmm yyyy") if dd and mmmm and yyyy and not era then found = true end end if not found then dd, mmmm, yyyy, era = viewers.date_split(date, "mmmm dd yyyy") if dd and mmmm and yyyy and not era then found = true end end if not found then dd, mmmm, yyyy, era = viewers.date_split(date, "yyyy era") if not dd and not mmmm and yyyy then if era == "BCE" then yyyy = - yyyy end found = true end end if not found then dd, mmmm, yyyy, era = viewers.date_split(date, "mmmm yyyy") if not dd and mmmm and yyyy and not era then -- modes_date_months_names = "January, February, March, April, May, June, July, August, September, October, November, December", -- modes_date_months_names = "Enero, Febrero, Marzo, Abril, Mayo, Junio​​, Julio, Agosto, Septiembre, Octubre, Noviembre, Diciembre", -- modes_date_months_names = "Janvier, Février, Mars, Avril, Mai, Juin, Juillet, Août, Septembre, Octobre, Novembre, Décembre", found = true end end if not found then dd, mmmm, yyyy, era = viewers.date_split(date, "yyyy") if not dd and not mmmm and yyyy and not era then found = true end end -- + cccc = roman number ? if found then if part == "yyyy" then return yyyy or "" end if part == "mmmm" then return mmmm or "" end if part == "dd" then return dd or "" end if part == "era" then return era or "" end end return "" -- tostring(dd)..tostring(mmmm)..tostring(yyyy)..tostring(era) -- A faire : Titus Livius (Q2039), format de dates : P569 = date of birth = 59 BCE, P570 = date of death = 17 -- Socrate (470-399 av. J.-C.). 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" versions.deprecated_function("mw.text.sortCommaList", "viewers.simple_list") return viewers.simple_list(list, sep1, sep2, sep3, sep4) end

function viewers.simple_list(list, sep1, sep2, sep3, sep4) -- Removes repeats in a string list with separators and can also sort them. -- sep1 is used in final list. sep1 to sep4 can be "sort" or "trim". local t = t -- t or if (type(t) ~= "string") then t = '\n* viewers.simple_list(list, sep1, sep2, sep3, sep4) : Removes repeats in a string list with separators and can also sort them' end local sort, trim = false, false if sep1 == "sort" then sep1 = "" ; sort = true end if sep2 == "sort" then sep2 = "" ; sort = true end if sep3 == "sort" then sep3 = "" ; sort = true end if sep4 == "sort" then sep4 = "" ; sort = true end if sep1 == "trim" then sep1 = "" ; trim = true end if sep2 == "trim" then sep2 = "" ; trim = true end if sep3 == "trim" then sep3 = "" ; trim = true end if sep4 == "trim" then sep4 = "" ; trim = true end if type(list) ~= "string" then list = "" end if type(sep1) ~= "string" then sep1 = "" end -- Default separators value if type(sep2) ~= "string" then sep2 = "" end if type(sep3) ~= "string" then sep3 = "" end if type(sep4) ~= "string" then sep4 = "" end -- Patterns: Dot (.) always matches all characters, including newlines. -- Patterns: Quantifiers (*, +, ?, and -) may only be applied to individual characters. if viewers.is_in(sep1, ".*+?-/") then sep1 = "%" .. sep1 end if viewers.is_in(sep2, ".*+?-/") then sep2 = "%" .. sep2 end if viewers.is_in(sep3, ".*+?-/") then sep3 = "%" .. sep3 end if viewers.is_in(sep4, ".*+?-/") then sep4 = "%" .. sep4 end local listtab = mw.text.split(list or "", sep1, true) -- names between commas local listtabOut = {} local listtabSingle = {} local list2 = "" for i, name in ipairs(listtab) do -- list all names, only one each, in alphabetic order if trim then name = mw.text.trim(name) end -- do not keep spaces inside each name if not listtabSingle[name] then listtabSingle[name] = name list2 = list2 .. name .. sep1 t = t .. viewers.ta("name", name) .. viewers.ta("list2", list2) end end if sort then table.sort(listtabSingle, function (a, b) return (a < b) end ) -- sort in alphabetic order end t = t .. " * list2 = " .. list2 .. " * " t = t .. string.sub( list2, 1, (-string.len(sep1)-1) ) -- without last sep1 or ; return t end -- function viewers.simple_list(list, sep1, sep2, sep3)

function viewers.simple_list_test(t) -- Tests repetitions in a list of strings with separators and can also sort them local memo = viewers.save_configs("viewers.simple_list_test") -- Save global configuration before eventual changes. local t = t -- t or if (type(t) ~= "string") then t = '\n* viewers.simple_list_test(t) : Tests repetitions in a list of strings with separators and can also sort them' end t = t .. "\n* Test viewers.simple_list(list, sep1, sep2, sep3): " t = t .. '\n* Remove repeats in a string list with separators. Can also sort.' local function simpleList_test1(t, input, sep1, sep2, sep3, sep4) local output = tostring( viewers.simple_list(input, sep1, sep2, sep3, sep4) ) t = t .. viewers.table_row() .. viewers.table_dat(viewers.value(input)) .. viewers.table_dat(viewers.value(sep1)) .. viewers.table_dat(viewers.value(sep2)) t = t .. viewers.table_dat(viewers.value(sep3)) .. viewers.table_dat(viewers.value(sep4)) .. viewers.table_dat(viewers.value(output)) return t end t = t .. viewers.table_head() .. viewers.table_col("input") .. viewers.table_col("sep1") .. viewers.table_col("sep2") .. viewers.table_col("sep3") .. viewers.table_col("sep4") .. viewers.table_col("output") t = simpleList_test1(t, "abc;def;abc", ";", "-", "|") t = simpleList_test1(t, "xyz;def;abc", ";", "sort") t = simpleList_test1(t, "abc-def=abc", "-", "=") t = simpleList_test1(t, "abc - def = abc", "-", "=", "sort") t = simpleList_test1(t, "abc - def = abc", "-", "=", "sort", "trim") t = simpleList_test1(t, ";;", ";", ";", ",") t = simpleList_test1(t, "abc/def;abc", ";", "/") t = simpleList_test1(t, "abc;def/abc/def;abc;def;abc", ";", "/", "-") t = simpleList_test1(t, "abc;def;abc", ";", ";", "") t = t .. viewers.table_end() viewers.restore_configs(memo, "viewers.simple_list_test") -- Restore global configurations after eventual changes. return t end -- viewers.simple_list_test(t) -- for _test1 search also _test1 simpleList_test1 date_to_part_test1

function viewers.form_one_case(case) -- Convert a case from test_group to rowGroup. case.res1 = case.result[1] or "res1" -- DEBUG : mathroman.int2roman() can fail without blocking page. case.err2 = case.result[case.errorsKey] or "err2" -- DEBUG : mathroman.int2roman() can fail without blocking page. case.errors = case.errors or status.OK case.errors = viewers.ta("case.res1", case.res1) .. viewers.ta("case.err2", case.err2) .. viewers.ta("case.errors", case.errors) -- headers = "case.name; args{}; expect{}; result{}; errors in result{} from expect{}", -- OK or error/s return { case.name, lua_table.rough_view(case.args), lua_table.rough_view(case.expect), lua_table.rough_view(case.result), case.errors } end -- errors in result

function viewers.day_to_stamp(jj, mm, aaaa) local t = "@" .. tostring( jj*86400 + mm*30*86400 + (aaaa-1970)*31556926 ) return t end

function viewers.day_to_UTC(jj, mm, aaaa) jj = tonumber(jj) if not jj then jj = "2" else jj = string.sub("0000" .. tostring(jj), -2, -1 ) end mm = tonumber(mm) if not mm then mm = "2" else mm = string.sub("0000" .. tostring(mm), -2, -1 ) end aaaa = tonumber(aaaa) if not aaaa then aaaa = "2000" else aaaa = string.sub("0000" .. tostring(aaaa), -4, -1 ) end return aaaa .. "-" .. mm .. "-" .. jj end

function viewers.parts_of_date_tests(t) local memo = viewers.save_configs("viewers.parts_of_date_tests") -- Save global configuration before eventual changes. local function date_to_part_test1(t, nom, date, part) local t = t .. viewers.table_row() .. viewers.table_dat(nom) .. viewers.table_dat(date) .. viewers.table_dat(part) .. viewers.table_dat(tostring(viewers.date_to_part(date, part))) return t end local t = t -- t or if (type(t) ~= "string") then t = '\n* viewers.simple_list_test(t) : Tests repetitions in a list of strings with separators and can also sort them' end t = t .. "\n* date_to_part :" t = t .. "\n* Verify each value of part of date:" t = t .. viewers.table_head() .. viewers.table_col("Example") .. viewers.table_col("date") .. viewers.table_col("part") .. viewers.table_col("value") t = date_to_part_test1(t, "Socrate birth", "470 BCE", "era") t = date_to_part_test1(t, "Tite-Live birth", "59 BCE", "yyyy") t = date_to_part_test1(t, "Tite-Live death", "17", "yyyy") t = date_to_part_test1(t, "empty", "", "yyyy") t = date_to_part_test1(t, "Revolution", "14 July 1789", "mmmm") t = date_to_part_test1(t, "Walk on Moon", "20 July 1969", " ") t = date_to_part_test1(t, "English date", "July 20 1969", "yyyy") t = date_to_part_test1(t, "English date", "July 20 1969", "mmmm") t = date_to_part_test1(t, "Nelson Mandela birth", "July 1918", "yyyy") t = date_to_part_test1(t, "Nelson Mandela death", "5 Decembre 2013", "dd") t = t .. viewers.table_end() -- see https://fr.wikipedia.org/wiki/Discussion:ISO_8601#Av._J.C._:_contradiction_avec_l.27article_anglais -- see https://fr.wikipedia.org/w/index.php?title=ISO_8601&diff=next&oldid=12449725 -- see ISO 8601 time format like : 1977-04-22T01:00:00-05:00 (5 heures de décalage) = 1977-04-22T06:00:00Z local time -- os.date( format, time ) get datetime viewers.restore_configs(memo, "viewers.parts_of_date_tests") -- Restore global configurations after eventual changes. return t end -- function viewers.parts_of_date_tests(t)

function viewers.form_image(file, size, options) -- Formats an image from its file name, to the size in pixels if type(file) ~= "string" then file = "Victor Hugo.jpg" end if not ( (type(size) == "string") or (type(size) == "number") ) then size = "15" end if type(options) ~= "string" then options = "" end return '' .. options .. '' -- options must begin with "|" end -- local image = viewers.form_image(file, size)

function viewers.trans9vars(translations, ref, ...) -- Replace %1 to %9 by tostring( argN ) from arguments, without any ambiguity in any string. local t, S9, repl, val, charN = "", "", "", "", "" if type(ref) ~= "string" then ref = "a;b;c;d;e;f;g" end if type(translations) ~= "table" then t = viewers.form9tests( tostring(ref), ...) return t end if type(translations[ref]) == "string" then ref = translations[ref] end args = {...} t = ref if lua_table.level_count(args) > 0 then local n = 1 for n = 9, 1, -1 do S9 = tostring(n) charN = string.find(t, "%".. S9, 1, true) if charN then -- If reference has %0 to %9 repl = tostring( args[n] or "" ) t = string.sub(t, 1, charN - 1) .. repl .. string.sub(t, charN + string.len( "%".. S9 ) ) end end end t = t .. viewers.ta("main version", tostring(version) ) -- COCO return t end -- function viewers.trans9vars(translations, key, ...) -- main_module = main_module or versions.main_module =

function viewers.form9tests(ref, ...) -- Formats reference_key;v1;v2;v3;... for tests. local t = tostring(ref) for i, var in pairs( { ... } ) do if var then t = t .. ";" .. viewers.value(var) end -- tostring() or viewers.value() ? end return t 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 if type(ref) ~= "string" then t = viewers.form9tests("form9en", ...) elseif type(versions.memo_i18n.en[ref] == "string") then t = viewers.trans9vars(versions.memo_i18n.en, ref, ...) else t = viewers.form9tests(ref, ...) end -- Default text to help to locate a bug return t end -- function viewers.form9en(ref, ...)

function viewers.form9content(ref, ...) -- replace %1 to %9 by v1 to v9 in the content translation of ref, else in ref if not langs.main_i18n_complete then return "" end -- Mask or Unmask all views to avoid failures. local form, n = "", 0 if type(ref) ~= "string" then form = viewers.form9tests("form9content", ...) end if (type(langs.content_translations) == "table") then -- Only after versions.bind_reverse_i18n_translations() if langs.content_translations[ref] then -- Normal case form = form .. viewers.trans9vars(langs.content_translations, ref, ...) elseif versions.memo_i18n.en[ref] then -- try english translation in case another lang mises of translation form = form .. viewers.trans9vars(versions.memo_i18n.en, ref, ...) else form = form .. viewers.form9tests(ref, ...) end else form = form .. viewers.form9tests(ref, ...) end return form end -- function viewers.form9content(ref, ...)

function viewers.form9page(ref, ...) -- Replace %1 to %9 by tostring( argN ) from arguments, without any ambiguity in any string. if not langs.main_i18n_complete then return "" end -- Mask or Unmask all views to avoid failures. local form, n = "", 0 if type(ref) ~= "string" then form = viewers.form9tests("form9page", ...) end local form, n = "", 0 if not langs.main_i18n_complete then return "" end -- Mask or Unmask all views to avoid failures. if (type(langs.page_translations) == "table") then -- Only after versions.bind_reverse_i18n_translations() if langs.page_translations[ref] then -- Normal case form = form .. viewers.trans9vars(langs.page_translations, ref, ...) elseif versions.memo_i18n.en[ref] then -- try english translation in case another lang mises of translation form = form .. viewers.trans9vars(versions.memo_i18n.en, ref, ...) else form = form .. viewers.form9tests(ref, ...) end else form = form .. viewers.form9tests(ref, ...) end return form end -- function viewers.form9page(ref, ...)

function viewers.form9user(ref, ...) -- Replace %1 to %9 by arguments, without any ambiguity in any string. if not langs.main_i18n_complete then return "" end -- Avoid to fail in init phase. -- langs.main_i18n = langs.main_i18n or versions.main_i18n or {} -- versions.main_i18n = langs.main_i18n -- local i18n = i18n or langs.main_i18n or versions.main_i18n or versions.memo_i18n local ref = ref local t, trans, n = "", "", 0 if type(ref) ~= "string" then ref = viewers.form9tests(ref, ...) end if (type(langs.user_translations) == "table") then -- Normal translation if langs.user_translations[ref] then trans = langs.user_translations[ref] end -- Normal ref to translate t = viewers.trans9vars(langs.user_translations, ref, ...) else t = viewers.form9tests(ref, ...) end -- Default text to help to locate a bug return t end -- function viewers.form9user(ref, ...)

function viewers.form9user_test(t) -- Tests of viewers.form9user_test(). local memo = viewers.save_configs("viewers.form9user_test") -- Save global configuration before eventual changes. local t = t -- t or if (type(t) ~= "string") then t = '\n* viewers.simple_list_test(t) : Tests repetitions in a list of strings with separators and can also sort them' end t = t .. "\n* viewers.form9user_test(t, ref, ...):" local tab_view = { -- Group datas and options for a table view with lines and columns. title_memo = "viewers.form9user_test(t) -- Tests of viewers.form9user_test()", test_group = { { "translate_form9user_no_translation", }, { "viewers_test_no_values", }, { "translate_form9user_a_value_is_table", {}, }, { "langs_form9user_all_types_values", "abc", 4, nil, function(x) end, { 55, "xyz" }, }, { "replace: abc%1efg%2ijk", "D", "H", }, { "repeat: a=%1 b=%2 c=%1 d=%2", "1", "2", }, { "altern: 1%13%25", "2", "4", }, { "list: %0<%1<%2<%3<%4<%5<%6<%7<%8<%9", "00", "11", "22", "33", "44", "55", "66", "77", "88", "99", }, { "mix: %1, %5, %2, %4, %3, ", "A", "B", "C", "D", "E", }, { "missing args: yes=%1 no=%5 no=%9 yes=%2", "args[1]", "args[2]", }, { "MATRIX 4 * 5
" .. "{ %1%5, %1%6, %1%7, %1%8, %1%9 }
" .. "{ %2%5, %2%6, %2%7, %2%8, %2%9 }
" .. "{ %3%5, %3%6, %3%7, %3%8, %3%9 }
" .. "{ %4%5, %4%6, %4%7, %4%8, %4%9 }
", "a", "b", "c", "d", "1", "2", "3", "4", "5", }, }, headers_class = "wikitable alternative center sortable", rowGroup = {}, -- track_on == "details", convert function tab_view.form_one_case( to form_one_case = function( } function tab_view.form_one_case(case) -- Convert a case from test_group to rowGroup. local ref = case[1] local form9user, t9 = viewers.form9user( lua_table.to_list(case) ) return { ref, form9user, } end t = t .. tableview.new(tab_view) -- Runs tests cases and formats a table view with lines and columns. viewers.restore_configs(memo, "viewers.form9user_test") -- Restore global configurations after eventual changes. return t end -- function viewers.form9user_test(t)

function viewers.form_main_version(main_versions) if (type(main_versions) ~= "table") then main_versions = versions.main_versions end if (type(main_versions) ~= "table") then main_versions = { versionName = "versionName", versionNumber = "0.0", } end local t = "" if type(main_versions) == "table" then t = main_versions.versionName .. " " .. main_versions.versionNumber .. ", " end return t end

function viewers.discreet_main_version(main_versions) return viewers.styles_color_discreet( viewers.form_main_version(main_versions) ) end

function viewers.doc_section(selector, section, style, mask_sections) -- Begin of section in viewers.doc_page(), viewers.doc_module()... local t = "" local selector, section, style = selector, section, style section = viewers.form9user(section) -- like viewers_section_title_page or viewers_section_title_internal function viewers.form9user( if mask_sections then return t end if selector == "never" then return t end 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 ) if (type(opt) == "string") and (type(drop_box.css_options[opt]) == "string") then val = drop_box.css_options[opt] end -- val can be nil for cssview, we admit it. return val end dh = drop_box.dh

function drop_box.html(title, content_or_func) -- Builds the drop box at the html level. local memo = viewers.save_configs("drop_box.html") -- Save global configuration before eventual changes. local t = "\n* drop_box.html() -- Builds the drop box at the html level." local drop_box_html = drop_box_html_start .. drop_box_html_medium .. drop_box_html_end .. drop_box_look_like t = t .. drop_box_html_start .. drop_box_html_content viewers.restore_configs(memo, "drop_box.html") -- Restore global configurations after eventual changes. return drop_box_html_start end -- t = t .. drop_box.html(title, content) -- Builds the drop box at the html level.

function viewers.drop_title() -- Support desk title of the docDropbox of the edit box. local t, strings_c, tables_c, strs_on_tabs, subnames = langs.i18n_sub_counts("langs.main_i18n", "langs_main_i18n_languages_count", "user") local report_main_discreet = viewers.styles_color_discreet( viewers.form_main_version(main_versions) ) local title = viewers.form9user("versions_support_desk_title", report_main_discreet, strs_on_tabs, tables_c) -- "Support desk for %1 : %2 translations in %3 languages" return title end -- function viewers.drop_title()

drop_box.css_options = { -- Conventional CSS parameters : See -- https://en.wikisource.org/wiki/Template:drop_box#Parameters ["cssview"] = false, -- cssview : display values of options ["bg1"] = "#FFFFFF", -- bg1 : the background-color for the header ["fs1"] = "100%", -- font-size: 100%; ["fw1"] = "left", -- fw1 : the font-weight for the heading ["ta1"] = "left", -- ta1 : the text-align for the heading ["tc1"] = "black", -- tc1 : the text-color for the heading -- ["bg2"] = "#FFFFFF", -- bg2 : the background-color for the content ["fs2"] = "100%", -- font-size: 100%; ["fw2"] = "left", -- fw2 : the font-weight for the body ["ta2"] = "left", -- ta2 : the text-align for the body ["tc2"] = "black", -- tc2 : the text-color for the body }

-- t = drop_box.form(dropit.title, dropit.content, dropit) function drop_box.form(title, content, dropit) -- Easy drop_box style from a list of named options. local memo = viewers.save_configs("drop_box.form") -- Save global configuration before eventual changes. local dropit = mw.clone(dropit) -- Save global configuration before eventual changes. local t = "\n* drop_box.form:" -- if type(content) == "function" then content = ( content(title, content, dropit) ) end -- and use it as content form function t = t .. viewers.ta("title", tostring(title) ) t = t .. viewers.ta("content", tostring(content) ) t = t .. viewers.ta("dropit", tostring(dropit) ) if type(title) == "function" then title = title() -- function viewers.drop_title() elseif type(title) ~= "string" then title = "viewers_dropdown_missing_title" end title = viewers.form9user(title) local dropit = dropit or {} t = t .. viewers.ta("\n* title", tostring(title) ) t = t .. viewers.ta("#dropit", lua_table.level_count(dropit) ) local opt = mw.clone(drop_box.css_options) -- Save global configuration before eventual changes. dropit = { -- Conventional css parameters : from -- https://en.wikisource.org/wiki/Template:drop_box#Parameters image = nil, cssview = dropit.cssview, -- cssview : display values of options fw1 = dropit.fw1 or opt.fw1, -- "left", -- fw1 : the font-weight for the heading fw2 = dropit.fw2 or opt.fw2, -- "left", -- fw2 : the font-weight for the body fs1 = dropit.fs1 or opt.fs1, -- "100%", -- font-size: 100%; fs2 = dropit.fs2 or opt.fs2, -- "100%", -- font-size: 100%; bg1 = dropit.bg1 or opt.bg1, -- "#FFFFFF", -- bg1 : the background-color for the heading bg2 = dropit.bg2 or opt.bg2, -- "#FFFFFF", -- bg2 : the back.clicground-color for the body ta1 = dropit.ta1 or opt.ta1, -- "left", -- ta1 : the text-align for the heading ta2 = dropit.ta2 or opt.ta2, -- "left", -- ta2 : the text-align for the body float = dropit.float or opt.float, -- "none", -- float : should the box be floated? (left, right, or none) width = dropit.width or opt.width, -- "99%", -- width : the width of the box, e.g. 33% border_radius = dropit.border_radius or opt.border_radius, -- "0px 0px 0px 0px", -- border-radius: "15px 50px 30px 5px" : add rounded corners to an element. style = dropit.style or opt.style, -- "0px 0px 0px 0px", -- style : HTML/CSS affectionados only: any other css style arguments for the whole box

--