Board Thread:Lua Help/@comment-24520859-20151223111253/@comment-24473195-20151224101246

Oops, I made a mistake and copied the wrong code above. This should work:

local p = {} local LanguageNameData = mw.loadData( 'Module:LanguageName/ja/data' ) function p.LanguageName( frame ) local LanguageNameText = frame.args[1]

if LanguageNameData[LanguageNameText] ~= nil then LanguageNameText = LanguageNameData[LanguageNameText] else LanguageNameText = LanguageNameData["#default"] or "" end

return LanguageNameText end return p The "else" part shows "nothing" if it is the wrong case. It will first see if case "#default" exists and try to show that, if it doesn't then it will be empty.