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
AXISHKAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KimputerCommented:
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.
AXISHKAuthor Commented:
So, always add -1 after the two chinese chars.

Is there any document on this so that I can explore the detail further ?
KimputerCommented:
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.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

AXISHKAuthor Commented:
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
KimputerCommented:
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.
AXISHKAuthor Commented:
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
文件
AXISHKAuthor Commented:
Just wonder whehter there is a possiblity that some files can't be overrided. However, I have used root for the installation..

Tks
AXISHKAuthor Commented:
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
KimputerCommented:
In case you notice it was already translating, but to something incorrect, then you need to REPLACE the entry. You only ADD the entry if the translation gives NOTHING back.

change this line:

{"檔案", "文件", -1 } /* 檔案 => 文件 */,

to

{"檔案", "档案", -1 } /* 檔案 => 文件 */,

When editing a line, do NOT add the number. Only add a number to the total if you ADD a NEW line.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AXISHKAuthor Commented:
Tks.

I have cleaned up the cache and old files by running  "make distclean" before remaking the file again.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.