Forum Moderators: coopster

Message Too Old, No Replies

Creating/Updating .po files with xgettext in PHP

What would be the right sythax to extract text from code?

         

lars stecken

7:13 pm on Nov 22, 2002 (gmt 0)

10+ Year Member



Greets everybody. Here's my problem:
I am building a medium sized CMS in PHP which has to be multilangual. My choice was to use "gettext" and my initial results where fine.

Now after having finished the biggest part of the project, I realize that when I extract the text-to-translate from my source code I get weird results. Probably because by default C++ keywords are being recognized, which is not what I want.

Is there a way to only extract text which is marked with the keyword "gettext()"?

Can anybody help me here?

jatar_k

7:31 pm on Nov 22, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



lars

can you explain this a little more please?

>> I get weird results. Probably because by default C++ keywords are being recognized

I think I know what you mean but not 100%. Maybe you could explain the weird results.

lars stecken

9:42 pm on Nov 22, 2002 (gmt 0)

10+ Year Member



Well, there's a lot of code pieces mixed in the .po file I create. I can't really pinpoint to a specific pattern...

It's not very comfortable to have all that stuff in this file.

Sorry, I think I cannot be more clear on this. May php is not fully supported by xgettext?!

jatar_k

9:49 pm on Nov 22, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



have you looked at this?

Gettext [php.net]

lars stecken

10:12 pm on Nov 22, 2002 (gmt 0)

10+ Year Member



Yes, I did. I actually read everything I could find on how to use gettext. Since I don't like command lines I am using poEdit which is a cool tool. Unfortunatelly there is no really comprehensive explanation on how to exctract text from PHP code manually recursive over many scripts.

But thanks for the hint anyways, greets Lars