Discussion:
VqAdmin error "invalid language file" when using Google Chrome
Charlie Garrison
2011-03-04 00:39:03 UTC
Permalink
Good morning,

We're running VqAdmin v2.3.6 and when accessing it with Google
Chrome there is an "invalid language file" error message. I saw
there is a v2.3.7 but the ChangeLog doesn't address this
problem. Is there something else I can do to fix the problem?


Charlie

PS. Just joined this list and can't easily find archives, so
sorry if this has been discussed already.
--
Ꮚ Charlie Garrison ♊ <***@zeta.org.au>

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠 http://www.ietf.org/rfc/rfc1855.txt


!DSPAM:4d7034a932711745611875!
Lawrence Sheed
2011-03-04 02:35:06 UTC
Permalink
You are missing a language pack for the language that your browser is telling vqadmin to use.
Check your apache logs to see what its declaring itself as.

eg

"GET /favicon.ico HTTP/1.1" 404 267 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6"

en-US

Then copy the english language pack folder to the same name (in lowercase) as the language being declared.

The language packs are in the vqadmin/html folder

You can either create a proper language revision or link english to the language being asked for
eg

cd vqadmin/html
ln -s en mylanguage

Languages are usually in the form of the two letters, or two letters-suffix.

eg Chinese is

zh-cn

English is

en-us
en

etc.

You'll need to check your apache logs to see what your browser is declaring its language to be.
You could have also worked this out by grepping the source for vqadmin to see what it was doing.

Lawrence.
Post by Charlie Garrison
Good morning,
We're running VqAdmin v2.3.6 and when accessing it with Google Chrome there is an "invalid language file" error message. I saw there is a v2.3.7 but the ChangeLog doesn't address this problem. Is there something else I can do to fix the problem?
Charlie
PS. Just joined this list and can't easily find archives, so sorry if this has been discussed already.
--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠 http://www.ietf.org/rfc/rfc1855.txt
!DSPAM:4d704fe032711410752727!
Charlie Garrison
2011-03-05 08:43:19 UTC
Permalink
Good morning,

On 4/03/11 at 10:35 AM +0800, Lawrence Sheed
Post by Lawrence Sheed
You are missing a language pack for the language that your browser is telling vqadmin to use.
Check your apache logs to see what its declaring itself as.
Unfortunately that server isn't logging the language being
requested. Looking at the request headers in the network
inspector shows:

Accept-Language:en-AU,en;q=0.8,en-US;q=0.6
...
User-Agent:Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6;
en-US) AppleWebKit/534.16 (KHTML, like Gecko)
Chrome/10.0.648.114 Safari/534.16
Post by Lawrence Sheed
The language packs are in the vqadmin/html folder
You can either create a proper language revision or link english to the language being asked for
eg
The en and en-us were already there, so I created symlink for en-au:

-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en-us
-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en
lrwxr-xr-x 1 root vchkpw 2 Mar 5 08:41 en-au@ -> en

Unfortunately that didn't fix it either.


On 4/03/11 at 8:11 AM -0600, Larry D. Dinkie
Post by Lawrence Sheed
Go into chromes options settings, go to under the hood and
select language and spell checker settings. Move English to
the top of the list and it should work.
I changed the ordering of languages in Chrome, and that got it
working for me.


Thanks Lawrence and Larry for your help.


Charlie
--
Ꮚ Charlie Garrison ♊ <***@zeta.org.au>

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠 http://www.ietf.org/rfc/rfc1855.txt


!DSPAM:4d71f7b132711805810751!
Lawrence Sheed
2011-03-05 09:04:10 UTC
Permalink
en-au should work..

Possible you have follow symlinks turned off in apache config, or permissions don't let it access that.

Can always do a copy of the folder, taking care to keep permissions correct.

rm en-au
cp -rp en en-au

Suggest do that anyway, and retest.
Better to solve it properly I always say :)

