AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New Option/Plugin Request - Diacritic Letters

 
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English)
View previous topic :: View next topic  
Author Message
Kisiel



Joined: 05 May 2008
Posts: 2

PostPosted: Mon May 05, 2008 1:22 pm    Post subject: New Option/Plugin Request - Diacritic Letters Reply with quote

Hi, everone! Before using AkelPad i tried many other standard windows notepad replacements.
Metapad, LitePad, Notepad2, Notepad++, FastPad - all those are better than standard windows notepad but AkelPad
linking the best functions from them to one useful program. However few great functions still aren't
added. So I'm begging for new option/plugin:

"Change Diacritic Letters"

example:
*Polish (in php code):

<?

function convert_polish_letters($str){
$trans = array(
"Ą" => "A",
"ą" => "a",
"Ć" => "C",
"ć" => "c",
"Ę" => "E",
"ę" => "e",
"Ł" => "L",
"ł" => "l",
"Ń" => "N",
"ń" => "n",
"Ó" => "O",
"ó" => "o",
"Ś" => "S",
"ś" => "s",
"Ź" => "Z",
"ź" => "z",
"Ż" => "Z",
"ż" => "z",
);
return strtr($str, $trans);
}
?>


---
I think it can be great option for diffrent language too.
Czech: á, é, í, ó, ú, ý, č, ď, ě, ň, ř, š, ť, ž, ů
Livonian: ā, ä, ǟ, ḑ, ē, ī, ļ, ņ, ō, ȯ, ȱ, õ, ȭ, ŗ, š, ț, ū, ž.
Latvian: ā, ē, ī, ū, ŗ, ļ, ķ, ņ, ģ, š, ž, č
and many others

for full diacritic letters go to:
http://en.wikipedia.org/wiki/Diacritic

Thanks for great program and sorry for my bad english Wink
Back to top
View user's profile Send private message
Infocatcher



Joined: 06 Aug 2007
Posts: 1612

PostPosted: Mon May 05, 2008 5:19 pm    Post subject: Reply with quote

Kisiel, try Scripts plugin and following script:

Code:
var map = {
   "\u0104": "A",
   "\u0105": "a",
   "\u0106": "C",
   "\u0107": "c",
   "\u0118": "E",
   "\u0119": "e",
   "\u0141": "L",
   "\u0142": "l",
   "\u0143": "N",
   "\u0144": "n",
   "\u00D3": "O",
   "\u00F3": "o",
   "\u015A": "S",
   "\u015B": "s",
   "\u0179": "Z",
   "\u017A": "z",
   "\u017B": "Z",
   "\u017C": "z"
};

function replaceLetters(str) {
   for(var s in map)
      str = str.replace(new RegExp(s, "g"), map[s]);
   return str;
}

var AkelPad = new ActiveXObject("AkelPad.document");
AkelPad.ReplaceSel(
   replaceLetters(AkelPad.GetSelText())
);


For get "\u0104" I use JavaScript method escape:
Code:
javascript: void(prompt('', escape('Ą')));

(copy this line in address bar of browser and press <enter>. JS in address bar not works in IE...)

Or you can use AkelPad for this:
Code:
var AkelPad = new ActiveXObject("AkelPad.document");
AkelPad.ReplaceSel(
   escape(AkelPad.GetSelText())
);
Back to top
View user's profile Send private message Visit poster's website
Kisiel



Joined: 05 May 2008
Posts: 2

PostPosted: Mon May 05, 2008 6:11 pm    Post subject: Reply with quote

I already tryed to use 'Scripts plugin'
but whatever i try i get error occurted and akelpad close
I just reinstalled it to newest version with plugins but nothing changed.

First i think i deactivated vbs&js scripting in windows - thats not it.
Its strange because now i can't use any scrpit in akelpad.
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5311

PostPosted: Tue May 06, 2008 3:38 am    Post subject: Reply with quote

Kisiel
Check that Scripts plugin version is 3.2.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group