|
codetwist
|
 |
« Reply #30 on: June 01, 2007, 10:04:21 PM » |
|
Thx, rubenpol 
|
|
|
|
|
Logged
|
|
|
|
edsil
Jr. Member

Karma: 4
Posts: 92
|
 |
« Reply #31 on: June 14, 2007, 06:08:57 PM » |
|
ehmmm... sorry, but it doesnt work for me... :/ First I installed a news fresh sNews version, then I turned to spanish configuration and then into the snews.php I erased this: // generate SEF urls function genSEF(from,to) { if (allowsef == true) { var str = from.value.toLowerCase(); str = str.replace(/[^a-z 0-9]+/g,''); str = str.replace(/\s+/g, "-"); to.value = str; } } and put this: // generate SEF urls function genSEF(from,to) { if (allowsef == true) { // MOD - 20070106 - Replaces characters specific to local language with available lowercase equivalent // Original code // var str = str.toLowerCase(); var str = deLocalize(from.value); str = str.toLowerCase(); // End of MOD - 20070106 - Replaces characters specific to local language with available lowercase equivalent //str = str.replace(/[^a-zA-Z 0-9]+/g,''); str = str.replace(/[^a-z 0-9]+/g,''); str = str.replace(/\s+/g, "-"); to.value = str; } } and under this I put this: function deLocalize( inStr ) { var outStr = inStr; outStr = outStr.replace(/[çÇ]/g, 'c'); outStr = outStr.replace(/[üÜ]/g, 'u'); outStr = outStr.replace(/[ïÏ]/g, 'i'); outStr = outStr.replace(/[áÁ]/g, 'a'); outStr = outStr.replace(/[àÀ]/g, 'a'); outStr = outStr.replace(/[éÉ]/g, 'e'); outStr = outStr.replace(/[èÈ]/g, 'e'); outStr = outStr.replace(/[íÍ]/g, 'i'); outStr = outStr.replace(/[óÓ]/g, 'o'); outStr = outStr.replace(/[òÒ]/g, 'o'); outStr = outStr.replace(/[úÚ]/g, 'u'); return outStr; } I validate, and create a new article using spanish characters: El niño y el cajón (the boy and the box), and I get: el nio y el cajn where is the error, do I need to do any other manipulation? thanks for answers...
|
|
|
|
|
Logged
|
|
|
|
bramsyuur
sNews Dude
Hero Member
   
Karma: 23
Posts: 899
|
 |
« Reply #32 on: June 14, 2007, 08:14:56 PM » |
|
Hi esdil, First, remember to add into your "delocalized" strings this line: outStr = outStr.replace(/[ñÑ]/g, 'n'); to get Ñ and ñ  And second, the most important thing, take care to save your current snews.php file in UTF-8 without BOM. If you don't have a program to get this option, I suggest to you to use the free editor Notepad++ (really good in case that you're using window$) Here's the link: http://notepad-plus.sourceforge.net/es/site.htm
|
|
|
|
|
Logged
|
|
|
|
edsil
Jr. Member

Karma: 4
Posts: 92
|
 |
« Reply #33 on: June 15, 2007, 10:18:32 AM » |
|
Hola bramsyuur, Thanks for the Notepad++ it works just fine... but I still have a problem... So I create my article called "El niño y el cajón (the boy and the box)", and I get in the SEF: El nino y el cajon"... so all goes fine... but it seems not to be recording into the data base... there is no article with this name into the data base and there is no article into my sNews site... I'm very sorry if I came with my problems...
|
|
|
|
|
Logged
|
|
|
|
Patric Ahlqvist
Nobodys perfect, but Im pretty effing close
Administrator
ULTIMATE member
    
Karma: 65
Posts: 4916
“I'm a self-made man and worships my creator.”
|
 |
« Reply #34 on: June 15, 2007, 10:34:07 AM » |
|
Another, and in my opinion better text editor (no offence Bram): http://www.crimsoneditor.com/
|
|
|
|
|
Logged
|
|
|
|
edsil
Jr. Member

Karma: 4
Posts: 92
|
 |
« Reply #35 on: June 15, 2007, 01:19:07 PM » |
|
Hello Patric! Thanks a lot for your text editor, it is working just GREAT! So no problem with SEF, data base or other... all goes fine now Thanks to you all for kindy help 
|
|
|
|
|
Logged
|
|
|
|
piXelatedEmpire
MIA
Thread Moderator
ULTIMATE member
   
Karma: 37
Posts: 1456
currently MIA
|
 |
« Reply #36 on: June 16, 2007, 03:03:09 AM » |
|
ahhh yes, everyone loves crimson editor 
|
|
|
|
|
Logged
|
my apologies to the sNews crew, but I will be MIA for the forseeable future
|
|
|
|
Luka
|
 |
« Reply #37 on: September 18, 2007, 10:01:58 AM » |
|
Croatian:function deLocalize( inStr ) { var outStr = inStr; outStr = outStr.replace(/[ćĆ]/g, 'c'); outStr = outStr.replace(/[čČ]/g, 'c'); outStr = outStr.replace(/[đĐ]/g, 'dj'); outStr = outStr.replace(/[šŠ]/g, 's'); outStr = outStr.replace(/[žŽ]/g, 'z'); return outStr; }
|
|
|
|
|
Logged
|
|
|
|
|
codetwist
|
 |
« Reply #38 on: September 18, 2007, 07:38:43 PM » |
|
Thx, Luka 
|
|
|
|
|
Logged
|
|
|
|
Vasile Rusnac
Newbie
Karma: 7
Posts: 49
|
 |
« Reply #39 on: September 18, 2007, 08:27:59 PM » |
|
Romanian function deLocalize( inStr ) { var outStr = inStr; outStr = outStr.replace(/[ăĂ]/g, 'a'); outStr = outStr.replace(/[âÂ]/g, 'a'); outStr = outStr.replace(/[îÎ]/g, 'i'); outStr = outStr.replace(/[şŞ]/g, 's'); outStr = outStr.replace(/[ţŢ]/g, 't');
return outStr; } P.S. I love Notepad ++ editor 
|
|
|
|
« Last Edit: September 18, 2007, 08:29:51 PM by Vasile Rusnac »
|
Logged
|
|
|
|
|
codetwist
|
 |
« Reply #40 on: September 19, 2007, 10:16:38 PM » |
|
Thx, Vasile 
|
|
|
|
|
Logged
|
|
|
|
Aysseline
Jr. Member

Karma: 4
Posts: 66
|
 |
« Reply #41 on: December 12, 2007, 01:29:43 PM » |
|
Hi codetwist I've got a problem with this MOD. It works fine for sef title but make me a problem in admin panel with toogle function (I think) Now when I click in each toogle menu nothing append I can't open any menus My sef title version for french#MOD generate SEF urls readable non-english function genSEF(from,to) { if (allowsef == true) { var str = deLocalize(from.value); str = str.toLowerCase(); str = str.replace(/[^a-z 0-9]+/g,''); str = str.replace(/\s+/g, "-"); to.value = str; } } function deLocalize( inStr ) { var outStr = inStr; outStr = outStr.replace(/[à]/g, 'a'); outStr = outStr.replace(/[â]/g, 'a'); outStr = outStr.replace(/[é]/g, 'e'); outStr = outStr.replace(/[è]/g, 'e'); outStr = outStr.replace(/[ê]/g, 'e'); outStr = outStr.replace(/[ï]/g, 'i'); outStr = outStr.replace(/[ô]/g, 'o'); outStr = outStr.replace(/[ù]/g, 'u'); outStr = outStr.replace(/[ü]/g, 'u'); return outStr; } #MOD generate SEF urls readable non-english END My toogle script, I don't change anything here // toggle dynamic divs // 1.6.0 - revised. function toggle(div) { var elem = document.getElementById(div); if (elem.style.display=='') {elem.style.display='none'; return;} elem.style.display=''; } // dependancy limiter // 1.6.0 - revised. function dependancy() { var category = document.forms['post']['define_category']; var page = document.getElementById('def_page'); page.style.display = category.options[category.selectedIndex].value == '-1' ? 'inline' : 'none'; } When I revert with original code, all works but I don't have foreign sef title 
|
|
|
|
|
Logged
|
sNews 1.6_patched - localhost, Xampp 1.6.2 - XPSP2
|
|
|
Aysseline
Jr. Member

Karma: 4
Posts: 66
|
 |
« Reply #42 on: December 12, 2007, 02:15:49 PM » |
|
Resolved ! my fault I put my comments like this: # blabla
but it's in javascript need to be // blabla
|
|
|
|
|
Logged
|
sNews 1.6_patched - localhost, Xampp 1.6.2 - XPSP2
|
|
|
|
codetwist
|
 |
« Reply #43 on: December 13, 2007, 08:28:22 AM » |
|
Good 
|
|
|
|
|
Logged
|
|
|
|
sNews_RU
Newbie
Karma: 0
Posts: 2
|
 |
« Reply #44 on: January 17, 2008, 11:13:04 PM » |
|
In russian version by Eugeny (Reply #21) is disgraceful mistakes: incomplete russian alphabet and etc. Use this by sNews_RU: function deLocalize( inStr ) { var outStr = inStr; outStr = outStr.replace(/[аА]/g, 'a'); outStr = outStr.replace(/[бБ]/g, 'b'); outStr = outStr.replace(/[вВ]/g, 'v'); outStr = outStr.replace(/[гГ]/g, 'g'); outStr = outStr.replace(/[дД]/g, 'd'); outStr = outStr.replace(/[еЕ]/g, 'e'); outStr = outStr.replace(/[ёЁ]/g, 'yo'); outStr = outStr.replace(/[жЖ]/g, 'zh'); outStr = outStr.replace(/[зЗ]/g, 'z'); outStr = outStr.replace(/[иИ]/g, 'i'); outStr = outStr.replace(/[йЙ]/g, 'y'); outStr = outStr.replace(/[кК]/g, 'k'); outStr = outStr.replace(/[лЛ]/g, 'l'); outStr = outStr.replace(/[мМ]/g, 'm'); outStr = outStr.replace(/[нН]/g, 'n'); outStr = outStr.replace(/[оО]/g, 'o'); outStr = outStr.replace(/[пП]/g, 'p'); outStr = outStr.replace(/[рР]/g, 'r'); outStr = outStr.replace(/[сС]/g, 's'); outStr = outStr.replace(/[тТ]/g, 't'); outStr = outStr.replace(/[уУ]/g, 'u'); outStr = outStr.replace(/[фФ]/g, 'f'); outStr = outStr.replace(/[хХ]/g, 'h'); outStr = outStr.replace(/[цЦ]/g, 'c'); outStr = outStr.replace(/[чЧ]/g, 'ch'); outStr = outStr.replace(/[шШ]/g, 'sh'); outStr = outStr.replace(/[щЩ]/g, 'sh'); outStr = outStr.replace(/[ъЪ]/g, ''); outStr = outStr.replace(/[ыЫ]/g, 'y'); outStr = outStr.replace(/[ьЬ]/g, ''); outStr = outStr.replace(/[эЭ]/g, 'e'); outStr = outStr.replace(/[юЮ]/g, 'yu'); outStr = outStr.replace(/[яЯ]/g, 'ya'); return outStr; }
|
|
|
|
|
Logged
|
|
|
|
|