FANDOM


local p = {}
 
-- These functions load in the modules that provide maps.
local ArteLocNameData = mw.loadData( 'Module:ArteLocName/data' )
local ArteLocNameSpelling = mw.loadData( 'Module:ArteLocName/spelling' )
 
-- This function returns the current localized name for the Japanese name of an arte. If one does not exist, it provides the MissingOverride parameter if it exists, otherwise returning the name itself.
function p.LocName( frame )
	local ArteName = frame.args[1]
	local MissingOverride = frame.args[2]
 
	-- This function overrides the input spelling with what the wiki uses as the arte's canonical spelling, if one exists.
	ArteName = ArteLocNameSpelling[ArteName] or ArteName
 
	return ArteLocNameData[ArteName] or MissingOverride or ArteName
end
 
-- This function determines if an arte as an localization. If one does not exist, it returns the string "MissingLocalization".
function p.Verify( frame )
	local ArteName = frame.args[1]
 
	-- This function overrides the input spelling with what the wiki uses as the arte's canonical spelling, if one exists.
	ArteName = ArteLocNameSpelling[ArteName] or ArteName
 
	return ArteLocNameData[ArteName] or "MissingLocalization"
end
 
return p
 
--[[Category:Lua modules]]
Community content is available under CC-BY-SA unless otherwise noted.