1

I'm trying to localize a 'C' project but I have no idea how to extract Strings by xgettext . And project has so many C files so extracting one by one is not feasible. S is it possible to extract strings from all files once. or there is any other way?

Thanks in advance

prasadmadanayake
  • 1,415
  • 15
  • 23

2 Answers2

4

You can pipe all of your *.c files to the xgettext program using xargs assuming you're on Linux/Mac, e.g:

~$ find MyFolder -name "*.c \
   | xargs xgettext --keyword=_ --language=C --output=messages.pot -

Be sure to pass - as the last parameter so it reads all files from stdin. Also you'll want to replace my simple keyword=_ example with the correct C function names.

Tim
  • 8,036
  • 2
  • 36
  • 52
0

From similar question in php, it is easy to know:

find . -iname "*.c" | xargs xgettext
Kearney
  • 153
  • 1
  • 5