Module:Dictionary: Difference between revisions

force refresh module
Tag: Recreated
 
m removed redundant parameter.
Line 5: Line 5:


-- Get a localized string by the raw key
-- Get a localized string by the raw key
p.translate = function(key, lang_code_override, fallback_str, show_needs_translation, vars)
p.translate = function(key, lang_code_override, fallback_str, vars)
-- If called internally (direct Lua call), args will be passed directly.
-- If called internally (direct Lua call), args will be passed directly.
     -- If called from wikitext, "key" will be the "frame" object, and we get args from "frame.args".
     -- If called from wikitext, "key" will be the "frame" object, and we get args from "frame.args".
Line 16: Line 16:
         lang_code_override = frame.args["lang_code_override"]
         lang_code_override = frame.args["lang_code_override"]
         fallback_str = frame.args["fallback_str"]
         fallback_str = frame.args["fallback_str"]
        show_needs_translation = frame.args["show_needs_translation"]
         vars = {}
         vars = {}
         local i = 2
         local i = 2
Line 23: Line 22:
             i = i + 1
             i = i + 1
         end
         end
    end
    -- Default to showing needs translation
    if (show_needs_translation == nil) then
    show_needs_translation = 'true'
     end
     end


Line 43: Line 37:
-- Determine the appended tooltip
-- Determine the appended tooltip
local needs_translation_expand = ''
local needs_translation_expand = ''
if (show_needs_translation == 'true' and key ~= 'MissingValveTranslationTooltip' and key ~= 'NeedsTranslationTooltip' and key ~= 'NotesNeedsTranslation') then
if (key ~= 'MissingValveTranslationTooltip' and key ~= 'NeedsTranslationTooltip' and key ~= 'NotesNeedsTranslation') then
local template_args = {}
local template_args = {}
if key == 'Notes' then
if key == 'Notes' then