<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://base.transformap.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ALinguistic</id>
		<title>Module:Linguistic - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://base.transformap.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ALinguistic"/>
		<link rel="alternate" type="text/html" href="https://base.transformap.co/index.php?title=Module:Linguistic&amp;action=history"/>
		<updated>2026-05-07T17:34:08Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.27.0-rc.1</generator>

	<entry>
		<id>https://base.transformap.co/index.php?title=Module:Linguistic&amp;diff=3666&amp;oldid=prev</id>
		<title>Michael: Created page with &quot;-- some simple internationalization that can be called by other modules  local p = {} local f = require('Module:Fallback') local i18n = mw.loadData('Module:I18n/linguistic')...&quot;</title>
		<link rel="alternate" type="text/html" href="https://base.transformap.co/index.php?title=Module:Linguistic&amp;diff=3666&amp;oldid=prev"/>
				<updated>2016-12-09T09:28:46Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;-- some simple internationalization that can be called by other modules  local p = {} local f = require(&amp;#039;Module:Fallback&amp;#039;) local i18n = mw.loadData(&amp;#039;Module:I18n/linguistic&amp;#039;)...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- some simple internationalization that can be called by other modules&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
local f = require('Module:Fallback')&lt;br /&gt;
local i18n = mw.loadData('Module:I18n/linguistic')&lt;br /&gt;
&lt;br /&gt;
local function getText(msg, lang)&lt;br /&gt;
	return f._langSwitch(i18n[msg], lang)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local vowels = 'aeiouyąăẵằẳặȃắâẫấầẩậãäǟāáàȁǎảẚåǻḁạǡæǣǽĕȇêễếềểệḙẽḛëēḕéḗèȅěẻẹęȩḝǝĭȋîĩḭïḯīíìȉǐỉịįıŏȏôỗốồổộõṏṍöōṑóṓòȍǒỏọǫǭơỡớờởợøǿŭȗûṷũṻṹṵüǖǘǜǚṳūúùȕǔủůụųưữứừửựŷỹÿȳýỳỷẙỵ'&lt;br /&gt;
&lt;br /&gt;
local function wordor(lang)&lt;br /&gt;
	return getText('or_conj', lang)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function comma(lang)&lt;br /&gt;
	return getText(&amp;quot;comma&amp;quot;, lang)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function citation_comma(lang)&lt;br /&gt;
	return getText(&amp;quot;citation_comma&amp;quot;, lang)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.fullstop(lang)&lt;br /&gt;
	return getText(&amp;quot;full_stop&amp;quot;, lang)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.colon(lang)&lt;br /&gt;
	return getText(&amp;quot;colon&amp;quot;, lang)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function wordand(lang)&lt;br /&gt;
	return getText(&amp;quot;and_conj&amp;quot;, lang)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function wordsep(lang) -- default separator between words&lt;br /&gt;
	return getText(&amp;quot;word_separator&amp;quot;, lang)&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
local function isin(str, pattern)&lt;br /&gt;
	return str and pattern and mw.ustring.find(str, pattern, 1, true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function langisin(str, lang)&lt;br /&gt;
	return isin(str, lang .. ' ') -- space is necessary to avoid false positives like zh in zh-hans&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function processgender(str)&lt;br /&gt;
	local t = {	&lt;br /&gt;
		f = 'feminine',&lt;br /&gt;
		fem = 'feminine',&lt;br /&gt;
		feminine = 'feminine',&lt;br /&gt;
		m = 'masculine',&lt;br /&gt;
		masc = 'masculine',&lt;br /&gt;
		masculine = 'masculine',&lt;br /&gt;
		n = 'neutral',&lt;br /&gt;
		neutral = 'neutral',&lt;br /&gt;
	}&lt;br /&gt;
	return t[str] or 'masculine'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function processnumber(str)&lt;br /&gt;
	if str == 'p' or str == 'plural' then&lt;br /&gt;
		return 'plural'&lt;br /&gt;
	else&lt;br /&gt;
		return 'singular'&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.vowelfirst(str)&lt;br /&gt;
	return str and isin(vowels, str[1])&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.inparentheses(str, lang)&lt;br /&gt;
	--todo: define language with exotic parentheses&lt;br /&gt;
	if str == '' then&lt;br /&gt;
		return str&lt;br /&gt;
	else&lt;br /&gt;
		return ' (' .. str .. ')'&lt;br /&gt;
		-- needs internationalization.&lt;br /&gt;
		-- Needs leading space in English because as some languages do not use it, it is part of the formatting&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.of(word, lang, raw, gender, number, determiner) -- rough translation of &amp;quot;of&amp;quot; in various languages&lt;br /&gt;
-- note that the cases when on &amp;quot;of&amp;quot; is employed varies a lot among languages, so it is more prudent to call this from lang specific function only&lt;br /&gt;
	if not raw then&lt;br /&gt;
		raw = word&lt;br /&gt;
	end&lt;br /&gt;
	gender = processgender(gender)&lt;br /&gt;
	number = processnumber(number)&lt;br /&gt;
	-- raw is the string without the Wikiformatting so that it correctly analyses the string that is [[:fr:Italie|Italie]] -&amp;gt; 'italie'&lt;br /&gt;
	-- any way to automate this ?&lt;br /&gt;
	&lt;br /&gt;
	-- todo: ca to replace Template:Of/ca&lt;br /&gt;
	&lt;br /&gt;
	if lang == 'fr' then&lt;br /&gt;
		if number == 'plural' then&lt;br /&gt;
			return 'des ' .. word&lt;br /&gt;
		elseif p.vowelfirst(raw) then&lt;br /&gt;
			return 'de l\'' .. word&lt;br /&gt;
		elseif gender == 'feminine' then&lt;br /&gt;
			return 'de la ' .. word&lt;br /&gt;
		elseif derterminer then&lt;br /&gt;
			return 'du ' .. word&lt;br /&gt;
		else&lt;br /&gt;
			return 'de ' .. word&lt;br /&gt;
		end&lt;br /&gt;
	end	&lt;br /&gt;
	return raw&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.noungroup(noun, adj, lang)&lt;br /&gt;
	if not noun or noun == '' then&lt;br /&gt;
		return nil -- not '' so that it is not counted as a string by mw.listToText&lt;br /&gt;
	end&lt;br /&gt;
	if not adj or adj == '' then&lt;br /&gt;
		return noun&lt;br /&gt;
	end&lt;br /&gt;
	-- adjective before the noun&lt;br /&gt;
	if langisin('cs de de-at de-ch en en-ca en-gb pl sk zh zh-cn zh-hans zh-hant zh-my zh-sg zh-tw ', lang) then&lt;br /&gt;
		return adj .. wordsep(lang) .. noun&lt;br /&gt;
	-- adjective after the noun&lt;br /&gt;
	elseif langisin('fr fr-ca es it') then&lt;br /&gt;
		return noun .. wordsep(lang) .. adj&lt;br /&gt;
	else&lt;br /&gt;
		return noun .. p.inparentheses(adj, lang)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.conj(args, lang, conjtype)&lt;br /&gt;
	if not args then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local newargs = {}&lt;br /&gt;
	for i, j in pairs(args) do&lt;br /&gt;
		if type(j) ~= 'nil' then&lt;br /&gt;
			table.insert(newargs, j)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	args = newargs&lt;br /&gt;
	if #args == 0 then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if conjtype == 'comma' then&lt;br /&gt;
		return mw.text.listToText(args, comma(lang), comma(lang))&lt;br /&gt;
	elseif conjtype == 'citation_comma' then&lt;br /&gt;
		return mw.text.listToText(args, citation_comma(lang), citation_comma(lang))&lt;br /&gt;
	elseif conjtype == 'or' then&lt;br /&gt;
		return mw.text.listToText(args, comma(lang), wordor(lang) .. wordsep(lang))&lt;br /&gt;
	elseif conjtype == 'explicit or' then -- adds &amp;quot;or&amp;quot; betwen all words when the context can be confusing&lt;br /&gt;
		return mw.text.listToText(args, wordor(lang) .. wordsep(lang), wordor(lang) .. wordsep(lang))&lt;br /&gt;
	elseif conjtype then&lt;br /&gt;
		return mw.text.listToText(args, conjtype, conjtype)&lt;br /&gt;
	else&lt;br /&gt;
		return mw.text.listToText(args, comma(lang), wordand(lang) .. wordsep(lang))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Michael</name></author>	</entry>

	</feed>