WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: advice for building chinese lang support extension ?  (Read 8487 times)

Offline david.w

  • Newbie
  • *
  • Posts: 38
advice for building chinese lang support extension ?
« on: December 16, 2010, 08:22:52 AM »
hi. i am thinking about building several Chinese language support extensions.

To display utf8 Chinese i need Chinese fonts. For proper gbk decoding, glibc locales are needed. To input Chinese characters, a input method is essential. For input methods to work xlib locales are required.

currently i am planing to pack them in the following manner:

zh-locale-bundle.tcz ... bundling locales from xlib and glibc
zh-locale-bundle-plus.tcz ... bundling more zh locales from the repo in to one?
zh-fontlinker.sh ... a script to add code to user's .xsession script to scan and linking ttf fonts from windows partition.
zh-fcitx.tcz ... basic input method (not quit smart)
zh-fcitx-config.tcz ... fcitx configure tool
zh-fcitx-sunpinyin.tcz advanced input method add-on
zh-sunpinyin.tcz ... sunpinyin engine

i am just a bit familiar with cygwin. I dont really know much about real Linux. I saw the wiki wrote

Quote
tar xjvf package_name.tar.bz2
cd package_name
./configure --prefix=/usr/local
make -j3
Note: -j3 is meant for a 2 processor system. The general guideline is -jN where N is 1 more than the total number of processors available.

so, i am on a single core pc, should I use -j2 or -j3 for the input method to work on most machines ? actually i have compiled the input method with no -j parameter. is it necessary to recompile?

i want to write some discription in Chinese in the extension info. which encoding should i use? utf-8 or gbk?

I saw the getlocal.sh, and tried it out. it works great. Is there any plan to integrate x11 locale stripping? then the zh-bundle would be unnecessary.

what do you think of the recipe i listed ?

Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #1 on: December 17, 2010, 12:11:47 AM »
after some thought , i think maybe i should pack the bitmap song font with locales required.

so now there will be
zh-suport.tcz --- locales and font
fcitx-*.tcz ---- input methord
I have sperated docs, skins, and tables from fcitx input method.

