Home Home Home
Home

Nov. 25, 2009    05:40 GMT

262 users online (50 registered)
4769 translation agencies
102126 registered users
.
Search
Members Log On

User Name

Password
Click to get help

THE HOW-TO LIBRARY


QUYET Ngo

How to Translate PHP Language File


By QUYET Ngo. Submitted on July 14, 2009

About the author: Ngo Tien Quyet is a freelance translator with 6 years experience in localization and translation, specializing in technical, IT and medical topics. He lives in Viet Nam and translates from English into Vietnamese.



There are variety of .PHP language files, but they have the same feature: the code and the text are separated by symbols. Therefore, we can extract the translatable text out and translate with CATs.

This short article shows how to translate the translatable text in a Joomla PHP language file.

Inside the Joomla PHP language file you will see:
….

DEFINE("_LANGUAGE","en");
DEFINE("_NOT_AUTH","You are not authorised to view this resource.");
DEFINE("_DO_LOGIN","You need to login.");
DEFINE("_MAIN_INCLUDES_HOME","Home");
DEFINE("_MAIN_INCLUDES_SEARCH","Search");
DEFINE("_MAIN_INCLUDES_NEW","New");
DEFINE("_MAIN_INCLUDES_TELEPHONE","Telephone:");
DEFINE("_MAIN_INCLUDES_CLOSE","Close Window");
DEFINE("_MAIN_INCLUDES_PRINT","Print Screen");
DEFINE("_MAIN_INCLUDES_BACK","Go Back");
DEFINE("_MAIN_INCLUDES_POSTMAIL","Thank you - you can now close this window.");
DEFINE("_MAIN_INCLUDES_RSS","Get the latest RSS feed listings");

…and here are my steps:

TO EXTRACT

  1. Select all text in your PHP file, copy & paste them into MS Excel (starting from the Column A, Row 1).
  2. Select all cells in the Column A, click the Data menu, click Text to Column, select the Delimited check box, and then click Next.
  3. In the Delimiters group box, click to clear Tab, Semicolon, Comma, and Space check boxes, select Other check box, type (") without parentheses in the accompanying text box, and then click Finish.
  4. You should now have five columns: A, B, C, D, E. The text in the Column D is what you need to translate.
  5. Select all cells in the Column D, copy & paste into a new MS Word or Excel file for translating.

TO CONCATENATE

  1. Select all translated text, copy & paste into all cells in the Column D.
  2. Insert a new column between A and B, between C and D, between E and F, between G and H.
  3. Enter (") without parentheses into all cells in four new columns B, D, F, H, which you got after insertions.
  4. Select the cell J1.
  5. For Excel 2003:
    On the Insert menu, click Function, choose Text category, double-click the CONCATENATE function.
    For Excel 2007:
    On the Formulas tab, in the Function Library group, click Text, select the CONCATENATE function.
  6. The Function Arguments dialog box appears, enter:
    A1 for Text1 box,
    B1 for Text2 box,
    C1 for Text3 box,
    D1 for Text4 box,
    E1 for Text5 box,
    F1 for Text6 box,
    G1 for Text7 box,
    H1 for Text8 box,
    I1 for Text9 box, and then click OK
  7. All PHP codes and your translation are now concatenated in the cell J1. Let’s copy the function and paste it into other cells in the Column J.
  8. Select all cells in the Column J, copy & paste over text on your PHP file. Now you got the final file for delivery.
Recommend this article: stumbleupon|digg|del.icio.us|reddit|facebook


    
TCTerms  TCTerms Stars Click to get help
Jane Lamb-Ruiz38319
Graham Oxtoby19532
Murad AWAD17819
Andrew Bramhall14514
Salah Ahmed13907
Hans Nadler13380
Giovanni Pizzati12930
Jaroslava Kamencová11443
Claude LeFrapper10892
Ghassan Ghosn8668
Top Users
.
Last Forum Postings:

RE: Selling a book translation to publishers in the US by Anne Simon 15 min. ago in Literary Translation forum.

All forums XML RSS Feed
.
Last Poll:

Vote or... create your poll.

Other polls
.
Featured How-To Articles: 
.
LINGUIST OF THE HOUR

TC Master Sigrid Thorbjørnsrud
TC Master
Sigrid Thorbjørnsrud


Fast, reliable and reasonable rates
.
TranslatorsCafé.com Copyright © ANVICA Software Development 2002—2009. All rights reserved.
Privacy Policy. Terms and Conditions of Use. Use signifies your agreement.
Mail comments and suggestions to TranslatorsCafe.com webmaster
Directory of translators, interpreters and translation agencies.