1 (edited by bernt 2004-01-16 23:50)

Topic: Installing new language

Hi! I've translated the forum to Norwegian but it does not seem possible to install the language files... I have edited the file config.php (the line $language = 'en'; has been changed to $language = 'no';) but I just get the error message "There is no valid language pack 'en' installed. Plese check $language setting in config.php."...

Any suggestions?

Re: Installing new language

Well, that shouldn't happen. The only reason the error message "There is no valid language pack 'en' installed." would appear is if $language is in fact set to 'en' in config.php. Are you absolutely sure you've changed it? You couldn't just have edited the wrong config.php or forgotten to upload it or something?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3

Re: Installing new language

I'll check again...

4

Re: Installing new language

I've checked and no matter what I do I get the error message mentioned earlier ("There is no valid language pack 'en' installed. Plese check $language setting in config.php). I have checked the file config.php in the directory /forum/lang/en and additionally /forum/lang/no and they are the same except from the line $language = '..';

I really need some help, is it possible to publish or mail anyone any of the files?

Re: Installing new language

The file config.php should not be in those directories. It's the one in the forum root directory.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

6

Re: Installing new language

My fault, there are no config.php files in those directories, only in the root directory. The files I was refering to are the en_common.php and no_common.php files...

7

Re: Installing new language

My question is; Should I edit the no_common.php file to reflect on the language settings? This is how the first lines are edited in the no_common.php file:

<?php

// Determine what locale to use
switch (PHP_OS)
{
    case 'WINNT':
    case 'WIN32':
        $locale = 'norwegian';
        break;

    case 'FreeBSD':
    case 'NetBSD':
    case 'OpenBSD':
        $locale = 'no_NO.ISO8859-1';
        break;

    default:
        $locale = 'no_NO';
        break;
}

// Attempt to set the locale (required for fulltext indexing to work correctly)
setlocale(LC_CTYPE, $locale);


// Language definitions for frequently used strings
$lang_common = array(

// Text orientation and encoding
'lang_direction'        =>    'LTR',    // LTR (Left-To-Right) or RTL (Right-To-Left)
'lang_encoding'            =>    'iso-8859-1',

Re: Installing new language

No, you shouldn't edit anything in the language files. I'm sorry, but I have no idea what might be wrong. If you like, I can probably help you out, but then I will need to have a look at your files. Drop me an e-mail and I'm sure we can work something out.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

9 (edited by bernt 2004-01-18 23:55)

Re: Installing new language

I think I know what the problem could be; In the file no_common.php an apostrophe was not closed (\') - could this cause such problems?

Re: Installing new language

Maybe. I'm not sure I know what you mean though. Could you send me the language pack?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

11

Re: Installing new language

bernt wrote:

I think I know what the problem could be; In the file no_common.php an apostrophe was not closed (\') - could this cause such problems?

If you mean single quotation marks were not closed i.e. instead of
'xxxx'
you had
'xxx
then that would do it. I did exactly the same thing when editing an English language file. It throws up an error because there is an unterminated string.

Re: Installing new language

But that would lead to a parse error and not "There is no valid language pack 'en' installed".

"Programming is like sex: one mistake and you have to support it for the rest of your life."

13 (edited by ps21 2004-01-19 03:17)

Re: Installing new language

I deleted a closing quotation mark in en_common.php to make this line

'Delete posts'  =>  'Delete multiple posts,

(note the missing end quotation mark)

I uploaded the doctored file to my server. Now take a look
http://www.post21.co.uk/punbb

Re: Installing new language

Well, I'll be damned :) I'm gonna have to have a look at that tomorrow. I have no idea why that happens.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

15 (edited by ps21 2004-01-19 11:56)

Re: Installing new language

BTW: exactly the same thing happens if you leave out the closing comma.

I just had an idea.

if (!isset($lang_common))
    exit('There is no valid language pack \''.$language.'\' installed. Plese check $language setting in config.php.');

The whole of en_common.php is one array. If there is an error in the array then $lang_common will not initialise so isset($lang_common) will return false. Sorry for the non technical input, I'm no coder, but that looks to me like the commonsense explanation. Would the answer be to initialise $lang_common at the top the language file before getting to the array?