I hope its ok to bundle locales that are already in other packages into one extension. if no objection, i will submit them on Monday

Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #2 on: December 17, 2010, 12:16:59 AM »
PS: It turned out that flwm doesnt support Chinese display. the window title in chinese are always garbled. Openbox works fine for me.

Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #3 on: December 17, 2010, 04:14:14 AM »
the fltk lib is old. it lacks XIM input or CJK display support.
cant see CJK characters. can't input Chinese.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: advice for building chinese lang support extension ?
« Reply #4 on: December 17, 2010, 04:26:09 AM »
There is no stable FLTK 1.3 or 2.0 release. But the Japanese users have created ports of base apps to fltk 1.3, maybe you could check those out.
The only barriers that can stop you are the ones you create yourself.

Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #5 on: December 17, 2010, 05:54:05 AM »
hello Curage. I think you are right. fltk 1.3 maybe the solution. But since you said its unstable. I dont know if bundling them is proper or really needed. Now I am more reluctant to touch them.
But the fluff file manager looks really neat :) It's a pity that it's full of 'briks' when showing CJK files.
Btw, I saw the localization page. Since fltk 1.1 doesn't support displaying CJK fonts, I hope tc will not distribute CJK locales until moving onto fltk 1.3. The garbled UI looks worse.

Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #6 on: December 17, 2010, 08:16:26 AM »
some problems:
1 gnome-autogen(gnome-common) seems to require auto-conf. but is not listed as dependency.
2 i am afriad iBus input-platform is even bigger than tc itself. compiletc is far from enough :-[
  some one managed to build ibus IM in fluxbox
  http://www.theskycenter.info/blfs/ibus - i am really overwhelmed; he should write a book on this!
  i am stuck at ibus-pinyin, cant find "openphrase" package anywhere.
  its just a IM anyway, give up.

3 gtk.immodules is linked from gtk2.0 which makes it impossible for ibus to register as a gtk IM, (though it can still work as xim)

edit: give up ibus
« Last Edit: December 17, 2010, 09:40:57 AM by david.w »

Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #7 on: December 18, 2010, 08:47:40 AM »
tried w3m browser. turned out to be not useless. since i cant find any usable console to display chinese char :-S
But its funny ,you know, seeing all those images showing up in console, loaded by a text browser. :-D
links -g works like magic. unfortunately magic beyond CJK.


« Last Edit: December 18, 2010, 09:07:47 AM by david.w »

Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #8 on: December 18, 2010, 11:12:34 PM »
Hello forks.
I want to write a .install script to set the XMODIFIERS, LC_CTYPE env variables.
I used to insert them at the head of .xsessions. Where do you think is the preferred place in TC?

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: advice for building chinese lang support extension ?
« Reply #9 on: December 19, 2010, 02:28:44 AM »
As you can see in '~/.xsessions': Any file created in '~/.X.d' will be sourced during the execution of '~/.xsessions', so I'd say create your custom commands in a file there and give it a go.

Note: The 'home' directory is included in the backup "whitelist" (i.e. '/opt/.filetool.lst'), so your change should automatically "survive" the next re-boot (provided you've done a backup at shutdown, or explicitly via filetool.sh -b).
« Last Edit: December 21, 2010, 02:48:55 AM by maro »

Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #10 on: December 21, 2010, 01:44:40 AM »
hello, Maro. thanks for replying me. I have been very busy yesterday, so I didn't reply, nor did I submit the extension.
I tried your proposal today. but it didn't work. I think i have to assure that the variable is set as global wide. The wbar application does not respect my setup. Maybe it should be set earilier.
Any other place to suggest for an .install script ? Yeah, dirs are prefered, its always eaier to script for ppl like me. :)

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: advice for building chinese lang support extension ?
« Reply #11 on: December 21, 2010, 02:50:40 AM »
(1) I trust you did 'export VAR=VALUE' to set you custom variable.

(2) Clearly to have an impact on 'wbar' the variable setting via a file in '~/.X.d' would need to be brought forward in '~/.xsession' as 'wbar' gets started via the
    [ $(which "$ICONS".sh) ] && ${ICONS}.sh &
line.

So, as you will now have to change '~/.xsession' anyway you could either put your settings before the aforementioned line or still use a file in '~/.X.d' but swap the order of the last two lines in '~/.xsession' around.

Another (untested) idea that might work without requiring a change to '~/.xsession' would be to issue a new start of 'wbar' (e.g. using the commands from above) in the file in '~/.X.d' after setting of your variables. Not ideal to start 'wbar' twice, but changes to a Core file (like '~/.xsession') require more care and consideration (e.g. it would be better to make any changes to '/etc/skel/.xsession' which then forces a remastering of the initrd).

Note: I've corrected my typo in reply #9 ('~/.X.d' is the correct directory name)

Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #12 on: December 22, 2010, 10:41:39 AM »
Thanks maro, your suggestion works. I write my install script as your suggested.

I have a new questions regarding extensions:
the wiki said I should do
   chown root:staff path/to/.install/extensionname
As my script works in tc home directory, I think it should be  ok if i don't do so, is it?

PS:the submitqc script works fine here except some small glich:
 1. warning about depdency which are about to be submited
 2. no warning on root folders beyond /usr,/etc,/tmp,/home
 3. a suggestion:It would be great if it can fill extension size automatically ? I have split the IME into 13 extensions, its a bit tiring to edit all the infos :-p
   


Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #13 on: December 22, 2010, 12:43:29 PM »
Hi, everyone.

I am afraid, I fell in a permission hell now.
the IME demon needs to run in user mode, but the .installed script is run as root. the conf files the demon created all exclusively belonged to root...

So , is there anyway to determin current user's username? or run the install script at user level?

Thanks in advance, I appreciate any help. The extension is just 1 step from ready :-D

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: advice for building chinese lang support extension ?
« Reply #14 on: December 22, 2010, 01:09:27 PM »
cat /etc/sysconfig/tcuser


Btw, the unicode versions of base fltk apps have been posted, do they work for you?
The only barriers that can stop you are the ones you create yourself.