setting default language in admin won't work setting default language in admin won't work
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

setting default language in admin won't work

Started by flux, April 21, 2006, 11:01:00 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

flux

hi,

i'd like to know if there's a known bug with the default language setup, in the admin, and "user" languages..

I'm getting an extremely weird behaviour of the language parameter..
thx

.flux

charlesdias

 I'm facing the same problem ... when I try to set brazilian_portuguese as default language and confirm the choice, it's like I've neve did it because the language continues set to english.

Yours,

Charles

Joachim Müller

no known issue, post more details. Clear your cookies.

charlesdias

 In my case I've just installed a brand new Coppermine using Fantastico Panel and:

Clean cookies > All front end in english > acessed Config > acessed Language & Charset settings > changed Language to
Brazilian_portuguese > clicked Save new configuration > the front end continues all in english

I've done it a dozen time and was unable to get my Coppermine in brazilian_portuguese.

Charles

Joachim Müller

don't use fantastico, it sucks, is buggy and outdated. Use the most recent stable release.

charlesdias

 I see ... I'll do that.
By the way, the download sections is not working ... 500 - Internal Server Error

Charles

Joachim Müller

Quote from: charlesdias on April 22, 2006, 12:31:09 AM
By the way, the download sections is not working ... 500 - Internal Server Error
Works fine for me. Try again, using a different mirror.

flux

okay so here's my long version

i'll pass teh fact that i've been tweaking an invision 1.3 bridge over that fresh cpg 1.4.4 stable install.
I've set it back to standalone and cpg is working fine..

So basically i wanted to set the default language to french, so any visitor, guest or membre would have to browse in french and couldn't change that.

so i went in the config and set the language to french and disabled flags and dropdown menu, then submitted.

the "french" language was updated in the database config table row "lang" but cpg navigation was still in english and going back to the admin i saw that the default language dropdown menu was set to "english"..

Removing cookies, trying another language and so on wouldn't make any difference..

Then i enabled the "user" language dropdown menu so any user could change its language and then i could set it to french, once set my user to french, going in the admin would show me that the "default language" is french but removing my cookies would make the language switch back to english although the database value is still "french"..

So my guess is that there's a problem with the use of the database default language init.. Then there's also a mixup between that database value and the cookies "user" value when accessing the admin..

Sorry i haven't had time to check the code and try to locate the bug i was too busy messing around with the invision bridge.. btw i also found something quite weird with php/mysql, i'll ask you about that in my bridge question thread..

.flux



Stramm

Coppermine has a language auto detect so it basically doesn't matter to much if you set a default language. If no language is defined in a users cookie then the auto detect starts...
I've added a config entry to disable the auto detection in my modpack cause I didn't like that behaviour... let me dig it out

Stramm

let's get this started...
add at the bottom of sql/update.sql
### autodetect language
INSERT INTO CPG_config (name, value) values ('lang_autodetect', '1');


now add to your lang file (in the admin block 'Language and Charset settings')
  array('Enable language auto detect', 'lang_autodetect', 1), //cpg1.4

In the english lang file (lang/english.php) this is right after
  array('Display "reset" in language selection', 'language_reset', 1, 'f=index.htm&as=admin_language_reset&ae=admin_language_reset_end&top=1'), //cpg1.4

now open include/init.inc.php, find
elseif ($CONFIG['charset'] == 'utf-8')
and replace with
elseif ($CONFIG['charset'] == 'utf-8' && $CONFIG['lang_autodetect'])

as a final step you have to run update.php

now you'll have a new config entry (Language and Charset settings - Enable language auto detect)
disable it to turn the suto detction of the users language off (to see the config entry you have to use the lang file you just edited)

flux

ho okay i understand now..

indeed this is a weird behaviour, basically the auto detec will override the language setting in the admin but if you enable language selection then the user can set its language in his cookies and that one will override the autodetected language..

As a matter of fact i asked a friend to test it and he got the environment in french when i was still having it in english but that's because he's unsing a french windows/browser and i'm using an english one..

Thx a lot for the autodetect mod, i'll use it.

.flux

maze

#11
Hi,

will there be an option so we will be able to choose auto detect or not in the admin menu for language & template?

p.s.

is there a file that i can upload to the system that will disable my auto detect till there will be an update?

Cheers.

maze

#12
Hi Stramm,

I did what you wrote here but still the language changes back to auto detect.
do i need to change all of the lang files?
i have an option that let me make autodetect on or off & its off.

what sould i do?
???

p.s.

i think it's working (after i cleared my cookies)
Quote from: Stramm on April 23, 2006, 01:10:01 PM
let's get this started...
add at the bottom of sql/update.sql
### autodetect language
INSERT INTO CPG_config (name, value) values ('lang_autodetect', '1');


now add to your lang file (in the admin block 'Language and Charset settings')
  array('Enable language auto detect', 'lang_autodetect', 1), //cpg1.4

In the english lang file (lang/english.php) this is right after
  array('Display "reset" in language selection', 'language_reset', 1, 'f=index.htm&as=admin_language_reset&ae=admin_language_reset_end&top=1'), //cpg1.4

now open include/init.inc.php, find
elseif ($CONFIG['charset'] == 'utf-8')
and replace with
elseif ($CONFIG['charset'] == 'utf-8' && $CONFIG['lang_autodetect'])