Lawrence.
Post by Charlie Garrison
Good morning,
Post by Lawrence Sheed
You are missing a language pack for the language that your browser is telling vqadmin to use.
Check your apache logs to see what its declaring itself as.
Accept-Language:en-AU,en;q=0.8,en-US;q=0.6
...
User-Agent:Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.114 Safari/534.16
Post by Lawrence Sheed
The language packs are in the vqadmin/html folder
You can either create a proper language revision or link english to the language being asked for
eg
-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en-us
-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en
Unfortunately that didn't fix it either.
Post by Lawrence Sheed
Go into chromes options settings, go to under the hood and select language and spell checker settings. Move English to the top of the list and it should work.
I changed the ordering of languages in Chrome, and that got it working for me.
Thanks Lawrence and Larry for your help.
Charlie
--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠 http://www.ietf.org/rfc/rfc1855.txt
!DSPAM:4d71fc9032713215118908!
Charlie Garrison
2011-03-05 09:23:17 UTC
Permalink
Good evening,
Post by Lawrence Sheed
en-au should work..
Possible you have follow symlinks turned off in apache config, or permissions don't let it access
that.
I'm pretty sure symlinks are ok on this server.
Post by Lawrence Sheed
Can always do a copy of the folder, taking care to keep permissions correct.
rm en-au
cp -rp en en-au
They are only files, not directories. But trying anyway:

-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en
-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en-au
-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en-us
Post by Lawrence Sheed
Suggest do that anyway, and retest.
Better to solve it properly I always say :)
I agree it's better to solve properly, so persisting... but without any luck.

Changed Chrome prefs to make en-au preferred language, and:

"invalid language file"

Any other suggestions?


Thanks,
Charlie
--
Ꮚ Charlie Garrison ♊ <***@zeta.org.au>

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠 http://www.ietf.org/rfc/rfc1855.txt


!DSPAM:4d72010732711747318672!
Lawrence Sheed
2011-03-05 10:09:07 UTC
Permalink
I just tried this on mine, worked fine.
Changed my browser language to en-au, and it came up with invalid language file as expected (as I hadn't made the folder yet)

Tested

cp -rp en en-au

..and it comes up with the english page as expected.

However, I do see that Firefox uses lower case for the language encoding -
Preferences, Choose Preferred Language, ...

vqadmin gets the language from HTTP_ACCEPT_LANGUAGE

(see lang.c)


Suggest you do this.

Add a test page and check what this is set to. I'll assume you have php installed and can do something like the below:

<?php

print "Vqadmin is looking for a folder called: ". $_SERVER["HTTP_ACCEPT_LANGUAGE"];


?>


If not, visit this page http://mail.computersolutions.cn/accept.php

I see Vqadmin is looking for a folder called: en-au,zh-cn;q=0.8,en-us;q=0.5,zh;q=0.3

So I need to create a folder or folders for

en-au
zh-cn
en-us
zh

In my vqadmin/html folder.

Might be that your HTTP_ACCEPT_LANGUAGE from your browser is upper case, so you'd need to use an appropriate case for the folder I guess...

Let me know how you go!

Lawrence.
Post by Charlie Garrison
Good evening,
Post by Lawrence Sheed
en-au should work..
Possible you have follow symlinks turned off in apache config, or permissions don't let it access
that.
I'm pretty sure symlinks are ok on this server.
Post by Lawrence Sheed
Can always do a copy of the folder, taking care to keep permissions correct.
rm en-au
cp -rp en en-au
-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en
-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en-au
-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en-us
Post by Lawrence Sheed
Suggest do that anyway, and retest.
Better to solve it properly I always say :)
I agree it's better to solve properly, so persisting... but without any luck.
"invalid language file"
Any other suggestions?
Thanks,
Charlie
--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠 http://www.ietf.org/rfc/rfc1855.txt
!DSPAM:4d720bcb32717739718647!
Charlie Garrison
2011-03-06 01:03:25 UTC
Permalink
Good morning,

