SrbTransLatin is targeted to WP blogs written in Serbian language. It solves problem of two scripts equally used for Serbian language (Cyrillic and La
|Author:||Predrag Supurović (profile at wordpress.org)|
|WordPress version required:||2.6.1|
|WordPress version tested:||4.9.2|
|Added to WordPress repository:||10-10-2008|
|Total downloads:||23 784|
|Active installs:||2 000+|
Click to start download
- Extract package and upload
- Activate the plugin through the ‘Plugins’ menu in WordPress
- Add widget
Serbian Transliteration (links)or
Serbian Transliteration (list)and set it’s options:
- set title for script selection wigdet (default: Избор писма)
- set if title should be shown for script selection widgets (default: title is not shown)
- set if script selection is displayed as web links or options of combo box
Open Settings / SrbTransLat and set parameters according to your needs:
- set default script to be used if user do not make choice of script (default: Cyrillic)
- set if you want selected script to be saved in visitor’s browser cookie
- set if permalinks are autogenerated in Latin script even if title is in Cyrillic (default: conversion to Latin)
Can this transliterate my blog which uses Serbian Latin script into Serbian Cyrillic?
No. Such conversion is hard if impossible due to not unique transliteration rules. It is reccomended that you create contents on your site using Cyrillic script if you need both scripts.
Plugin transliterates everything but page title in HEAD section of HTML?
This happens on some installations. It seems it is dependable on template used, like some templates interfere with wp hooks regarding page title.
I use multilanguage plugin along with SrbTransLatin, but it does not work well?
Usually, problems with multilanguage plugins is interference with url parameter name. Try changing default script identification in SrbTransLatin options.
When I change to non default script some images are not shown on page?
Use Latin alphabet in image file names only. If you use Cyrillic letters in file names, they will be transliterated to rendering wrong file name.
I have some images on page that I want to switch from Cyrillic and Latin version along with text contents?
Prepare original image with Cyrillic contents by adding keyword -cir- in image file name, for example myimage-cir-.jpg. Prepare Latin version of the same image naming it using -lat- keyword, like myimage-lat-.jpg. When page is displayed, image will be loaded regarding selected script. Delimiter character ‘-‘ may be customly set.
I tried to use script tags in image names but it does not work
On some WordPress installations, when you upload images WordPress strips some characters from file names. Check if files have proper file names after upload.
If some characters are stripped you may try uploading file directly (using FTP for example).
If file name script delimiter is stripped you may change it in plugin settings. You may use any character acceptable in file name syntax. Even better, you may set several characters for delimiter to avoid collisions. Do not forget to name all files to match new delimiter.
I uploaded file with Cyrillic characters in file name. Plugin transliterates it to Latin so I end up with invalid file name
You should not use Cyrillic characters in file name. It is not that just this plugin does not like it, it is wrong on multiple levels. Always use Roman Latin characters in file names.
However, as it frequently happens that users upload files with Cyrillic character in file names, SrbTranslatin has option to sanitize such file names. If turned on, it will replace Cyrillic characters with appropriate Latin characters and rename file on upload. That will make sure that you have proper file names.
How to prevent part of the text to be transliterated to Latin?
Place text you do not want to be transliterated into block surrounded by [lang id=”skip”] and [/lang].
Example: [lang id=”skip”]this text will not be transliterated[/lang]
Some contents of the page does not work properly when SrbTransLatin is active?
Some contents of the page is not transliterated to Latin?
Check if you used [lang id=”skip”] and [/lang] on that block of text.
Make sure your plugin is run with lowest priority so it process page contents after it is all generated by other plugins.
Search option finds contents only if it matches search keyword script. Is it possible that it find everything regardless of the script?
Search is done in database, not in WordPress code. Database does not provide means to disregard scripts in search keywords without significant reconfiguration of database server. Most hosting services do not even allow such reconfiguration. I am trying to think of solution for this issue.
I want to show script selection in custom template, not by widget. Is it possible?
Yes. See description of function stl_show_selector() provided by this plugin.
I want to customize template, based on selected script. Is it possible?
Yes. See description of functions stl_show_selector(), stl_get_current_script(), stl_is_current_cyrillic(), stl_is_current_latin(), stl_get_cyrillic_id(), stl_get_latin_id(), and stl_get_script_identificator() provided by this plugin.
I want to customize site, based on selected script, but I cannot insert PHP code as suggested. Is it possible?
Yes. You may use shortcodes provided by plugin. Check plugin description.
How to display some content only if specific script is used?
You may use shortcodes [stl_is_cyrillic] or [stl_is_latin] to control if part of the content should be visible only if specific script is displayed.
Also, you may use PHP function stl_is_current_cyrillic() and stl_is_current_latin() it that suits your needs more.
One of the users uploaded image with Cyrillic characters in name. When viewed in Latin, image is not visible. How can I fix that?
This happens because SrbTransLat transliterates everything, including file names.
My strong suggestion is to disallow using Cyrillic script in file names, not just on your site but anywhere. Using non Latin characters in file names is always bad idea and just leads to all kinds of complications.
You have option in plugin settings to turn sanitization of uploaded files which will replace all Cyrillic in file names on upload. So, even if user uploads Cyrillic named file, it will end in Latin script.
If you already have files with Cyrillic names and you are not willing to replace them with non Cyrillic file names, there is an option to skip transliteration of file names and URL-s. Turn that on, and images will be displayed correctly.
After I turned on skipping transliteration for file names i get blank page. Help!
Most likely you use xDebug on your site and it has default limitation of 100 nesting levels which may be to low for page with number of links. Check in plugin description how to increase xdebug_max_nesting_level.
This is really nice script which I use on my site. Can I donate some money to the author?
No. This is free to use script. If you want to show appreciation, spread the word, share the link to http://pedja.supurovic.net/projekti/srbtranslatin
Added shortcodes [stl_is_cyrillic], [stl_is_latin]
Improoved transliteration procedure for better resource usage.
Documentation and translation updates.
Added shortcodes [stl_get_script_identificator], [stl_get_current_script], [stl_get_cyrillic_id] and [stl_get_latin_id]
Fixed bug reporting invalid variable name.
Fixed possible issue with xDebug max nesting levels.
Removed paragaph tag in one line script selection template and replaced with span to allow better blending in page design. span tag has css class name stl_oneline so it may be visually set by css.
Images icon-cir-.png and icon-lat-.png added to img directory for demonstration purposes.
Added functionality suggested by Vanja Djuric not to transliterate file names and urls. Vanja provided code.
Removed saving current display language to cookie.
Added Reset button in Settings form to allow reseting to default.
Fixed plugin did not remove settings from database at deinstallation. Now, when plugin is deinstalled, it clears settings too.
Changed priority of hooks so it should better catch page contents to transliterate. Might solve issues some sites have not translating head titles.
Added option to use Russian transliteration instead of Serbian.
HTML code extracted to external template files for easier customization.
Fixed url handling when default language is Latin.
Fixed constructor warning with PHP 7.
Added globaly available functions:
stl_get_current_script(), stl_is_current_cyrillic(), stl_is_current_latin(), stl_get_cyrillic_id(), stl_get_latin_id(), stl_get_script_identificator().
New option to sanitize Cyrillic characters from file name on file name upload.
Default file script delimiter is now ‘-‘. From some version, WordPress made earlier delimiter ‘=’ unusable, so there is no point of using it any more.
Removed language query parameter adding to image urls in src, srcset and background as unnecessary overhead.
Fixed bug with option to check if user web browser supports Cyrilic. Option removed.
Fixed bug with inserting language identificator in links when not necessary.
More fixes parsing file name tags in links within page.
Added new option. User now can set delimiter used for marking language in file name or path.
Additional fix parsing img tags for Cyrillic and Latin image replacement.
Fixed bug with parsing [lang] tags, and also parsing img tags for Cyrillic and Latin image replacement.
Fixed bug on handling before widget and after widget.
Fixed bug transliterating blog header title.
Added option to display only option to select non current script
Addedd option for WPML users to set if thez want SrbTransLatin Widget to be invisible on specific languages.
Fixed bug with transliterating title to permalink option in settings
Added helper for conflicts with WPML. WPML uses ‘lang’ as language identificator which is the same as default for SrbTransLatin. Now if WPML is installed default changes to ‘script’, and if identificator is set to ‘lang’ warning is shown to user.
Fixed bug with transliterating title to permalink
Added external configuration using config.php
Fixed displaying cookie using state setting option.
Function stl_show_selector() expanded with two new parameters allowing setting captions for script selection items.
Added option to let user change script identificator in url.
Added option to switch image on script change. If you use filename=cir=.jpg as image name, if latin script is selected, then image named filename=lat=.jpg will be used instead.
Changed priority of the plugin so it allows other plugins to alter contents before transliteration.
Added option which allows user to customize title for Cyril and Latin options in widget.
Minor fix. Title of ‘latinica’ was displayed using Cyrillic script. Changed to Latin script.
Fixed permalink transliteration issues with the latest WordPress version.
Added function stl_show_selector() which may be used to insert script selector anywhere in template.
Added full support for exernal language files and Serbian translation included.
Partially rewritten code according to new WordPress API. Also, some new functionality added.