LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-15-2009, 09:57 AM   #1
lchxr
Member
 
Registered: Mar 2006
Posts: 42

Rep: Reputation: 15
Using catopen/catgets for international programming


I want to use catopen/catgets for international programming. I understand how to write a message source file, e.g. hello.msg and use 'gencat' to create a catalog file (.cat), and then use it in my C function.
Code:
gencat -o hello.cat hello.msg
In my hello.msg, I have
Code:
$set 100
10 "hello, world"
My question is: whether or not I can use #include "hello.h" in hello.msg file

for example, in hello.h
Code:
#define MSG_HELLO 10
in hello.msg
Code:
#include "hello.h"
$set 100
MSG_HELLO  "hello, world"
I have tried, but failed.

Does anyone know any method to extract a symbol from .h file and include it into .msg file?

Thank you.
 
Old 12-21-2009, 10:34 AM   #2
richardash1981
LQ Newbie
 
Registered: Aug 2006
Posts: 25
Blog Entries: 1

Rep: Reputation: 18
Suggest GNU Gettext as a much easier to use and more standard way to do translations of programs. It also does translation at run-time, so you don't have to recompile your program for new languages, just ship extra .mo files.

http://www.gnu.org/software/gettext/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] 9th BME International 24-hour Programming Contest challenge24 Programming 1 01-22-2009 06:38 PM
[SOLVED] 9th BME International 24-hour Programming Contest! challenge24 Programming 0 01-07-2009 11:23 PM
[SOLVED] 8th BME International 24-hour Programming Contest! challenge24 Programming 1 02-12-2008 12:23 PM
catgets qn... ugenn Programming 1 06-11-2004 09:19 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration