Skip to content

Commit

Permalink
Show the button only when the default language is not the language
Browse files Browse the repository at this point in the history
loaded.
  • Loading branch information
infograf768 committed Feb 14, 2016
1 parent 630158c commit c78fa8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ protected function addToolbar()
JToolbarHelper::divider();

// Force administrator language
if ($this->state->get('filter.client_id', 0) == 1)
$defaultLang = JComponentHelper::getParams('com_languages')->get('administrator','en-GB');
$currentLang = JFactory::getLanguage()->getTag();

if ($defaultLang != $currentLang && $this->state->get('filter.client_id', 0) == 1)
{
JToolbarHelper::custom('installed.forceadminlanguage', 'refresh', 'refresh', 'COM_LANGUAGES_FORCE_ADMIN', false);
JToolbarHelper::divider();
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/en-GB.com_languages.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COM_LANGUAGES_FIELD_IMAGE_DESC="Prefix of the image file for this language when
COM_LANGUAGES_FIELD_IMAGE_LABEL="Image Prefix"
COM_LANGUAGES_FIELD_LANG_TAG_DESC="Enter the language tag – example: en-GB for English (UK). This should be the exact prefix used for the language installed or to be installed."
COM_LANGUAGES_FIELD_LANG_TAG_LABEL="Language Tag"
COM_LANGUAGES_FORCE_ADMIN="Force Administrator Language"
COM_LANGUAGES_FORCE_ADMIN="Load Default Administrator Language"
COM_LANGUAGES_INSTALL="Install Language"
COM_LANGUAGES_OVERRIDE_ERROR_RESERVED_WORDS="YES, NO, NULL, FALSE, ON, OFF, NONE, TRUE are reserved words and can't be used as language constants."
COM_LANGUAGES_OVERRIDE_FIELD_BOTH_LABEL="For both locations"
Expand Down

0 comments on commit c78fa8c

Please sign in to comment.