Can any CAT handle PHP files?
Thread poster: suppster

suppster
Local time: 17:30
Mar 31, 2011

I've read on the forums that Deja Vu and Catscradle can import PHP files and present only what needs to be translated. However, the reports have been sketchy, with some having poor results with these tools. There is also PrepTags. Can any of these tools definitely deal with PHP files?

Direct link Reply with quote
 

Samuel Murray  Identity Verified
Netherlands
Local time: 18:30
Member (2006)
English to Afrikaans
+ ...
No Mar 31, 2011

suppster wrote:
Can any of these tools definitely deal with PHP files?


No. The reason for that is that there is no "standard" PHP file. It is entirely up to the programmer or web designer to decide how to mark up translatable text. So every PHP job is unique.


Direct link Reply with quote
 

suppster
Local time: 17:30
TOPIC STARTER
filter for Trados Mar 31, 2011

Would it be possible then to create a filter for Trados? Apparently, 'In TagEditor, you can set tags of special PHP/HTML codes in DTD setting file (*.ini format).' If so would this need to be created separately for each PHP project, or could one filter work for all PHP files?

This thread also says this can be done:
http://mac.proz.com/forum/localization/29390-php_localisation:_dtd_settings.html



[Edited at 2011-03-31 12:20 GMT]


Direct link Reply with quote
 

starspain
Spain
Local time: 18:30
Spanish to German
+ ...
Transit can Mar 31, 2011

Hello Suppster, Transit can handle PHP files (and in fact any tagged text file format), but it might be necessary to adjust the file format definition to correctly protect the PHP tags because of what Samuel said, the possible customization of PHP files. Regards, Michael

suppster wrote:

Would it be possible then to create a filter for Trados? Apparently, 'In TagEditor, you can set tags of special PHP/HTML codes in DTD setting file (*.ini format).' If so would this need to be created separately for each PHP project, or could one filter work for all PHP files?

This thread also says this can be done:
http://mac.proz.com/forum/localization/29390-php_localisation:_dtd_settings.html



[Edited at 2011-03-31 12:20 GMT]


Direct link Reply with quote
 

Thomas Johansson  Identity Verified
Peru
Local time: 12:30
Member (2005)
English to Swedish
+ ...
just a few notes on PHP Mar 31, 2011

PHP files usually contain a mixture of two things: portions of HTML (or similar markup) and portions of PHP code proper.

As for the HTML portions of a PHP file, I assume that if you have a tool that can process HTML, then you could probably use it to process the HTML portions of a PHP file as well. (Perhaps try this: replace the .php file extension with .html, and see if your tool will process it. You may need to take measures for the tool not to touch the PHP portions inside the file.)

As for the PHP code proper, it is a scripting language and doesn't use tags similar to those of HTML. The only thing that could possibly be called tags here would be the PHP start and end tags, which indicate where the PHP code starts and ends respectively. (Sorry, this form doesn't allow for insertion of these PHP tags, so I cannot show them here.)
Inside such PHP code, any text that might be relevant for translation would be in the form of so-called strings, which are strings of characters enclosed by double or single quotes. (However, one needs to be careful here, because some such strings might just be used for the internal code and should not be translated.)
Anyway, in general, when building a PHP site intended for publication in more than one language, you try to avoid including textual content in the PHP code itself (i.e. as strings as per above). Instead, you use identifiers and draw the text snippets from an external resource, such as a database or data file, or use some similar method - i.e. all translatable content in this case would be in a database or a data file separate from the PHP file itself.

Overall, my guess is that if you have a PHP file that you've been asked to translate, you probably just need to focus at the HTML portions themselves. And use a tool that can process HTML.

[Edited at 2011-03-31 18:50 GMT]

[Edited at 2011-03-31 18:51 GMT]

[Edited at 2011-03-31 18:53 GMT]


Direct link Reply with quote
 

Thomas Johansson  Identity Verified
Peru
Local time: 12:30
Member (2005)
English to Swedish
+ ...
true, but Mar 31, 2011

Samuel Murray wrote:

suppster wrote:
Can any of these tools definitely deal with PHP files?


No. The reason for that is that there is no "standard" PHP file. It is entirely up to the programmer or web designer to decide how to mark up translatable text. So every PHP job is unique.


True, every PHP job and file is unique.

But still all translatable text in a PHP file will either be in the form of HTML (with corresponding HTML tags) or in the form of PHP strings (which are characterized by being enclosed within double or single quotes).

So, for a tool to work, it just needs to be able to either recognize HTML tags or, when inside PHP code proper, recognize any strings enclosed within such quotes.


Direct link Reply with quote
 

Heinrich Pesch  Identity Verified
Finland
Local time: 19:30
Member (2003)
Finnish to German
+ ...
Trust your eyes only Apr 1, 2011

Its years since I translated php. I used Wordfast Classic and forced segmentation. So you really know each time that you are translating only the right strings.

Direct link Reply with quote
 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Can any CAT handle PHP files?

Advanced search







Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

More info »
TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search