Hide languages link when there's only one language
Most existing Consul Democracy installations will have changed their `config.i18n.available_locales` option so only a few locales are available. In many cases, only one locale will be available. In these cases, rendering a form that only offers one option is useless. We've considered adding a text in this case mentioning that, in order to enable more languages, they need to configure their `config.i18n.available_locales`. However, we haven't done it for two reasons. First, if they've changed the available locales to just one, there's a good chance they aren't interested at all in configuring the locales. And, second, if there's only one available locale, administrators will learn to ignore the "languages" link, so they won't realize that locales can be configured if developers change the available locales. If we hide the link, on the other hand, they will notice that locales can now be configured once developers change the available locales. Note we're still allowing access by entering the URL. This is harmless, though, since people accessing it this way will see a form with only one possible option and won't be able to modify anything.
This commit is contained in:
@@ -462,7 +462,7 @@ class Admin::MenuComponent < ApplicationComponent
|
||||
settings_link,
|
||||
tenants_link,
|
||||
tags_link,
|
||||
locales_link,
|
||||
(locales_link if I18n.available_locales.many?),
|
||||
geozones_link,
|
||||
local_census_records_link
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user