Currently, I'm building multi languages blog. As I know, almost WP language translator plugins are based on .po & .mo files. here is a problem. A new language what I'm going to add does not exist with .po & .mo files, it's just a dialect(local) language.
That's why I defined in php and grab the language.php files as below code.
header.php
<a href="<?php echo $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; ?>/?lang=newlanguage"> New Language</a>
<a href="<?php echo $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; ?>/?lang=eng">English</a>
function.php
<?php session_start();
$_SESSION['language'] = $_GET['lang'];
if ( $_SESSION['language'] == 'newlanguage' ) {
require (TEMPLATEPATH .'/languages/new-language.php');
}
else {
require (TEMPLATEPATH .'/languages/english.php'); // default language
} ?>
the problem is it doesn't work, if I load to the new page, "new-language" is disappear and it automatically changes to the default language.
My question is Can someone guide me to the right way/codes with developer solution?
.po
file, and its correspondent.mo
, don't exist, you have to create it yourself.