as a final step you have to run update.php

now you'll have a new config entry (Language and Charset settings - Enable language auto detect)
disable it to turn the suto detction of the users language off (to see the config entry you have to use the lang file you just edited)

Joachim Müller

the whole point of using utf-8 is that you have auto-detection. It's agreat feature imo. If your users all come from one country, then go for the encoding that is usually being used for that particular country. Why would someone who has e.g. a french browser prefer a spanish gallery navigation?

ymca

My native language for example is hebrew & i prefer english because all of the site is in english & the "()" are in the right place & in heb it's not perfect RTL & translation.
so if a user wants to change back to english why not?

Stramm

Quote from: GauGau on April 30, 2006, 09:12:54 AM
the whole point of using utf-8 is that you have auto-detection. It's agreat feature imo. If your users all come from one country, then go for the encoding that is usually being used for that particular country. Why would someone who has e.g. a french browser prefer a spanish gallery navigation?

I consider a config option to be quite useful. This auto detection was a reason why I didn't upgrade when the 1.4 stable was released. My old gallery was international and all users talked in english. Descriptions, comments, everything... so why force the navigation to be dutch, french, german if I don't want it.
If I have an italian community, descriptions comments etc all in italian. Why show a czech navigation? Cause I'm in a czech internet cafe?
It's basically the same discussion as with links open in the same or a new window.
An option to switch the language is cool (like the lang dropdown) but beeing forced to use something is pita. At least there should be the possibility to turn of the nanny.

Joachim Müller

that's why the language dropdown/flag selectors are there. For 99% of all users, auto-detection is great. For the minority of users who would like to see the nav in another language than their browser language, they can use the language selectors. If you want your site to be in english only, then just get rid of all other language files than english in the lang folder. If you want to offer a choice for your users, go for the language selectors. If you don't want a choice, then don't show the selectors. I can't see the point in having yet another config option for something that already is possible to accomplish with ease.

Stramm

It's just for the 1% who don't like the auto detect feature. And ~2% of that 1% sure will find that thread, hehehe
As said, I hate it to be nurtured. I prefer one default language and a language selector. Therefore I've added this to my version. I don't ask for applying it to the current stable or future versions.

Sticking to some iso is no option for me (and I think for a good bunch of other users as well) cause I consider utf to be the future. Language auto detection is not the 'whole point' of utf but reducing problems with displaying the charset hence getting rid of the limited capabilities of iso

Joachim Müller

Quote from: Stramm on April 30, 2006, 06:16:19 PM
I don't ask for applying it to the current stable or future versions.


Hehe, in fact you have done so ;D:
Quote from: Stramm on April 01, 2006, 04:25:30 PM
I'd like to see...
-Possibility to disable language auto detect (drives me crazy)

Sorry to continue this discussion on a public board, but I guess the discussion on the dev-only one maybe didn't get much attention, and non-dev users might want to share their opinion as well. I wasn't trying to start an argument on this, I'd just like to be convinced that such an option would really be necessary/usefull. Imo it's a big difference between spoon-feeding the user and offering guidance and the option to change the nav language (using the selectors). I agree that when entering the config page the language set for the admin shouldn't be used for the overall default language. I agree that utf-8 is the future instead of using proprietary encoding in iso8859-whatever.
So what I'd like to see would be an admin-only page that allows admins to set specific language options, similar to the plugin manager, with an option to upload new language files, get rid of un-used languages, determine what flag icons to use etc.
If we had a separate language setup page, then yes: there could be an option to disable auto-detection.
I repeat: I don't want to sound confrontational, I'd just like to see your point and find a solution for all without adding bloat-features.
Please post your thoughts.

Joachim

Stramm

Quote from: GauGau on April 30, 2006, 06:31:33 PM
Hehe, in fact you have done so ;D:

true, still there's room for interpretation whether I really asked for that config entry or if that's an answer to your question

For most users very basic settings would do. I can't imagine a lot of admins enable the flags cause they need ages to load. Reasonable only would be to load flags the ~5 most used languages. Hahaha, I even consider the auto detection to be 'bloated' and an unnecessary feature. I wouldn't mind it if you can turn it off. Basically I'd stay with the actual setup and remove auto detection

QuoteSo what I'd like to see would be an admin-only page that allows admins to set specific language options, similar to the plugin manager, with an option to upload new language files, get rid of un-used languages, determine what flag icons to use etc.

With such a page (I think the hole thingie can be realized as a plugin in future versions) admins that really need special settings can enable and finetune everything.
The mentioned flag setup, uploading and enabling/ disabling languages, auto detection... you even could start a basic editor so admins could change certain phrases

Back to auto detection. Browse the web and search for CPG sites. Most are targeted to a defined audience, a school, college, family, a city, the party scene in zurich. These don't need that cause 99.9% of its users speak the admin set language. That feature is only useful for admins running an international site. But I don't know if all these admins would like that feature enabled by default. If I'm browsing international sites I appretiate a language selector. On the other hand I've got some nice paranoia if I see forced action, spying etc. (as said, before I started to use 1.4 I had to disable auto detection)
Another point is that you'll probably have two languages on your site. Navigation in the users language, comments, descriptions for albums, cats and images in the admins language. Personally I absolutely dislike that and prefer a homogenous look.