On 5/03/11 at 6:09 PM +0800, Lawrence Sheed
Post by Lawrence Sheed
I just tried this on mine, worked fine.
Changed my browser language to en-au, and it came up with
invalid language file as expected (as I hadn't made the folder yet)
I'm confused about the folder part. On my system they are
language *files*, not folders or directories.

$ ls -l en en-us en-au
-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en
-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en-au
-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en-us

$ file en en-us en-au
en: ASCII English text
en-us: ASCII English text
en-au: ASCII English text
Post by Lawrence Sheed
Tested
cp -rp en en-au
..and it comes up with the english page as expected.
However, I do see that Firefox uses lower case for the language
encoding - Preferences, Choose Preferred Language, ...
Hmm, I had tried en-AU (rather than en-au) before and I got a
server error rather than invalid language error. But at that
time I was using symlinks. Making a copy of the file as en-AU
works now.

Thanks for your help.


Charlie
--
Ꮚ Charlie Garrison ♊ <***@zeta.org.au>

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠 http://www.ietf.org/rfc/rfc1855.txt


!DSPAM:4d72dd6332711807778901!
Lawrence Sheed
2011-03-06 02:44:35 UTC
Permalink
Sorry, thats me being unobservant. My bad.
Its qmailadmin that uses the same mechanism, and folders.

What I would actually recommend though, is patch lang.c to default to not failing on language type.

eg

Find where it fails, and change it - the failure occurs in the open_lang function, in the first test, so we add a very minor patch there.
eg

/*Change the failure notice to a soft fail */
global_error("invalid language file",1,1);

/*Set lang to an appropriate default value (english) */
memset(lang, 0, MAX_TMPBUF);
strcpy (lang, "en");

and place appropriately in the lang.c file

I haven't tested this, but its a small change, and should work (famous last words haha).


The complete function would look something like this - I used 2.3.7,


int open_lang( char *lang)
{
char tmpfile[MAX_TMPBUF];
struct stat mystat;

/* only open files in the local directory */
if ( strstr(lang, ".") != NULL || strstr(lang, "/") != NULL ) {

/*Change the failure notice to a soft fail */
global_error("invalid language file",1,1);

/*Set lang to an appropriate default value (english) */
memset(lang, 0, MAX_TMPBUF);
strcpy (lang, "en");

}

if ( lang_fs == NULL ) {
memset(tmpfile, 0, MAX_TMPBUF);
snprintf(tmpfile, MAX_TMPBUF - 1, "html/%s", lang);

/* check for symbolic link */
if ( lstat(tmpfile, &mystat) == 0 && S_ISLNK(mystat.st_mode) ) {
global_error("invalid file",1,0);
}

if ( (lang_fs=fopen(tmpfile, "r"))==NULL) return(-1);
}
return(0);
}
Post by Charlie Garrison
Good morning,
Post by Lawrence Sheed
I just tried this on mine, worked fine.
Changed my browser language to en-au, and it came up with invalid language file as expected (as I hadn't made the folder yet)
I'm confused about the folder part. On my system they are language *files*, not folders or directories.
$ ls -l en en-us en-au
-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en
-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en-au
-rw-r--r-- 1 vpopmail vchkpw 1492 Mar 5 2008 en-us
$ file en en-us en-au
en: ASCII English text
en-us: ASCII English text
en-au: ASCII English text
Post by Lawrence Sheed
Tested
cp -rp en en-au
..and it comes up with the english page as expected.
However, I do see that Firefox uses lower case for the language encoding - Preferences, Choose Preferred Language, ...
Hmm, I had tried en-AU (rather than en-au) before and I got a server error rather than invalid language error. But at that time I was using symlinks. Making a copy of the file as en-AU works now.
Thanks for your help.
Charlie
--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠 http://www.ietf.org/rfc/rfc1855.txt
!DSPAM:4d72f51a32712105516817!

Larry D. Dinkie
2011-03-04 14:11:55 UTC
Permalink
Go into chromes options settings, go to under the hood and select language and spell checker settings. Move English to the top of the list and it should work.

Larry Dinkie
Enterprise Systems Group
Nebraska Book Company
4700 S. 19th. St.
Lincoln, NE 68512
402-421-7300 ext. 7761
402-613-8977 mobile
-----Original Message-----
Sent: Thursday, March 03, 2011 6:39 PM
Subject: [vqadmin] VqAdmin error "invalid language file" when using Google
Chrome
Good morning,
We're running VqAdmin v2.3.6 and when accessing it with Google
Chrome there is an "invalid language file" error message. I saw
there is a v2.3.7 but the ChangeLog doesn't address this
problem. Is there something else I can do to fix the problem?
Charlie
PS. Just joined this list and can't easily find archives, so
sorry if this has been discussed already.
--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠 http://www.ietf.org/rfc/rfc1855.txt
!DSPAM:4d70f32d32711659833494!
Loading...