Can't change global language

Creating and modifying plugins.
Post Reply
Glenn
Regular
Posts: 13
Joined: Sun Mar 23, 2014 12:01 pm

Can't change global language

Post by Glenn » Mon Mar 24, 2014 11:21 am

Hi,
As a side-effect of all the problems I've been having with multi-language (http://board.s9y.org/viewtopic.php?f=4&t=19818), and having discovered the 'draft trap'* (http://board.s9y.org/viewtopic.php?f=3& ... g+language) I now find that I can't change the global language setting in the administration "General Settings" menu : it stays set to english. If I change it and reload it still stays set to english.

* Very strange behavior and lost changes if you save the post as draft instead of directly publishing it. You can't get the 'edited' version back for editing, but remains of it can be seen on the final published post...

(apologies : I should have posted this under bugs, not plugins : I'm not sure the plugin is to blame)

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Can't change global language

Post by Timbalu » Mon Mar 24, 2014 11:30 am

We have a global blog language setting, configured in Backend configuration 'General Settings' and a language set by User in 'Personal Preferences'. Does that solve your issue?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

Glenn
Regular
Posts: 13
Joined: Sun Mar 23, 2014 12:01 pm

Re: Can't change global language

Post by Glenn » Mon Mar 24, 2014 11:47 am

Hi Ian,
Yes, I've seen that there are the two options. It's the global one that is 'stuck' - I change it to french, save the settings and get the green 'OK' tick mark, but the menu entry stays stuck at english...

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Can't change global language

Post by Timbalu » Mon Mar 24, 2014 11:55 am

But if your personal PP lang is set to 'swedish', as long you are logged-in, it overwrites the global 'english' one, if not, it could be a cookie problem. Check this. Is that a current S9y version?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

Glenn
Regular
Posts: 13
Joined: Sun Mar 23, 2014 12:01 pm

Re: Can't change global language

Post by Glenn » Mon Mar 24, 2014 12:16 pm

Timbalu wrote:..., if not, it could be a cookie problem. Check this. Is that a current S9y version?
Thanks, Ian. Yes it's V1.7.8. I cleared all cookies and history, for the nth time, and I have just seen that my admin page is back to French as requested. So it looks like this problem is solved - at least it's gone away. :)
Thanks again.

Glenn
Regular
Posts: 13
Joined: Sun Mar 23, 2014 12:01 pm

Re: Can't change global language

Post by Glenn » Mon Mar 24, 2014 6:12 pm

Very sorry to say, but the problem HASN'T gone away - it's come back.

Why am I messing about changing languages? you ask. Well, it was to be able to write a tutorial about the multilingual plugin and how not to loose your work...

Ian, you mentioned cookies : can you explain a bit more? Otherwise could there be some sort of cache on the MySql server side? I've checked in the DB and all the language settings are 'en' :
serendipity_config_lang.jpg
serendipity_config_lang.jpg (26.97 KiB) Viewed 4296 times
From what I've observed, authorid=0 is the global language, =1 is the admin user, =2 is a second user I created without admin privileges.

But even the Frontpage login stays in French after clearing all cookies and history :
serendipity_login_page.jpg
serendipity_login_page.jpg (44.55 KiB) Viewed 4296 times
Any ideas, please ?

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Can't change global language

Post by Timbalu » Tue Mar 25, 2014 11:39 am

Glenn wrote:Ian, you mentioned cookies : can you explain a bit more?
To say it before: I can not help with the multilingual plugin issue. Sorry!

The Serendipity lang thing is a bit complicated though and might look like a "bug" on first sight. But it isn't, since the "Serendipity way" with $serndipity['lang'] is this (I think):

If you are admin, and you change the global configuration lang, it truly changes the lang set in db config table, but gets internally overwritten by your (prev) PP 'lang' setting, which sets db config lang eg. "'lang' de 1" and is stored in a cookie.

Therefore you don't see any changed selectbox lang setting afterwards, when having changed the global configuration 'lang' to another language. But you can see it happen, when you change your PP lang. Then also the global lang changed in that global configuration selectbox, even if the database config table lang var is still set with the last stored global configuration posted lang var.

Example: PP lang is english - change global lang to french - a return to global config still shows english, but the db config stored lang is 'fr'. Now change PP lang to German and check the global confguration lang, which now changed to German too, even if the database table still is set to last stored global config lang, which was 'fr'. Db table now is "'lang' fr 0" and "'lang' de 1".

Does this help you to clear things up?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

Glenn
Regular
Posts: 13
Joined: Sun Mar 23, 2014 12:01 pm

Re: Can't change global language

Post by Glenn » Wed Mar 26, 2014 10:19 am

Thanks for the extra insight. I'm still not sure that it's *just* a cookie, though.
Yes, I've now seen that the language selection on my blog page (even if I'm not logged-on as anybody, *AND* I've cleared all history and cookies) is what 'forces' the language selection for the admin frontpage.
@Garvin : do you have a description of what is happening, so I can include it in the tutorial?
Thanks in advance

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Can't change global language

Post by garvinhicking » Wed Mar 26, 2014 3:38 pm

Hi!

I can only try to rephrase what Ian explained.

Technically, s9y only offers one "lang" configuration setting. There are multiple ways that the language for the current visitor of the blog is detected. Once that language is detected, every place where serendipity uses this "lang" variable will show the current language.

So when you set your personal preference language, it will be the default value that is also shown in the global configuration. I think at some point we'd need to change that behaviour to always fetch the global language option (authorid "0") from the database, and not rely on the current "lang" configuration value. That is something we would need to change in the core, but it's complicated. Until then, people sadly would need to pay attention when editing the global configuration to make sure the global language of the blog is selected. Usually this is not a huge problem, because the administrator of the blog usually has his personally preferred language set to the same language as the blog, because that would also be the language that the articles default languages would use.

...not sure if that helps, or if that is what you wanted to hear? ;)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Huhu
Regular
Posts: 123
Joined: Tue Oct 04, 2011 3:22 pm

Re: Can't change global language

Post by Huhu » Tue Oct 29, 2019 9:59 am

I've the same problem. I installed the multilingual plug-in, set the Blog Default Language (in General Settings) to German, and my Preferred Language in Profiles to German as well.

All worked fine.

Then, all of a sudden, the General Language resets to English every single time I try to edit an entry. Cleared Cookies and cache.

I tried another browser, and the Blog Default Language has been automatically changed to German again.
Then I edited the English Multilingual Entry and AGAIN the Default language in general Settings (without me touching them) reset to English -- not just the display, the actual setting.
Tried to switch off the "auto detect user's language" now.

--
A workaround for the Multilingual would be to remove the "Default" option and leave the actual default language (i. e. German) in the list, so that it is not relative to the General Settings but "hard-coded".

Yet this doesn't solve the main Blog Default Language problem.

Additional, different question:

I am sure it is possible to create a "hard link" to a language version, i. e. a menu item named "English" that would then set the Multilingual Entry functionality accordingly? index.php?lang=en is not it.
Fan of post-apocalyptic Jugger: Free ebook on the sport

Post Reply