serbian-latin-cyrillic-transliteration
v1.0.5
Published
All in one Cyrillic to Latin transliteration plugin for React & Nextjs that actually works.
Downloads
5
Maintainers
Readme
This is simple Cyrillic to Latin transliteration plugin that actually works.
- init library
import SerbianLatinCyrillicTranslateration from 'serbian-latin-cyrillic-transliteration'
// instance library and setup options
const translator = new SerbianLatinCyrillicTranslateration({})
Options:
- translatableElements: !string[] : add element that we want to translate.
{
translatableElements:['.translate' ,'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'span', 'button', '.nav-link','.menuLink']
}
defalt value are: ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'span', 'button']
How to switch alphabet:
/*
param: string! ,
options: sr | sr_lat
description: Pass "sr" or "sr_lat" depending of which alphabet you want to use it
*/
translator.setLanguage('sr')