Jump to content

Extracting strings from HTML/PHP code for multilingual site


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.

Not quite sure on what you're meaning here but you could always store your content in a database and then just echo the content onto the page.

Normally what I do for my sites to simplify everything but I'm really not sure on what you want here sorry.

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;

 

 

 

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.

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.