Gaa na ọdịnaya

Module:Lang

Shí Wikipedia, njikotá édémédé nke onyobulạ
Mmeghari kemgbe 12:32, 31 Ọktoba 2017 si n'aka Trappist the monk (ṅkátá | mmetara)
(ndịịche) ← Orübà di kwa nke ichié | Orübà nke ubwa (ndịịche) | Orübà di kwa ohúrù → (ndịịche)

Lua error in Module:Lua_banner at line 113: attempt to index field 'edit' (a nil value).

This module exists primarily to provide correct HTML markup for non–English language text where that text is used in the English Wikipedia. It has a secondary purpose of providing correct visual rendering for this non-English text. The module was developed to consolidate processing for {{lang}}, {{langx}}, and {{transliteration}} templates into a single source and to use a clearly defined data set extracted from international standards. It provides error checking and reporting to ensure that the HTML rendered is correct for browsers and screen readers.

Other templates that get language name support from this module are:

Data set

The data set is specified in Module:Lang/data and its included data modules:

The data set also includes supplementary data modules:

Testcases

Tracking categories

See also

MoS on foreign words:

  • Script error: No such module "Section link".

--[[
This is an experiment to see what is required to consolodate all of the myriad {{lang-xx}} templates
and their subtemplates into a single module with a data table
]]

require('Module:No globals');
local getArgs = require('Module:Arguments').getArgs;

local p = {};


--[=[-------------------------< L A N G >----------------------------------------------------------------------

{{lang-es}} has parameters:
{{{1}}} text - required
{{{link}}} or {{{links}}} defaults to 'yes'
{{{lit}}} literal translation

{{language with name}} has parameters:
{{{1}}} iso language code - required
{{{2}}} language name in English - superfluous?
{{{3}}} text - required
{{{4}}} or {{{lit}}} literal translation
{{{link}}} or {{{links}}} set to 'no' disables '{{{2}} language' wikilinks
{{{rtl}}} passed through to {{lang}}
{{{nocat}}} passed through to {{lang}}

{{lang}} has parameters:
{{{1}}} iso language code - required
{{{2}}} text - required
{{{rtl}}} if set to any value, set dir="rtl" attribute and inserts &lrm; after the </span> tag
{{{nocat}}} if set to any value, disables categorization

How it works now:
	1. {{lang-es}} receives text as {{{1}}} to which it adds italic markup, sets |links to {{{link}}} or {{{links}}} or yes, sets |lit to {{{lit}}}, and calls {{language with name}}.  {{{rtl}}} ignored for this example
	2. {{language with name}} renders [[Spanish language|Spanish]] ({{{links}}} not set) or Spanish ({{{links}}} set) and calls {{lang}}
	3. {{lang}} wraps the text in the <span lang="es">text</span> and adds categorization

]=]

function p.Lang (frame)
	local args = getArgs(frame);
end

return p;