Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1276 from lesydat/patch
Browse files Browse the repository at this point in the history
Add multi languages support for module description on context menu
  • Loading branch information
lonnieezell authored Jun 30, 2017
2 parents a997351 + 16956df commit 566e28b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions bonfire/modules/sysinfo/controllers/Developer.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public function modules()

$configs[$module]['version'] = isset($configs[$module]['version']) ? $configs[$module]['version'] : $unsetReplacement;
$configs[$module]['description'] = isset($configs[$module]['description']) ? $configs[$module]['description'] : $unsetReplacement;
if (strpos($configs[$module]['description'], 'lang:') === 0) $configs[$module]['description'] = lang(substr($configs[$module]['description'], 5));
$configs[$module]['author'] = isset($configs[$module]['author']) ? $configs[$module]['author'] : $unsetReplacement;
}

Expand Down
5 changes: 5 additions & 0 deletions bonfire/modules/ui/libraries/Contexts.php
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,11 @@ private static function buildItem($module, $title, $display_name, $context, $men
}
$displayName = ucwords(str_replace('_', '', $display_name));

// Add lang for module description menu
if (strpos($title, 'lang:') === 0) {
$title = lang(str_replace('lang:', '', $title));
}

if (empty($menu_view)) {
return str_replace(
array('{extra}', '{url}', '{title}', '{display}'),
Expand Down

0 comments on commit 566e28b

Please sign in to comment.