વિભાગ:લિપિના ઉપયોગીતા/doc
This is the documentation page for વિભાગ:લિપિના ઉપયોગીતા
This module provides access to Module:લિપિઓ 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
[ફેરફાર કરો]lookup_script
[ફેરફાર કરો]{{#invoke:script utilities|lookup_script|(script code)|(item to look up)|(index)}}
Queries information about a script code. This is analogous to lookup_language
in Module:ભાષાના ઉપયોગીતા and works the same way, but looks up scripts instead. See there for a more thorough description.
script_exists
[ફેરફાર કરો]{{#invoke:script utilities|script_exists|(script code)}}
Check whether a script code exists and is valid. It will return "1" if the script code exists, and the empty string "" if it does not.
This is rarely needed, because a script error will result when someone uses a code that is not valid, so you do not need this just to check for errors. However, in case you need to decide different actions based on whether a certain parameter is a script code or something else, this function can be useful.
tag_text
[ફેરફાર કરો]tag_text(text, lang, sc, face)
Wraps the given text in HTML tags with appropriate CSS classes (see WT:CSS) for the language and script. It replaces the function of the લિપિ સંકેતના ઢાંચાઓ (specifically the {{લિપિ સહાયક}}
template) and 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 Module:ભાષાઓ. 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 {{લિપિની માગણી}}
template as well as by the functions in Module:કડીઓ.
The function will add entries to one of the subcategories of Category: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:લિપિના ઉપયોગીતા|template_rfscript}}
This is used by {{લિપિની માગણી}}
. See there for more information.
See also
[ફેરફાર કરો]- Module:JSON data — for exporting all the script data at once