Jump to content

Extracting strings from HTML/PHP code for multilingual site


phdphd

Recommended Posts

Hi All,

 

I want my site to be available in different languages and wonder whether there exists a utility that helps extract from HTML/PHP code all the strings that are likely to be displayed to the user. This will be very helpful when entering the translation process.

 

Any idea or clue ?

 

Thanks.

Link to comment
Share on other sites

Hi,

 

Let me rephrase my question.

 

Imagine you developed a long time ago a website for a local audience, and that given its great success you decide to target it to other audiences in other countries. Is there a utility that enables to extract all translatable strings before sending them for translation ? "All" means extracting for example "My Website"  from

 

<title>My Website</title>

 

but also from 

 

echo 'My Website';

 

of from

 

echo $a .'My Website'. $b;

 

 

 

Link to comment
Share on other sites

You're going to have to write a function that sends the text to a translator and return those results.  Then before your outputs, you have to determine the location of the user (typically by IP address) and run it through your function with the language you're estimating it is.  The best thing to do is grab a majority of the most commonly spoken languages and use those for people to select from if your search fails or returns illegible.  Of course, you'll need native speakers to validate some of the returns before you can trust your source. 

 

Furthermore, you'll likely want to purchase domains in their locale (.co.uk, .it, .ru, etc etc) and redirect automatically with a preferenced language preset.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.