Currently, I'm developping a very big project, with lots of pages, and I'm thinking which could be the best, and fastest, way to translate all the pages with PHP. I was looking for Po Edit, but actually I don't like it. Is there any other way to translate pages?
The way I do this on my websites is with separate php 'languages' files, and an associative array.
<?php
//english file - lang.english.php
$language = array(
"hello" => "hello",
"today" => "today",
);
?>
<?php
//welsh file = lang.welsh.php
$language = array(
"hello" => "helo",
"today" => "heddiw",
);
?>
Then simply include()
lang.english.php or lang.welsh.php depending on which language the user selected and use <?php $language["hello"]; ?>
in your html to reference to translations.
This method assumes that you know the translations for each languages, and it may take a long time to create these language files, but once you have completed one it becomes very easy to add more.