Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Languages Manager in config.ini.php doesn't disable it #10821

Closed
eldk opened this issue Nov 1, 2016 · 11 comments
Closed

Disable Languages Manager in config.ini.php doesn't disable it #10821

eldk opened this issue Nov 1, 2016 · 11 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Milestone

Comments

@eldk
Copy link

eldk commented Nov 1, 2016

Hello,

  • Piwik 3 beta 2 and previous stable releases

Disable "LanguageManager" needs to modify global.ini.php .

;Plugins[] = LanguagesManager

Disable it in config.ini.php is not enought.

As global.ini.php should be overwritten when update ... This should be corrected.

#9404 .

One error message is given too when checking Piwik conf from "https://domain.tld/index.php?module=Installation&action=systemCheckPage "

Différence de taille de fichier : /way/to/global.ini.php (longueur attendue: 40262, rencontrée : 40263)

Thanks,

Eric

PS : once done, default_language = "xx" in config.ini.php is well handle

@tsteur tsteur added Bug For errors / faults / flaws / inconsistencies etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. and removed Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. labels Nov 1, 2016
@tsteur
Copy link
Member

tsteur commented Nov 1, 2016

This is definitely a bug as LanguagesManager is currently marked as a plugin to be always activated : https://github.com/piwik/piwik/blob/2.17.0/core/Plugin/Manager.php#L81

We would probably need a different setting instead to disable the language drop down and to use a hard coded fix language.

Language has a very big impact on using an app and therefore it would be nice to fix this in Piwik 3.

Maybe we could introduce a new setting eg force_language = en|de|fr|...?

@sgiehl any opinion?

@sgiehl
Copy link
Member

sgiehl commented Nov 1, 2016

disabling the plugin maybe worked in older versions. The LanguageManager plugin now also handles settings like usage of 12/24 hour clock and other stuff.
Guess a new setting in config to disable the language selection would be enough as the setting default_language should be enough to "force" the language then.

@gaumondp
Copy link

gaumondp commented Nov 1, 2016

If the non-existing plugin in #10709 (Remove many languages from language selector) was there, maybe it would solve @eldk problem.

@sgiehl
Copy link
Member

sgiehl commented Nov 1, 2016

Hm. Guess the mentioned plugin would be interesting instead. I'll give it a try...

@sgiehl
Copy link
Member

sgiehl commented Nov 1, 2016

Just released a small plugin that is able to restrict the language selector list: http://plugins.piwik.org/RestrictLanguageSelection?piwikversion=3

So maybe we now only remove the comment in global config that it's possible to force a language?
Using the new plugin and the default_language setting should do the same

@eldk
Copy link
Author

eldk commented Nov 2, 2016

Thanks,
I will test it fast (today).
Eric

@gaumondp
Copy link

gaumondp commented Nov 2, 2016

I just tested the Piwik 2.x version with success !

My only problem is that I had to clear cache from console after activation of the plugin.

Note that my server can't reach the internet so I have to copy the zip file, unzip then go to Piwik interface. Should I fill a bug report/suggestion that before activation Piwik should clear cache ? I'm lucky and have SSH access so I was able to easily do a console core:clear-cache.

Many thanks !

@eldk
Copy link
Author

eldk commented Nov 2, 2016

Hello,

I have installed the new plugin on 3b2 Piwik.

I yet have one alert on global.ini.php : "Échec du contrôle d'intégrité : /home/neptune/public_html/piwik/config/global.ini.php"

The diff is :

--- /home/eric/Téléchargements/global.ini.ori.php (from Github 3 b2 branch - https://raw.githubusercontent.com/piwik/piwik/3.x-dev/config/global.ini.php)
+++ /home/eric/Téléchargements/global.ini.mine.php
@@ -244,7 +244,7 @@

; if you want all your users to use Piwik in only one language, disable the LanguagesManager
; plugin, and set this default_language (users won't see the language drop down)
-default_language = en
+default_language = fr

; default number of elements in the datatable
datatable_default_limit = 10
@@ -800,7 +800,6 @@
Plugins[] = Insights
Plugins[] = Morpheus
Plugins[] = Contents
-Plugins[] = TestRunner
Plugins[] = BulkTracking
Plugins[] = Resolution
Plugins[] = DevicePlugins
@@ -828,5 +827,3 @@
SDK_interval_value = 30

So I add : Plugins[] = TestRunner

Then it give one error on size:
"Différence de taille de fichier : /home/neptune/public_html/piwik/config/global.ini.php (longueur attendue: 40262, rencontrée : 40285)"

But it works.

Thanks,

Eric

@sgiehl
Copy link
Member

sgiehl commented Nov 2, 2016

@eldk You should never change anything in global.ini.php as that file holds the default values and will be overwritten with an update.
If you like to change a value, add it in config.ini.php (within the correct section) instead, that will overwrite the default from global.ini.php.

Is that plugin enough to solve what you liked to do? If so, guess we could close this issue after removing/changing the comment in https://github.com/piwik/piwik/blob/3.x-dev/config/global.ini.php#L245-L246

@eldk
Copy link
Author

eldk commented Nov 3, 2016

Hello @sgiehl ,

I have reset default_language = en in global.ini.php : no more error in file check.

I have only enable one language with the new plugin.

Then disable "Languagemanager" in config.ini.php :

  • for logged users : no more language selector as expected.
  • for anonymous users (public stats) : language selector is still there.
    --- caches where disabled in Piwik, on server side and browser

@sgiehl

The LanguageManager plugin now also handles settings like usage of 12/24 hour clock and other stuff.

If "LanguageManager is needed :
I think this is another concern : " Language selector is shown even if only one language is set/used with http://plugins.piwik.org/RestrictLanguageSelection?piwikversion=3". #10830

Thanks,

Eric

@mattab
Copy link
Member

mattab commented Nov 3, 2016

we could close this issue after removing/changing the comment in https://github.com/piwik/piwik/blob/3.x-dev/config/global.ini.php#L245-L246

@mattab mattab reopened this Nov 3, 2016
@mattab mattab added this to the 3.0.0-b3 milestone Nov 3, 2016
@sgiehl sgiehl closed this as completed in a0dff4b Nov 4, 2016
@mattab mattab changed the title Disable Languages Manager in config.ini.php don't disable it Disable Languages Manager in config.ini.php doesn't disable it Nov 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Projects
None yet
Development

No branches or pull requests

5 participants