此模塊用於取代不生成轉寫的轉寫模塊。它採用語言和腳本代碼,並使用 Module:translit-redirect/data 重定向到處理這種代碼組合的實際音譯模塊。它已經取代了像 Module:pa-translit 這樣的轉寫模塊。使用此模塊處理轉寫的語言包括:上古格魯吉亞語 (oge) , 上古馬拉地語 (omr) , 中古波斯語 (pal) , 亞拉姆語 (arc) , 信德語 (sd) , 傣仂語 (khb) , 克什米爾語 (ks) , 克里語 (cr) , 博杰普爾語 (bho) , 古希臘語 (grc) , 古旁遮普語 (inc-opa) , 古英語 (ang) , 古諾爾斯語 (non) , 喀奇語 (kfr) , 因紐特語 (iu) , 圖陸語 (tcy) , 夏爾巴語 (xsr) , 多格拉語 (doi) , 孔卡尼語 (kok) , 安息語 (xpr) , 尼瓦爾語 (new) , 巴利語 (pi) , 布匿語 (xpu) , 拉茲語 (lzz) , 旁遮普語 (pa) , 普拉克里特語 (inc-pra) , 曼尼普爾語 (mni) , 梵語 (sa) , 欽察語 (qwm) , 比林語 (byn) , 沙拉基語 (skr) , 洛馬夫倫語 (rmi) , 烏迪語 (udi) , 瓦爾哈迪語 (vah) , 瓦罕語 (wbl) , 粟特語 (sog) , 羅興亞語 (rhg) , 腓尼基語 (phn) , 花剌子模語 (xco) , 西克耶語 (kyu) , 迪維希語 (dv) , 邁蒂利語 (mai) , 阿輸迦普拉克里特語 (inc-ash) , 馬拉地語 (mr) , 馬瓦里語 (mwr) .

Using a single module to redirect to other transliteration modules will save some Lua memory on pages that tend to go over the memory limit. Also, the template that generates documentation for transliteration modules ({{translit module documentation}}) can only discover that a language uses a transliteration module, and list that language on the transliteration module's documentation page, if the transliteration module is listed either in the language's data file, or in Module:translit-redirect/data.

示例

pa (Punjabi) uses this module to redirect to the correct transliteration module for whatever script is being used.


local export = {}

function export.tr(text, lang, sc, debug_mode)
	if not sc then
		sc = require("Module:scripts").findBestScript(text, require("Module:languages").getByCode(lang)):getCode()
	end
	
	local language_data = mw.loadData("Module:translit-redirect/data")[lang]
	
	if language_data then
		script_data = language_data[sc]
		
		if script_data then
			if script_data.module then
				local success, translit_module = pcall(require, "Module:" .. script_data.module)
			
				if success then
					return translit_module.tr(text, lang, sc, debug_mode)
				else
					error(translit_module)
				end
			else
				return nil
			end
		else
			require("Module:debug").track{
				"translit-redirect/incorrect-script/" .. lang,
				"translit-redirect/incorrect-script/" .. lang .. "/" .. sc,
			}
			mw.log("script code (" .. sc .. ") for language code " .. lang .. " not found in Module:translit-redirect/data; text: " .. text)
		end
	end
end

return export