Link to home
Start Free TrialLog in
Avatar of AXISHK
AXISHK

asked on

Chinese translation in RedHat

I have used cconv to convert some Traditional to Simplified Chinese. However, some chars can't be converted succesfully.

Is it possible to add some chinese word mapping in a table / database ?

Tks
Avatar of Kimputer
Kimputer

While the file that contains all the characters during installation (cconv_table.cc) clearly states to NOT EDIT it, I would just try to edit it anyway. Add an entry and up the number under the table. Then compile and install again.
Since all the original files can be downloaded again, in case of failure, just reinstall the original package.

Using the original files from http://cconv.googlecode.com/

add your entry after:

language_zh_map map_uni_t2s[] = {

in the format:

{"龕", "龛", -1 },
{"trad", "simp", -1 },
etc


and then change

int map_uni_t2s_size = 4666;

to

int map_uni_t2s_size = 4668;

assuming you added two entries.
Avatar of AXISHK

ASKER

So, always add -1 after the two chinese chars.

Is there any document on this so that I can explore the detail further ?
Just add it exactly as I showed you. That includes the brackets, quotes and also -1.

There's no extra documentation on this, as it's generated out of the open source code. Maybe just email the original writers (it's all in the source code).

Just try it and see if it works, instead of waiting for the reply on the email (open source writers are usually busy enough as it is.
Avatar of AXISHK

ASKER

Just a curiosity, where can you know the usage of the counter, (eg. int map_uni_t2s_size ) ?

I have inspected the file, the line start from line number 8932 to 13597, total 4666 Lines.

So, if I add one line mapping, should the counter be 4667 instead of 4668 ?

Tks
Yes, add one line means adding one to that number. There's no documentation on this, it's just an educated guess. It even states in the file that you SHOULDN'T edit the file, since it's generated by a program not part of the open source. This is just a guess and a dirty hack. Unless you can contact the makers to update this old open source repository which may take more time or it's not possible at all (if the developers changed their email address). Just compile and test, it's just 5 minutes of work.
Avatar of AXISHK

ASKER

No, it doesn't work..

- Make changes in the file cconv_table.cc
  {"龜", "龟", -1 } /* 龜 => 龟 */,
        {"檔案", "档案", -1 }
};
int map_uni_t2s_size = 4667;

- then recompile the file
$ cd /tmp/cconv-0.6.2
$ ./configure --prefix=/usr/local
$ make
$ make install

- rerun the command but still return the previous result..
echo "檔案" | cconv -f utf-8 -t utf8-cn
文件
Avatar of AXISHK

ASKER

Just wonder whehter there is a possiblity that some files can't be overrided. However, I have used root for the installation..

Tks
Avatar of AXISHK

ASKER

Any idea the contact email for the cconv package ? It seems that it solves my problem by editing the file cconv_table.cc.. but it doesn't work after you have compile and make the file...

Tks
ASKER CERTIFIED SOLUTION
Avatar of Kimputer
Kimputer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AXISHK

ASKER

Tks.

I have cleaned up the cache and old files by running  "make distclean" before remaking the file again.