Mòideal:script utilities/doc
This is the documentation page for Mòideal:script utilities
Uses Lua: |
Related pages |
---|
(deasbaireachd⧼tpt-languages-separator⧽ ⧼tpt-languages-separator⧽eachdraidh⧼tpt-languages-separator⧽ceanglaichean⧼tpt-languages-separator⧽doc⧼tpt-languages-separator⧽bogsa-gainmhich⧼tpt-languages-separator⧽cùisean deuchainn)
This module is currently protected from editing. See the protection policy and protection log for more details. Please discuss any changes on the talk page; you may submit an edit request to ask an administrator to make an edit if it is uncontroversial or supported by consensus. You may also request that this page be unprotected. |
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
This module provides access to Mòideal:scripts from templates, so that they can make use of the information stored there. It also provides a number of functions that can be used by other modules.
Exported functions
tag_text
tag_text(text, lang, sc, face)
Wraps the given text in HTML tags with appropriate CSS classes (see WTCSS) for the language and script. This is required for all non-English text on Wiktionary.
The actual tags and CSS classes that are added are determined by the face
parameter. It can be one of the following:
"term"
- The text is wrapped in
<i class="(sc) mention" lang="(lang)">...</i>
. "head"
- The text is wrapped in
<strong class="(sc) headword" lang="(lang)">...</strong>
. "bold"
- The text is wrapped in
<b class="(sc)" lang="(lang)">...</b>
. nil
- The text is wrapped in
<span class="(sc)" lang="(lang)">...</span>
.
transliterate
transliterate(text, lang, sc)
Generates a transliteration (romanization) from the given text into Latin script, using the transliteration rules of the given language. This will use the module specified with the translit_module
setting for the language in Mòideal:languages. If no transliteration module is available, or if the transliteration fails in some other way, nil
is returned.
request_script
request_script(lang, sc)
Generates a request to provide a term in its native script, if it is missing. This is used by the {{Rfscript}}
template as well as by the functions in Mòideal:links.
The function will add entries to one of the subcategories of Roinn-seòrsa:Terms needing native script by language, and do several checks on the given language and script. In particular:
- If the script was given, a subcategory named "needing (script) script" is added, but only if the language has more than one script. Otherwise, the main "needing native script" category is used.
- Nothing is added at all if the language has no scripts other than Latin and its varieties.
template_rfscript
{{#invoke:script utilities|template_rfscript}}
This is used by {{rfscript}}
. See there for more information.
Faic cuideachd - Also see
- Mòideal:JSON data — for exporting all the script data at once