Showing posts with label farsi. Show all posts
Showing posts with label farsi. Show all posts

Sunday, July 27, 2008

farsi dictonary in ubuntu

for first you need to download Stardic dictionary in ubuntu .
http://wiki.ubuntu-ir.org/MehdiHassanpour/uploads?action=AttachFile&do=get&target=stardict_3.0.0-2_i386.deb

when package downloaded , double click on it and install package using package manager .

Close the Stardict if it's running .

then go to Babylon Glossary Page and download your favorite Glossary .
http://info.babylon.com/glossaries/8F3C/hFarsi___advanced_version.BGL

now you need to convert the bgl file ( bgl is the format of babylon glossary ) . to convert it you need a program call dictconv .
http://3v1n0.tuxfamily.org/pool/feisty/3v1n0/dictconv_0.2-0~3v1ubuntu1_i386.deb
when package downloaded , double click on it and install package using package manager . or (sudo dpkg -i dictconv_0.2-0~3v1ubuntu1_i386.deb)

when you installed dictconv , you should convert bgl file with this command in terminal :
dictconv test.BGL -o test.ifo
(test is the name of your downloded glossary )

the output of this command is three file :

test.ifo , test.idx , test.dict

now type this commands in terminal :
sudo apt-get install dictzip
dictzip test.dict
sudo apt-get install dictzip dictzip test.dict

this will convert your test.dict file to test.dz .
now put these files to a folder same as test :
test.ifo , test.idx , test.dz
then you should copy the " test " folder to Stardict dictionary directory . to do it :
sudo cp -r test /usr/share/stardict/dic
sudo cp -r test /usr/share/stardict/dic

now open Stardict again .

Thursday, February 14, 2008

java change keyboard layout

Visit the following article http://java.sun.com/products/jfc/tsc/articles/InputMethod/inputmethod.html
and read it carefully.

if you download and copy following jar file to /lib/ext you will have a menu item called "select input method" added to all swing applications.
http://java.sun.com/products/jfc/tsc/articles/InputMethod/InputMethodHotKey.jar

You can find full specification and api document here
http://java.sun.com/javase/6/docs/technotes/guides/imf/index.html

Finally the direct answer is here:
Any swing component which extends from java.awt.Window has a method called getInputContext(). You can change the input method like this, it will automatically change the keyboard layout when you focus the component.
for example"
yourMainJFrame.getInputContext().selectInputMethod(new Locale("fa", "IR"));