menu menu_open
  • edit Edit

    Navigation

    • Main page
    • All pages
    • Recent changes
    • Random page
    • Help

    Tools

    • What links here
    • Related changes
    • Special pages
    • Printable version
    • Permanent link
    • Page information

    Variants

The Lab Rats 2 - Reformulate Wiki

Module:TNTFallback

14 article Pages
18 photo Files
2128 edit Edits
22 person Users
timeline photo_library leaderboard file_upload
palette
  • computer
code
  • computer
pages api security app_shortcut
more_vertical
  • timeline Recent changes
  • photo_library New Files
  • leaderboard Statistics
  • file_upload Upload file
  • palette CSS expand_more
    • computer
  • code JS expand_more
    • computer
  • pages All pages
  • apisandbox API sandbox
  • security System messages
  • app_shortcut Special pages
grid_view double_arrow forum file_download extension file_upload visibility book category delete_sweep
settings
contrast

  • brightness_auto hdr_auto
  • brightness_7 brightness_1
  • brightness_6 brightness_2
  • brightness_5 brightness_3
  • brightness_4
  • brightness_3 brightness_5
  • brightness_2 brightness_6
  • brightness_1 brightness_7
hdr_auto
  • brightness_auto
  • hdr_auto
  • light_mode
  • dark_mode

  • palette
  • tonality

  • brightness_auto hdr_auto
  • gradient gradient
  • thermostat thermostat
  • ac_unit storm
  • Duo
  • Solo
format_paint
  • emergency deployed_code
  • emergency opacity
  • square
  • contrast

  • deployed_code build square contrast
  • 1
  • 2
  • 3
  • 4
palette
  • brightness_auto
  • hdr_auto
  • light_mode
  • dark_mode

  • build
  • emergency invert_colors_off
  • contrast
  • format_paint
  • android
  • colorize
colorize
  • brightness_auto
  • hdr_auto
  • bedtime_off
  • bedtime

  • build
  • square
  • computer
  • invert_colors
  • brush
  • filter_b_and_w
  • contrast
  • smart_toy
  • 1
  • 2
  • 3
  • 4
brush
  • A
  • B
  • C
  • D
  • E
  • F
  • G
  • H
  • Welcome to the Lab Rats 2 - Reformulate Wiki.
  • Stay tuned here for news and changes...
  • This wiki is currently being built. Feel free to contribute to it and discuss any suggestions or changes.
  • Visit the Lab Rats 2 Discord to discuss any missing information!
  • Module
  • Discussion
  • Read
  • View source
  • View history

Module:TNTFallback

From The Lab Rats 2 - Reformulate Wiki
Revision as of 02:53, 22 December 2021 by Cooperdk (talk | contribs) (1 revision imported: Imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:TNTFallback/doc

--------------------------------------------------------------------------------
-- This module implements a wrapper for [[Module:TNT]] that allows returning
-- a fallback message; used by {{Documentation}}.
--
-- @module TNTFallback
-- @alias  p
-- @author [[User:ExE Boss]]
-- @require [[Module:No globals]]
-- @require [[Module:TNT]]
--------------------------------------------------------------------------------

require("Module:No globals");
local TNT = require("Module:TNT");

local p = {};

--------------------------------------------------------------------------------
-- Based on [[Module:TNT]]'s `msg` function,
-- but takes an optional `fallback` parameter.
--------------------------------------------------------------------------------
function p.msg(frame)
	local dataset, key;
	local params = { n = 0 };
	local lang = nil;
	local fallback = nil;

	for k, v in pairs(frame.args) do
		if (k == 1) then
			dataset = v;
		elseif (k == 2) then
			key = v;
		elseif (type(k) == "number" and k > 2) then
			local i = k - 2;
			params[i] = v;
			params.n = math.max(params.n, i);
		elseif ((k == "lang") and (v ~= "_")) then
			lang = v;
		elseif ((k == "fallback") and (v ~= "")) then
			fallback = v;
		end
	end

	local result;
	if (lang) then
		result = TNT.formatInLanguage(lang, dataset, key, unpack(params, 1, params.n));
	else
		result = TNT.format(dataset, key, unpack(params, 1, params.n));
	end

	if (fallback and (
		-- not translated
		(result and result == TNT.formatInLanguage("en", dataset, key, unpack(params, 1, params.n)))
		-- no message
		or (not result)
	)) then
		if (not lang) then
			if (frame:callParserFunction("int:lang") ~= "en") then
				return mw.message.newRawMessage(fallback, unpack(params, 1, params.n)):plain();
			end
		elseif (lang ~= "en") then
			return mw.message.newRawMessage(fallback, unpack(params, 1, params.n)):plain();
		end
	end

	return result;
end

return p;
Retrieved from "https://lr2wiki.porn-organizer.org/index.php?title=Module:TNTFallback&oldid=304"
  • Privacy policy
  • About The Lab Rats 2 - Reformulate Wiki
  • Disclaimers
    • This page was last edited on 22 December 2021, at 02:53.
    • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
    • Creative Commons Attribution-ShareAlike
    • Powered by MediaWiki

    timeline Recent changes
    arrow_forward_ios

    No changes during the given period match these criteria.

    info About The Lab Rats 2 - Reformulate Wiki
    edit

    The wiki for the adult sandbox game Lab Rabs 2 - Reformulate

    search saved_search
    search saved_search Search
    apps
    • live_help
    • hive
    • insert_link
    • timeline
    • visibility
    • shuffle
    • build
    • help
    • file_download
    • attachment
    public_off Not logged inReady
    widgets
    public StandardReady
    hive MirahezeReady
    Qora QoreReady
    • Privacy policy
    • About The Lab Rats 2 - Reformulate Wiki
    • Disclaimers
    insert_link timeline visibility shuffle build help file_download attachment
    account_circle
    • refresh

    • Create account
    • Log in
    refresh