Quantcast
Channel: ProZ.com Translation Forums
Viewing all articles
Browse latest Browse all 3915

Can any CAT handle PHP files? | Re: Tagging a php file with strings

$
0
0
Forum: CAT Tools Technical Help
Topic: Can any CAT handle PHP files?
Poster: Stanislav Okhvat
Post title: Re: Tagging a php file with strings

Hello John,

Actually, you can use something as simple as Microsoft Word to hide everything except specific text which is within these quotation marks. TransTools+ ( [url removed] ) contains a tool called Hide/Unhide Text ( [url removed] ) which can hide everything that does not match a specific regular expression. The regular expression settings for this purpose are:

Options:
Hide everything except specific text
Hide by text or regular expressions

Add an item to the list

Type:
Regex

Find What:
['"][^'"]+['"]\s*=>\s*(["'])((?:(?=(\\?))\3.)*?)\1

Options:
Find capturing group instead of the full regular expression match
Group 2

This will hide all the document content except the text which is within the quotation marks after =>, e.g.

'group_id' => 'oră sferă',
'observe_user_id' => 'CEE carbonat nave',

This will also handle escaped quotation marks correctly, as well as different quotation marks which can be used in PHP associative arrays.

Once the content is hidden, you can import the Word document into any CAT tool that supports hidden formatting (Studio, memoQ, Wordfast Pro, Déjà Vu X, Memsource, SmartCAT). Once the document is translated, open it in Word and use the Unhide command.

Best regards,
Stanislav Okhvat
TransTools – Useful tools for every translator

Viewing all articles
Browse latest Browse all 3915