Module:Shortcut/config: Difference between revisions
Jump to navigation
Jump to search
en>Mr. Stradivarius create config module for Module:Shortcut |
en>Mr. Stradivarius add error messages and an error category |
||
Line 4: | Line 4: | ||
-- The heading at the top of the shortcut box. It accepts the following parameter: | -- The heading at the top of the shortcut box. It accepts the following parameter: | ||
-- $1 - the total number of shortcuts. | -- $1 - the total number of shortcuts. (required) | ||
['shortcut-heading'] = '[[Wikipedia:Shortcut|{{PLURAL:$1|Shortcut|Shortcuts}}]]:', | ['shortcut-heading'] = '[[Wikipedia:Shortcut|{{PLURAL:$1|Shortcut|Shortcuts}}]]:', | ||
-- The error message to display when a shortcut is invalid (is not a string, or | |||
-- is the blank string). It accepts the following parameter: | |||
-- $1 - the number of the shortcut in the argument list. (required) | |||
['invalid-shortcut-error'] = 'shortcut #$1 was invalid (shortcuts must be ' .. | |||
'strings of at least one character in length)', | |||
-- The error message to display when no shortcuts or other displayable content | |||
-- were specified. (required) | |||
['no-content-error'] = 'Error: no shortcuts were specified and the ' .. | |||
mw.text.nowiki('|msg=') .. | |||
' parameter was not set.', | |||
-- A category to add when the no-content-error message is displayed. (optional) | |||
['no-content-error-category'] = 'Shortcut templates with missing parameters', | |||
-- The error category to add if the shortcut listed in the first parameter | -- The error category to add if the shortcut listed in the first parameter | ||
-- doesn't exist. | -- doesn't exist. (optional) | ||
['first-parameter-error-category'] = 'Wikipedia shortcut box first parameter needs fixing', | ['first-parameter-error-category'] = 'Wikipedia shortcut box first parameter needs fixing', | ||
} | } |
Revision as of 12:18, 17 December 2014
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
This Lua module is used on approximately 22,000 pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them. |
-- This module holds configuration data for [[Module:Shortcut]].
return {
-- The heading at the top of the shortcut box. It accepts the following parameter:
-- $1 - the total number of shortcuts. (required)
['shortcut-heading'] = '[[Wikipedia:Shortcut|{{PLURAL:$1|Shortcut|Shortcuts}}]]:',
-- The error message to display when a shortcut is invalid (is not a string, or
-- is the blank string). It accepts the following parameter:
-- $1 - the number of the shortcut in the argument list. (required)
['invalid-shortcut-error'] = 'shortcut #$1 was invalid (shortcuts must be ' ..
'strings of at least one character in length)',
-- The error message to display when no shortcuts or other displayable content
-- were specified. (required)
['no-content-error'] = 'Error: no shortcuts were specified and the ' ..
mw.text.nowiki('|msg=') ..
' parameter was not set.',
-- A category to add when the no-content-error message is displayed. (optional)
['no-content-error-category'] = 'Shortcut templates with missing parameters',
-- The error category to add if the shortcut listed in the first parameter
-- doesn't exist. (optional)
['first-parameter-error-category'] = 'Wikipedia shortcut box first parameter needs fixing',
}