Is there a way to use ProjectPier in Multilangual Modes?
I have some international project, but most are german project so I need mainly the german translation, otherwise, I need a English Interface for all my international clients.
By the way: I love your Script.
Hi Nachtmeister,
unfortunately, at the moment, it's not possible.
I started working on that but then it turned to something a little bit bigger, and then I got distracted :)
But it is my wish to get back to it and finish that...
Tim
OK, sounds good.
So is it possible to have two folders, one with German installation and one with English installation of projectpier, but use just one database? It looks possible in my eyes, but what do you think about that?
It could be a workaround...
It should work. You would need to change the config file so that the database info matches but the language is different.
However, you would probably have to use the database to store the files, otherwise it won't work. One thing that *could* work but sounds like the source of problems would be to replace the file folder of the second language with a symbolic link to the file folder of the main language... I have never tried that or heard about somebody doing it ;-)
Having two folders could be a good work-around, but be wary of that kind of details. Let us know if that works!
Tim
in the /config/config.php
replace:
define('DEFAULT_LOCALIZATION', 'en_us');with:
begin listing
**********************************************************************
//--- set easy vars!$ipaddr = $_SERVER['REMOTE_ADDR'];
$date = date('d/m/Y');
$time = date('H.i.s');
//--- set languages
$lang['nl'] = "The Netherlands";
$lang['us'] = "United States of America";
$lang['hu'] = "Hungarian";
$lang['de'] = "Germany";
$lang['fr'] = "France";
$lang['be'] = "Belgium";
$lang['au'] = "Australia";
$lang['se'] = "Sweden";
$lang['fi'] = "Finland";
$lang['uk'] = "United Kingdom";
//--- get country from hostname!
$hostname = gethostbyaddr($ipaddr);
$hostname_slizes = explode('.', $hostname);
$count_slizes = count($hostname_slizes);
$piece = $count_slizes - 1;
$extention = $hostname_slizes[$piece];
//--- check if country code is defined above
if ($lang[$extention])
$language = $lang[$extention];
else
$language = "Unknown";
if ($language == 'The Netherlands') {
define('DEFAULT_LOCALIZATION', 'nl_nl');
} elseif ($language == 'Germany') {
define('DEFAULT_LOCALIZATION', 'de_de');
} elseif ($language == 'Belgium') {
define('DEFAULT_LOCALIZATION', 'nl_nl');
} else {
define('DEFAULT_LOCALIZATION', 'en_us');
}
***********************************************************************
end of coding
I've only use the nl_nl, de_de and en_us language files, don't forget to install the language files on the server.
Henry
Hi Henry,
yes that would work but only in the case where the users are actually located in the country whose language they speak (or want to see in PP's UI). Also, in your example, Belgium would be a problem since half of it speaks French and the other half Dutch.
But that's an interesting work-around.
However, I'm not sure why you use the array $language.
Here is how I would simplify your code a little:
<?php//--- get country from hostname!
$ipaddr = $_SERVER['REMOTE_ADDR'];
$hostname = gethostbyaddr($ipaddr);
$country_tld = end(explode('.', $hostname));
switch(
$country_tld) {case 'nl':
define('DEFAULT_LOCALIZATION', 'nl_nl');
break;
case 'de':
define('DEFAULT_LOCALIZATION', 'de_de');
break;
case 'be':
define('DEFAULT_LOCALIZATION', 'nl_nl');
break;
default:
define('DEFAULT_LOCALIZATION', 'en_us');
}
?>
You could even use the fact that most language codes are like $country_tld."_".$country_tld
Tim