Module:Main/doc: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
Created page with "== Documentation == === get_appeal === Includes the best localised appeal subpage of Template:Appeal, based on appeal name, language, and country given. Also passes the..."
 
 
(3 intermediate revisions by the same user not shown)
Line 17: Line 17:
* display [[Template:Appeal/Alan/fr]] if it exists, else
* display [[Template:Appeal/Alan/fr]] if it exists, else
* display [[Template:Appeal/Alan/en]] if it exists, else
* display [[Template:Appeal/Alan/en]] if it exists, else
* display [[Template:Appeal/default/fr]]
* display [[Template:Appeal/default/fr]] if it exists, else
* display [[Template:Appeal/default/en]]


Replaces {{tl|2012FR/Switch/Appeal}}
Replaces {{tl|2012FR/Switch/Appeal}}

=== get_infobox ===

Does basically the same thing for subpages of [[Template:Infobox]]

Replaces {{tl|2012FR/Switch/Infobox}}

=== get_tax_message ===

Code should be fairly self explanatory. Allows overriding the default message for certain countries.

=== page_language ===

Return the language code of the current subpage. If it isn't a subpage, or isn't a valid language code, return 'en'.

Latest revision as of 11:46, 19 July 2021

Documentation

get_appeal

Includes the best localised appeal subpage of Template:Appeal, based on appeal name, language, and country given. Also passes the parameters to the selected appeal template for their use (e.g. in localising amounts with {{AppealAmountSwitch}})

Parameters:

  • appeal - initial "Appeal-" (which was required for older links) is stripped off if present
  • language
  • country
  • Any other parameters to pass through to the appeal template (e.g. sitename)

Example:

{{#invoke:Main|get_appeal|appeal=Alan|country=CA|language=fr}}

Replaces {{2012FR/Switch/Appeal}}

get_infobox

Does basically the same thing for subpages of Template:Infobox

Replaces {{2012FR/Switch/Infobox}}

get_tax_message

Code should be fairly self explanatory. Allows overriding the default message for certain countries.

page_language

Return the language code of the current subpage. If it isn't a subpage, or isn't a valid language code, return 'en'.