Tag (and eventually Translate) PHP files
Thread poster: Dudu Koren

Dudu Koren  Identity Verified
Local time: 21:33
Member (2010)
English to Hebrew
Jan 3, 2011


Using Translator workbench & TagEditor

I try to translate some tpl (template) files of a website using Trados.
The files are actually mix of HTML and PHP.
Trados doesn't tag php code, i didn't mind about that because i can just
go over the code segments and translate only required text.
The problem comes when i create the translated documents.
All "&" signs are replaced by & and the code becomes corrupted.

So my question is: is there a way to force Trados not to change this
special characters (& for example)?
It would have been great if i can just tag all PHP code (it's mostly between
{ and } signs) but i have no idea how to do this. Tried Preptags and this all
regex thing looks a bit too complicated for me.

Would love to hear your ideas.

some example from the original file:

Features :
{if $sm.sel_features && !$smarty.session.id_admin}
{html_multi_checkboxes name="room[features]"
options=$sm.room_features selected=$sm.sel_features columns=2
{html_multi_checkboxes name="room[features]"
options=$sm.room_features selected=$sm.sel_features columns=2}
Please select atleast one feature.

Room View

{if $sm.imgs}
{section name=cur loop=$sm.imgs}
{assign var=x value=$sm.imgs[cur]}


{if $smarty.section.cur.iteration % 2 ==0}

No Images


Soonthon LUPKITARO(Ph.D.)  Identity Verified
Local time: 01:33
Member (2004)
English to Thai
+ ...
DTD setting files Jan 3, 2011

In TagEditor, you can set tags of special PHP/HTML codes in DTD setting file (*.ini format). Go to menu of Option/tag settings.
Alternatively, I use *.itd (SDLX in T2007 package) format to translate PHP/HTML files with less troubles.

Soonthon Lupkitaro


Heinrich Pesch  Identity Verified
Local time: 21:33
Member (2003)
Finnish to German
+ ...
Easier in Word Jan 3, 2011

I would use Wordfast in Word for php. You can select the chunk that needs to be translated and don't change anything else.


Dudu Koren  Identity Verified
Local time: 21:33
Member (2010)
English to Hebrew
Thanks a lot for the ideas Heinrich and Soonthon! Jan 4, 2011

I'll consider your suggestions


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

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

Tag (and eventually Translate) PHP files

Advanced search

PerfectIt consistency checker
Faster Checking, Greater Accuracy

PerfectIt helps deliver error-free documents. It improves consistency, ensures quality and helps to enforce style guides. It’s a powerful tool for pro users, and comes with the assurance of a 30-day money back guarantee.

More info »
SDL MultiTerm 2019
Guarantee a unified, consistent and high-quality translation with terminology software by the industry leaders.

SDL MultiTerm 2019 allows translators to create one central location to store and manage multilingual terminology, and with SDL MultiTerm Extract 2019 you can automatically create term lists from your existing documentation to save time.

More info »

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