Friendica: System language changes again and again

Created on 20 Oct 2018  路  3Comments  路  Source: friendica/friendica

Expected behavior

When the system language is set and stored in admin/site, it should always remain at the stored value.

Actual behavior

For some time now I have been observing that the set system language changes several times a day. If I set and save the system language it is successfully stored in table config (system - language) and correctly displayed in admin/site. But when I go back to the admin panel some minutes later is has been mysteriously changed to some random language (from en to de, it, en-us, fr, en-gb and so on). The changed value is also stored in the database.
This also affects the language in which admin notification emails are sent.

Steps to reproduce the problem

Difficult. I really don't know how to reproduce it. I have tested a lot of things. Sometimes the setting doesn't change for an hour and sometimes it is changed after 1 minute. Saved the setting, checked the database, read one comment I got a notification for (just an example). And there... Setting changed to some other language. The whole behavior seems to be completely random.
I have the impression that it might be related to some user action. But I have absolutely no clue what could trigger this weird language switch.

I also added language = en to the system section of my local.ini.php - didn't help.

Friendica version you encountered the problem

2018.12-dev
db: 1288
pu: 1281

Friendica source (git, zip)

git

PHP version

7.2.10

SQL version

10.1.34 MariaDB

Bug

Most helpful comment

Found it. We use L10n::pushLang($language) to temporarily change the current language to format strings in the target language. After we're done, we're supposed to call L10n::popLang() to restore the previous language.

You guessed it, we didn't do it everywhere we should have.

All 3 comments

The local.ini.php doesn't override the config table so this much is off the table. I'll look for all the places where we set the site-wide language.

The local.ini.php doesn't override the config table

I know. But I was desperate. :-)

Found it. We use L10n::pushLang($language) to temporarily change the current language to format strings in the target language. After we're done, we're supposed to call L10n::popLang() to restore the previous language.

You guessed it, we didn't do it everywhere we should have.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nupplaphil picture nupplaphil  路  3Comments

hoergen picture hoergen  路  3Comments

tobiasd picture tobiasd  路  3Comments

miqrogroove picture miqrogroove  路  3Comments

AlfredSK picture AlfredSK  路  3Comments