مودول:Language/name/شرح

من ويكيپيديا

هذه صفحة توثيق لمودول:Language/name

This module converts أيزو 639 codes and language tags into their equivalent language names (descriptions). It has three modes: simple (strict), fuzzy and formal. In simple, the whole tag needs to be an exact match; in fuzzy, only the base ISO 639 code needs to be an exact match. For example, if there's no mn-Cyrl tag in the list, but there's mn, simple will not be able to find a match, whereas fuzzy will. Finally, in formal, the script will attempt to properly decode the tag by language, script (writing system) and region and print its name in full. Here's how the three modes will handle zh and zh-Hans-CN:

{{#invoke:Language/name|simple|code=zh}} شّينيوية
{{#invoke:Language/name|simple|code=ar}} لعربية
{{#invoke:Language/name|simple|code=zh-Hans-CN}}
{{#invoke:Language/name|fuzzy|code=zh-Hans-CN}} شّينيوية
{{#invoke:Language/name|formal|code=zh-Hans-CN}} شّينيوية (Han (Simplified variant), China)

{{اسم آيزو 639}} and Module:Language/text use fuzzy. Input is case-insensitive. If input is omitted, this module with return an error; if no match is found, it'll return an empty string that can be used with #if constructs in wikicode, e.g. {{#if:{{ISO 639 name|{{{1}}}}}| ... }}.

Data is pulled from /data.

For info on language tags, see BCP 47, the IANA Language Subtag Registry, Richard Ishida's Language Subtag Lookup and the موضيل:Ill-WD2 article here on Wikipedia.

طالع أيضاً[بدل لكود]