nikola Posted August 30, 2011 Share Posted August 30, 2011 I've noticed that when using character "đ" (Croatian) in title name it doesn't convert to appropriate character in slug, rather it disappears. The solution is to add matching substitute in wire/modules/Inputfield/InputfieldPageTitle/InputfieldPageTitle.js. var str1 would contain character "đ" and matching substitute in var str2 would be "d". More correct way would be that it is replaced by characters "dj", but variables are made to replace only single characters. Other Croatian characters that are found also in other languages are substituting fine, because they already exist in variable str1. Link to comment Share on other sites More sharing options...
ryan Posted August 30, 2011 Share Posted August 30, 2011 It's funny you should mention that because I just added ability for InputfieldPageTitle.js to convert single to multi-char about an hour ago. So we should be able to make it convert "đ" to "dj". Do you know if this is a fairly universal conversion? I'm not sure if this character appears in any other languages where it might be converted differently? Link to comment Share on other sites More sharing options...
nikola Posted August 30, 2011 Author Share Posted August 30, 2011 It appears in Croatian, Bosnian and Serbian languages. It is safe to convert it to "dj" because it's normal to substitute it in this way in these languages. Link to comment Share on other sites More sharing options...
ryan Posted August 30, 2011 Share Posted August 30, 2011 Sounds good, I've added this to the latest commit so that "đ" should now convert to "dj". Link to comment Share on other sites More sharing options...
slkwrm Posted September 15, 2011 Share Posted September 15, 2011 Hi Ryan, I have a request for adding transliteration of russian letters. Could you add this to InputfieldPageTitle.js? (It seems like it's time for me to learn some Git ) 1 to 1 letters: str1 = "абвгдеёзийклмнопрстуфыэ" str2 = "abvgdeeziiklmnoprstufye" 1 to >1 letters: srch = ['ж', 'х', 'ц', 'ч', 'ш', 'щ', 'ю', 'я'] repl = ['zh', 'kh', 'tc', 'ch', 'sh', 'shch', 'iu', 'ia'] ignored letters: ъ, ь The above matching is taken from the state standard for new passports ГОСТ Р 52535.1-2006 More info on Russian alphabet It may seem strange but there isn't any universal standard for russian alphabet letters transliteration. So it may become handy to have this match tables switchable somewere in PW. It would allow to choose transliteration standard (also may be handy for different locales of the website as transliteration of the same letters, possibly, may vary from language to language). Thank you! Link to comment Share on other sites More sharing options...
ryan Posted September 15, 2011 Share Posted September 15, 2011 Sure, I'll be happy to add this. I've added it to my list here: https://github.com/ryancramerdesign/P21/issues/51 So far I haven't come across any characters that need to be translated differently from language to language, but I've been wondering if they are out there. I'm guessing not, considering the relatively small scope of a-z 0-9 ascii. But if so, we will need to move this into a config option as you suggested (though we may do it either way). Link to comment Share on other sites More sharing options...
slkwrm Posted September 15, 2011 Share Posted September 15, 2011 Thank you, Ryan. Not sure about different transliteration in different langages, only assumed it. But only for Russian language there are several standards of transliteration and also not standardized but very popular common transliteration format. So maybe it makes sense to take it out to a config option in future. Link to comment Share on other sites More sharing options...
ryan Posted October 6, 2011 Share Posted October 6, 2011 These Russian characters have been added in the latest commit. Link to comment Share on other sites More sharing options...
slkwrm Posted October 6, 2011 Share Posted October 6, 2011 Thanks, Ryan! Link to comment Share on other sites More sharing options...
sakkoulas Posted February 13, 2013 Share Posted February 13, 2013 hi Ryan you can add also the transliteration of greek language if you want it. there is also a drupal transliteration module with (i think) all languages, i do not know if this can help you http://drupal.org/project/transliteration thanks. 'α' => 'a', 'ά' => 'a', 'αι' => 'ai', 'αί' => 'ai', 'αϊ' => 'aï', 'αυ' => 'ay', 'αύ' => 'ay', 'β' => 'v', 'γ' => 'g', 'γγ' => 'gg', 'γκ' => 'gk', 'γχ' => 'gch', 'δ' => 'd', 'ε' => 'e', 'έ' => 'e', 'ει' => 'ei', 'εί' => 'ei', 'έι' => 'ei', 'ευ' => 'ef', 'εϊ' => 'eï', 'ζ' => 'z', 'η' => 'i', 'ή' => 'i', 'θ' => 'th', 'ι' => 'i', 'ί' => 'i', 'κ' => 'k', 'λ' => 'l', 'μ' => 'm', 'μπ' => 'mp', 'ν' => 'n', 'ντ' => 'nt', 'ξ' => 'x', 'ο' => 'o', 'ό' => 'o', 'οι' => 'oi', 'οϊ' => 'oi', 'οί' => 'oi', 'ου' => 'oy', 'οϋ' => 'oy', 'ού' => 'oy', 'π' => 'p', 'ρ' => 'r', 'σ' => 's', 'ς' => 's', 'τ' => 't', 'υ' => 'y', 'ύ' => 'y', 'φ' => 'f', 'χ' => 'ch', 'ψ' => 'ps', 'ω' => 'o', 'ώ' => 'o', 2 Link to comment Share on other sites More sharing options...
petsagouris Posted April 8, 2013 Share Posted April 8, 2013 The transliteration character replacement array can be changed in the settings for the Page Title module. http://your.host.address/<processwire_admin_path>/module/edit?name=InputfieldPageName 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now