Pereiti prie turinio

Šablonas:Kalbos rašmenys/doc

Puslapis iš Vikižodyno, laisvojo žodyno.
Šį puslapį sudaro dokumentacija, kategorijos ir kita informacija, kuri nėra šablono dalis.
Norint peržiūrėti pati šablonas puslapį, žr. Šablonas:Kalbos rašmenys.

Šis šablonas grąžina rašmenų (abėcėlės) kodą pagal kalbos kodą.

Panaudojimas

[taisyti]

This template should be implemented into other templates, wherever an automatic script is necessary.

There are two foreseen instances where an automatic script code is used.

  • Organization.
    Example: Categorizing the English language as written in the Latin script.
  • Formatting.
    Example: Formatting Russian language characters with the appropriate Cyrillic fonts automatically.

Parameters

[taisyti]

This template requires only one unnamed parameter.

  • When a language is written in only one script, the sole parameter is the language code.
  • When a language is written in two or more scripts, the sole parameter is the language code to return a standard script; or, the language code closely followed by a number to return other scripts.

Examples

[taisyti]
  1. English
    The English language is written in the Latin script.
    The English language is represented by the code en.
    The Latin script is represented by the code Latn.
    Therefore, {{Kalbos rašmenys|en}} returns Latn.
  2. Portuguese
    The Portuguese language is written in the Latin script.
    The Portuguese language is represented by the code pt.
    The Latin script is represented by the code Latn.
    Therefore, {{Kalbos rašmenys|pt}} returns Latn.
  3. Russian
    The Russian language is written in the Cyrillic script.
    The Russian language is represented by the code ru.
    The Cyrillic script is represented by the code Cyrl.
    Therefore, {{Kalbos rašmenys|ru}} returns Cyrl.
  4. Serbo-Croatian
    The Serbo-Croatian language is written in the Cyrillic and the Latin scripts.
    The Serbo-Croatian language is represented by the code sh.
    The Cyrillic script is represented by the code Cyrl.
    The Latin script is represented by the code Latn.
    Therefore, {{Kalbos rašmenys|sh}} returns Cyrl and {{Kalbos rašmenys|sh2}} returns Latn.

Mechanics

[taisyti]

This template uses a simple {{#switch:}} parser function to handle language codes and script codes.

EXAMPLES:

1. English language written in Latin script.
|en=Latn

2. Serbo-Croatian language written in both Cyrillic and Latin scripts.
|sh=Cyrl
|sh2=Latn

3. Urdu language, written in Arabic script but using a particular script template called "ur-Arab".
|ur=ur-Arab

When a language is written in more than one script, please place the most used first, so it will be recognized by other templates as the default script of that language.