Module:Runr-translit

Hello, you have come here looking for the meaning of the word Module:Runr-translit. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:Runr-translit, but we will also tell you about its etymology, its characteristics and you will know how to say Module:Runr-translit in singular and plural. Everything you need to know about the word Module:Runr-translit you have here. The definition of the word Module:Runr-translit will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:Runr-translit, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

This module will transliterate text in the Runic script in Proto-Norse (gmq-pro), Old English (ang) and Old Norse (non). It is used to transliterate Old English, Proto-Norse, Old High German, and Old Norse. The module should preferably not be called directly from templates or other modules. To use it from a template, use {{xlit}}. Within a module, use Module:languages#Language:transliterate.

For testcases, see Module:Runr-translit/testcases.

Functions

tr(text, lang, sc)
Transliterates a given piece of text written in the script specified by the code sc, and language specified by the code lang.
When the transliteration fails, returns nil.
The language code is necessary because some letters are transliterated slightly differently depending on the language.

local export = {}

local letters = {}

local export = {}

local letters = {}

-- Elder futhark
letters = {
	='f',
	='u',
	='þ',
	='a',
	='r',
	='k', ='k', ='k',--transitional period
	='g',
	='w',
	='h', ='h',
	='n',
	='i',
	='j', ='ᴀ',--transitional period
	='ï',
	='p',
	='ʀ', ='ʀ',--transitional period
	='s', ='s',
	='t',
	='b',
	='e',
	='m',
	='l',
	='ŋ', ="ŋ",
	='o',
	='d',
	='·', =':'
}

-- Old High German
letters = {
	='f',
	='u',
	='þ',
	='a',
	='r',
	='k', ='k', ='k',
	='g',
	='w',
	='h', ='h',
	='n',
	='i',
	='j',
	='ï',
	='p',
	='s', ='s',
	='t',
	='b',
	='e',
	='m',
	='l',
	='ŋ', ="ŋ",
	='o',
	='d'
}

-- Anglo-Saxon futhorc
letters = {
	="f",
	="u",
	="þ",
	="ó",
	="r",
	="c",
	="ġ",="g",
	="w",
	='h', ='h',
	="n",
	="i",
	="j",
	="eo",
	="p",
	="x",
	="s",
	="t",
	="b",
	="e",
	="m",
	="l",
	='ŋ', ="ŋ",
	="œ",
	="d",
	="a",
	="æ",
	="y",
	="io",
	="ea"
}

-- Younger futhark, including later stung or otherwise modified variants
letters = {
	="f", ="v",
	="u", ="y",
	="þ", ="ð",
	="ą", ="ą", ="ą", ="o", ="ø", ="ǫ",
	="r",
	="k", ="g",
	="h", ="h",
	="n", ="n",
	="i", ="e",
	="a", ="a", ='ᴀ',
	="s", ="s",
	="t", ="t", ="d",
	="b", ="b", ="p", ="p",
	="m", ="m",
	="l",
	="ʀ", ="ʀ",
	
	--certain Elder Futhark letters exist in early Old Norse inscriptions
	='ɢ',
	='w',
	='ʜ',
	='ᴇ',
	='ᴍ',
	='ᴅ',
	='ᴏ'
}

-- Old Danish
letters = {
	="f", ="v",
	="u", ="y",
	="þ", ="ð",
	="o", ="ø",
	="r",
	="k", ="g",
	="h", ="h",
	="n", ="n",
	="i", ="e",
	="æ", ="a",
	="s", ="s",
	="t", ="t", ="d",
	="b", ="b", ="p", ="p",
	="m", ="m",
	="l",
	="y", ="ʀ",
}

function export.tr(text, lang, sc)
	if letters then
		return (mw.ustring.gsub(text, ".", letters))
	end

	return nil
end

return export