forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: flux on April 21, 2006, 11:01:00 pm

Title: setting default language in admin won't work
Post by: flux on April 21, 2006, 11:01:00 pm
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
Title: Re: setting default language in admin won't work
Post by: charlesdias on April 21, 2006, 11:52:10 pm
 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
Title: Re: setting default language in admin won't work
Post by: Joachim Müller on April 22, 2006, 12:10:54 am
no known issue, post more details. Clear your cookies.
Title: Re: setting default language in admin won't work
Post by: charlesdias on April 22, 2006, 12:19:34 am
 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
Title: Re: setting default language in admin won't work
Post by: Joachim Müller on April 22, 2006, 12:21:25 am
don't use fantastico, it sucks, is buggy and outdated. Use the most recent stable release.
Title: Re: setting default language in admin won't work
Post by: charlesdias on April 22, 2006, 12:31:09 am
 I see ... I'll do that.
 By the way, the download sections is not working ... 500 - Internal Server Error

 Charles
Title: Re: setting default language in admin won't work
Post by: Joachim Müller on April 22, 2006, 12:47:45 am
By the way, the download sections is not working ... 500 - Internal Server Error
Works fine for me. Try again, using a different mirror.
Title: Re: setting default language in admin won't work
Post by: flux on April 22, 2006, 12:14:21 pm
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


Title: Re: setting default language in admin won't work
Post by: Stramm on April 23, 2006, 01:01:52 pm
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
Title: Re: setting default language in admin won't work
Post by: Stramm on April 23, 2006, 01:10:01 pm
let's get this started...
add at the bottom of sql/update.sql
Code: [Select]
### 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')
Code: [Select]
  array('Enable language auto detect', 'lang_autodetect', 1), //cpg1.4
In the english lang file (lang/english.php) this is right after
Code: [Select]
  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
Code: [Select]
elseif ($CONFIG['charset'] == 'utf-8')and replace with
Code: [Select]
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)
Title: Re: setting default language in admin won't work
Post by: flux on April 24, 2006, 02:28:17 pm
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
Title: Re: setting default language in admin won't work
Post by: maze on April 28, 2006, 09:06:28 pm
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.
Title: Re: setting default language in admin won't work
Post by: maze on April 29, 2006, 12:24:55 am
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)
let's get this started...
add at the bottom of sql/update.sql
Code: [Select]
### 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')
Code: [Select]
  array('Enable language auto detect', 'lang_autodetect', 1), //cpg1.4
In the english lang file (lang/english.php) this is right after
Code: [Select]
  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
Code: [Select]
elseif ($CONFIG['charset'] == 'utf-8')and replace with
Code: [Select]
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)
Title: Re: setting default language in admin won't work
Post by: Joachim Müller 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?
Title: Re: setting default language in admin won't work
Post by: ymca on April 30, 2006, 09:31:38 am
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?
Title: Re: setting default language in admin won't work
Post by: Stramm on April 30, 2006, 12:58:30 pm
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.
Title: Re: setting default language in admin won't work
Post by: Joachim Müller on April 30, 2006, 06:04:50 pm
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.
Title: Re: setting default language in admin won't work
Post by: Stramm on April 30, 2006, 06:16:19 pm
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
Title: Re: setting default language in admin won't work
Post by: Joachim Müller on April 30, 2006, 06:31:33 pm
I don't ask for applying it to the current stable or future versions.


Hehe, in fact you have done so ;D:
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
Title: Re: setting default language in admin won't work
Post by: Stramm on April 30, 2006, 07:37:39 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

Quote
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.

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.
Title: Re: setting default language in admin won't work
Post by: Joachim Müller on May 01, 2006, 01:35:19 am
OK, I can see the point of additional CPU cycles being burnt for the auto-detection.
Title: Re: setting default language in admin won't work
Post by: ymca on May 22, 2006, 01:51:13 pm
after upgrading to 1.4.6 the option for disable the language is gone.
 ???
Title: Re: setting default language in admin won't work
Post by: Stramm on May 22, 2006, 04:29:10 pm
every time you upgarde you have to reapply mods. That's the downside of customizing core code
Title: Re: setting default language in admin won't work
Post by: ymca on May 22, 2006, 04:32:28 pm
 :( yea i know...
i did reapply it but still did not find the option.

can it be because of this?
Quote
array('Enable language auto detect', 'lang_autodetect', 1), //cpg1.4

do i need to make it like this? -
Quote
...1); //cpg1.4
Title: Re: setting default language in admin won't work
Post by: Stramm on May 22, 2006, 04:43:38 pm
needs to be a comma, not a semicolon...
if you don't get it to work you can check/ verify the code in my modpack (see sig)
Title: Re: setting default language in admin won't work
Post by: ymca on May 22, 2006, 06:07:34 pm
:) nice modes you have there...
i wish that the standard coppermine will have it.
im too afraid to install them & by mistake ruin my installation. :(

by the way i found the problem.
in the english.php i did change what needed.
but it always gave me the english_gb.php
after i changed the lang from the tab (user) lang changer i saw the auto lang.

Cheers.