Module:TNTTools/doc
Appearance
![]() | This is a documentation subpage for Module:TNTTools. It may contain usage information, categories and other content that is not part of the original module page. |
This module is being discussed in accordance with Wikipedia's deletion policy. Help reach a consensus at its entry.
Maintenance use only: 1. Edit the TfD log to create the discussion entry. 2. Please consider notifying the author(s) by placing {{subst:TfD notice|TNTTools/doc|module=yes}} ~~~~ on their talk page(s). |
Contains functions linked to Module:TNT, which at the same time make calls to multilingual tables, located in Commons, for the creation of modules and multilingual templates. The Module:SimpleArgs, designed to create multilingual modules, uses these tables for error messages.
TNTTools has:
- Question functions: with boolean or numerical indexed return. To be called from other modules or from templates. With:
- Case sensitive option.
- Possibility of more than one translated text value (where each value is separated by "|").
- To put aside write, adding "I18n/" as a prefix and ".tab" extension as a suffix for the table names.
For example, with a parameter that has two or more meanings (or in English and localized language):
local p = {}
local SA = require "Module:SimpleArgs"
local TNTT = require "Module:TNTTools"
local function I18nStrTab (S)
return TNTT.TabTransMT ('TableName',S)
--in this case 'P_Action' from 'II18n/TableName.tab' contains 'action' and 'function' like this 'action|function'
end
function p.main (frame)
args = SA.GetArgs (frame)
local action = SA.SArgs.GetStrFromArgs (args, I18nStrTab('P_Action'))
--title will take the value from the parameter |action= or |function=
...
end
return p
Module:ArgsTNT, designed to create multilingual templates, allows get parameter values (passed from the frame) with several keys for the same parameter.