Skip to content
This repository was archived by the owner on Apr 5, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ phpunit --bootstrap craft/app/tests/bootstrap.php --configuration craft/plugins/

Changelog
=================
###0.4.3###
- Fixed a bug where translations wouldn't be shown on sites with only 1 locale defined (thanks to @janhenckens)

###0.4.2###
- Add node_modules to excluded vendor folders (thanks to @tcsehv)

Expand Down
2 changes: 1 addition & 1 deletion TranslatePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getName()
*/
public function getVersion()
{
return '0.4.2';
return '0.4.3';
}

/**
Expand Down
5 changes: 5 additions & 0 deletions elementtypes/TranslateElementType.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ public function getSources($context = null)
*/
public function getIndexHtml($criteria, $disabledElementIds, $viewState, $sourceKey, $context, $includeContainer, $showCheckboxes)
{
// If the site only has 1 locale enabled, set the translated locale to the primary (and only) locale
if (empty($criteria['locale'])) {
$criteria['locale'] = craft()->i18n->getPrimarySiteLocale();
}

$variables = array(
'viewMode' => $viewState['mode'],
'context' => $context,
Expand Down