Changes

1,875 bytes added ,  23:28, 15 July 2021
Pywikibot 6.4.0
{{module rating|alpha}}
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
This module produces equivalent [[Serbo-Croatian]] [[Gaj's Latin alphabet|Latin]] text from [[Serbian Cyrillic alphabet|Cyrillic]] input.

== Usage ==

This module exports two functions providing different outputs. Both functions require {{para|text}} argument for proper operation.

=== cyr2lat and lat2cyr ===

These function should be invoked the following way:

&#123;{#invoke:lang-hbs|''cyr2lat''|''text to be converted''}}
&#123;{#invoke:lang-hbs|''lat2cyr''|''text to be converted''}}

It replaces all letters of Serbo-Croatian Cyrillic alphabet with corresponding Latin letters.

'''Note''': per [[MOS:FOREIGN]] non-English words in Latin script should be ''italicized''. <code>cyr2lat</code> fuction leaves it to users.

=== convert ===

This function should be invoked the following way:

&#123;{#invoke:lang-hbs|''concat''|cyrillic=''Cyrillic text''|latin=''Latin text''}}

It replaces Serbo-Croatian Cyrillic with Latin and returns both Cyrillic and Latin text with latter being italicized. Either of {{para|cyrillic}} and {{para|latin}} is sufficient.

== Caveats ==

*Serbo-Croatian Latin alphabet includes letters "lj", "nj" and "dž", which, in addition to [[upper case]] ("LJ", "NJ" and "DŽ" respectively), also have "[[title case]]" ("Lj", "Nj" and "Dž"), which is used when only individual letters of the word are capitalized (eg. name "Љиљана" is spelled as "Ljiljana", not "LJiljana"). For performance and algorythmic complexity reasons this template always uses title case instead of upper case.
*Latin to Cyrillic transliteration works only with Unicode digraphs. Use Cyrillic to Latin transliteration if in doubt.

<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<!-- Categories go here and interwikis go in Wikidata. -->

}}</includeonly>