Can any CAT handle PHP files?
Thread poster: suppster

suppster
Local time: 16:24
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?

 

Samuel Murray  Identity Verified
Netherlands
Local time: 17:24
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.


 

suppster
Local time: 16:24
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]


 

starspain
Spain
Local time: 17:24
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]


 

Thomas Johansson  Identity Verified
Peru
Local time: 11:24
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]


 

Thomas Johansson  Identity Verified
Peru
Local time: 11:24
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.


 

Heinrich Pesch  Identity Verified
Finland
Local time: 18:24
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.

 


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







Déjà Vu X3
Try it, Love it

Find out why Déjà Vu is today the most flexible, customizable and user-friendly tool on the market. See the brand new features in action: *Completely redesigned user interface *Live Preview *Inline spell checking *Inline

More info »
SDL Trados Studio 2019 Freelance
The leading translation software used by over 250,000 translators.

SDL Trados Studio 2019 has evolved to bring translators a brand new experience. Designed with user experience at its core, Studio 2019 transforms how new users get up and running, helps experienced users make the most of the powerful features, ensures new

More info »



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