MyBB Community Forums

Full Version: Change language?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I really need help.How can I change the language in mybb. How do I know which files to edit?Is there a tutorial somewhere?
Hi,

You need to know first if a translation already exist for your language. If it doesn't exist, you'll have to do it yourself.

The language files to edit are in /inc/language/english (relative to the mybb folder). Of corse, you don't edit these files, but rather a copy of them. And you need to create a file in the language folder by the name of your language so that myBB knows it exists. Look into it, it's quite simple to understand.

In this folder you have a bunch of language files and an admin folder in which there are the language files for the admin panel.

I suggest that you use the excellent tool created by KeyStorm (MyBB Translator script. Look at page 4 for the most recent version of the script, but read the thread it will help you use it.)

And, I'm available to help out as I'm currently using it to finish the french translation.

After you're done, you go in Admin CP -> Change -> General Configuration -> Default Language

To set the language of the Admin Cp itself: Admin CP -> Change -> Control Panel Preferences (Global) -> Control Panel Language

Michel
Thanks for helping me, but it won't work.I'm trying to translate into swedish.
I changed this line in swedish.php:

<?php
$langinfo['name'] = "English (American)";
$langinfo['author'] = "MyBulletinBoard";
$langinfo['version'] = "1.0rc3";
$langinfo['admin'] = 1;
?>

Into:

<?php
$langinfo['swedish'] = "swedish";
$langinfo['author'] = "MyBulletinBoard";
$langinfo['version'] = "1.0rc3";
$langinfo['admin'] = 1;
?>

And I changed this line in translator.php:

$language_name = 'german'; //this value must be set to the name in English of the translation

Into:

$language_name = 'swedish'; //this value must be set to the name in English of the translation


What is wrong?
Try turning:

$langinfo['version'] = "1.0rc3";

into

$langinfo['version'] = "1.0rc4";
Do you have the file translator.php in the /inc folder? When you execute the script, what does it tell you?
k776 Wrote:try tunring

$langinfo['version'] = "1.0rc3";

into

$langinfo['version'] = "1.0rc4";

I have $langinfo['version'] = "1.0rc3" and the script works fine (great tool by the way!)
Changing 1.0rc3 into 1.0rc4 didn't work.
When I try to access to translator.php i get this:

','',$file); foreach($file as $key => $line) { if( $line{0} != '[' ) { unset($file[$key]); continue; } if (strpos($line,"['".$_POST['write_key']."']") !== false) { if ($auto_html_convert) { if (preg_match("/^email/", $_POST['write_key'])) { $transl = $_POST['write_translation']; } else { $transl = htmlentities($_POST['write_translation']); $transl = str_replace(array(">", "<", """, "&"), array(">", "<", "\"", "&"), $transl); } } else { $transl = $_POST['write_translation']; } $file[$key] = '[\''.$_POST['write_key'].'\'] = "'.stripslashes($transl).'";'."\n"; } $file[$key] = '$l'.$file[$key]; } $file = implode('',$file); $file = ""; $fp = fopen($dir.$_POST['write_file'].'.lang.php',"wb+"); flock($fp,LOCK_EX); fwrite($fp,$file); flock($fp,LOCK_UN); fclose($fp); } } //basedir read process if (is_dir($dir) ) { if ($dh = opendir($dir)) { $debug = "dirread"; while (($file = readdir($dh)) !== false) { if (eregi("([^\.]+)\.lang.php",$file,$files)) { if (!is_array($_SESSION['expand']) || !array_key_exists($file,$_SESSION['expand'])) $_SESSION['expand'][$file] = false; //this remembers which files were expanded and which weren't include $dir.$file; foreach ($l as $key => $var) { $trans[$files[1]][$key] = $var; } unset($l); include $path."english/".$file; foreach ($l as $key => $var) { $orig[$files[1]][$key] = $var; } foreach($l as $key => $var) { $editfile = ($_GET['key'] == $key) ? $file : NULL; $status[$files[1]][$key] = !($orig[$files[1]][$key] == $trans[$files[1]][$key]); } unset($l); } } closedir($dh); } } //admin dir read process $dir = $dir."/admin/"; if (is_dir($dir) ) { if ($dh = opendir($dir)) { $debug = "dirread"; while (($file = readdir($dh)) !== false) { if (eregi("([^\.]+)\.lang.php",$file,$files)) { if (!is_array($_SESSION['expand']) || !array_key_exists($file,$_SESSION['expand'])) $_SESSION['expand'][$file] = false; //this remembers which files were expanded and which weren't include $dir.$file; foreach ($l as $key => $var) { $trans['admin/'.$files[1]][$key] = $var; } unset($l); include $path."english/admin/".$file; foreach ($l as $key => $var) { $orig['admin/'.$files[1]][$key] = $var; } foreach($l as $key => $var) { $editfile = ($_GET['key'] == $key) ? $file : NULL; $status['admin/'.$files[1]][$key] = !($orig['admin/'.$files[1]][$key] == $trans['admin/'.$files[1]][$key]); } unset($l); } } closedir($dh); } } //building status array foreach ($orig as $file => $var) { foreach($var as $lang_key => $lang_string) { $status[$file][$lang_key] = ($lang_string != $trans[$file][$lang_key]); } } switch ($_GET['show'].'') { case 'list': //left frame: key listing /* if(isset($_POST['write_file'],$_POST['write_key'])) header("Location: $_SERVER[PHP_SELF]?file=$_POST[write_file]&key=$_POST[write_key]&show=list#next"); */ ?> '; if(isset($_GET['touch'])) $_SESSION['expand'][$_GET['touch']] = (!$_SESSION['expand'][$_GET['touch']]); foreach($orig as $key => $var) { $class_file_child = in_array(false, $status[$key]) ? '' : '-done'; echo '
'.$key.'
'."\n"; foreach($var as $lang_key => $lang_string) { if($lang_key != $_GET['key']) $class = 'key-'.(($status[$key][$lang_key]) == 1 ? 'done' : 'undone'); else $class = 'key-active'; $name = $next ? 'next' : $lang_key; if($_SESSION['expand'][$key]) { $link = $_SERVER['PHP_SELF'].'?file='.$key.'&edit='.$lang_key.'&show=body'; echo '
'.str_replace('_',' ',$lang_key).'
'."\n"; } if($lang_key == $_GET['write_key'] && isset($_GET['next'])) $next=true; else $next = NULL; } } ?>


And after that it says


Not Found
The requested URL /members/filemanager/< was not found on this server.
hm, ok. Well, make sure the files are in the right place (inc/, not /members/filemanager/) like alslg.org said, and you copied the contents of english/ to a folder called swedish/ (or renamed the enlgish/ folder to swedish/), it should get rid of that. hopefully.
Umm... doesn't look like PHP is installed to me. Otherwise you wouldn't be getting a bunch of PHP code.
Yeah, but why would he want to change the language if myBB didn't install? I thought perhaps KeyStorm coded it like that Confused Very odd.
Pages: 1 2