Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

--[[

 __  __           _       _        ____                      _       _   _             
|  \/  | ___   __| |_   _| | ___ _|  _ \  ___  ___  ___ _ __(_)_ __ | |_(_) ___  _ __  
| |\/| |/ _ \ / _` | | | | |/ _ (_) | | |/ _ \/ __|/ __| '__| | '_ \| __| |/ _ \| '_ \ 
| |  | | (_) | (_| | |_| | |  __/_| |_| |  __/\__ \ (__| |  | | |_) | |_| | (_) | | | |
|_|  |_|\___/ \__,_|\__,_|_|\___(_)____/ \___||___/\___|_|  |_| .__/ \__|_|\___/|_| |_|
                                                              |_|                      

Description is a module implementing functionality of Lua error: bad argument #1 to 'isKnownLanguageTag' (string expected, got nil).

template, which is used by

,

and other language templates.

Authors and maintainers:

  • User:Jarekt

]]

local core = require('Module:Core') local p = {}


local function missing_text_error(args) -- Empty text field -> display error message and add maintenance category -- Template:Description/i18n local cat = 'Category:Language templates with no text displayed' local msg = core.formatMessage('I18n/DescriptionError.tab', 'missing text', args.user_lang) local frame = mw.getCurrentFrame() msg = mw.html.create('span'):addClass("error"):wikitext(msg) msg = '[' .. frame:callParserFunction{ name = 'fullurl', args={cat} } .. tostring(msg) .. ']' msg = mw.html.create('span'):addClass("plainlinks"):wikitext(msg) desc = core.langWrapper(args.text_lang, tostring(msg), args) local namespace = mw.title.getCurrentTitle().namespace local LUT = {[0]=1, [6]=1, [10]=1, [14]=1, [100]=1, [106]=1} if LUT[namespace]==1 then desc = desc .. '' .. cat .. '' end return desc end


function p.description(frame) local args = core.getArgs(frame) args.user_lang = args.user_lang or args.lang -- core.getArgs sets args.lang if args.text == nil then -- if no string than add error message and a category return missing_text_error(args) else return core.langWrapper(args.text_lang, args.text, args) end end

return p

Adds language name, in native language (autonym), and colon in front of the text in that language. Also adds machine-readable tags identifying the text as being in that language.

The template automatically sets the following categories:

Usage

{{Description |hover= }}

Template parameters

ParameterDescriptionDefaultStatus
hover
3
name
hover text 1description text to displayemptyrequired
lang_namelanguage nameName of the language in that language. This parameter is mostly needed if language code in the parameter 1 is not supported by wikimedia software, or if the language name in front of the text is wrong otherwise.emptyoptional
ext
5
extension textextension text shown after the language name before colon (optional, default is empty)(empty)optional
inlineinlineoptional boolean, false by default. When set to "true" (or "1", "yes", "on") , forces the template to be displayed inline, so that it does not break the current paragraph (i.e. that makes possible to put several descriptions side by side on a single line)emptyoptional

Additional information

The template is intended to be used in the following namespaces: no namespace specified

The template is intended to be used by the following user groups: no user group specified

See also

== Localization ==

Add translations to Data:I18n/DescriptionError.tab

Cookies help us deliver our services. By using our services, you agree to our use of cookies.