From bf27f1e4ec7ad2b95f3aafdb39c3b450cb930838 Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Fri, 5 Apr 2024 11:04:50 +0300 Subject: [PATCH] pass all locales in the dom --- Controller/GrouperGroupsController.php | 19 +++++++++++++++++++ Lib/lang.php | 4 ++-- View/GrouperGroups/index.ctp | 3 ++- webroot/js/autocomplete.js | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index d73199d..4a7610b 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -159,6 +159,25 @@ public function beforeFilter() $cfg['CoGrouperLiteWidget']['identifier_type']); $this->setActAsIdentifier($act_as_identifier); } + + // XXX Localizations + // Get all the localizations in an array + global $cm_texts; + global $cm_lang; + + $texts = []; + + foreach(array_keys($cm_texts[$cm_lang]) as $k) { + if(!is_array($cm_texts[$cm_lang][$k]) + // Also skip strings that can already be dynamically changed + && !preg_match('/^em\./', $k)) { + $texts[$k] = $cm_texts[$cm_lang][$k]; + } + } + + ksort($texts); + + $this->set('vv_cm_texts', Hash::expand($texts)); } /** diff --git a/Lib/lang.php b/Lib/lang.php index 11bccc5..8152ae0 100644 --- a/Lib/lang.php +++ b/Lib/lang.php @@ -1,6 +1,6 @@ 'Grouper Configuration Settings', 'pl.grouperlite.config.edit.title' => 'Edit Grouper Configuration Settings', 'pl.grouperlite.config.grouper-url' => 'Grouper Site URL', @@ -179,4 +179,4 @@ 'pl.grouperlite.members.empty' => 'This group has no member OR you are not authorized to see the members of this group.', 'er.grouperlite.glid' => 'Named parameter glid was not found', -); \ No newline at end of file +]; \ No newline at end of file diff --git a/View/GrouperGroups/index.ctp b/View/GrouperGroups/index.ctp index 6733cdd..16261ea 100644 --- a/View/GrouperGroups/index.ctp +++ b/View/GrouperGroups/index.ctp @@ -75,8 +75,9 @@ $suffix = Configure::read('debug') > 0 ? '?time=' . time() : ''; hasActAs: , actAsRecordId: , actAsPerson: , - permissions: , + permissions: }, + all: , txt: { adhocHeading: "", wgHeading: "", diff --git a/webroot/js/autocomplete.js b/webroot/js/autocomplete.js index a32cd11..3baf2b4 100644 --- a/webroot/js/autocomplete.js +++ b/webroot/js/autocomplete.js @@ -23,7 +23,7 @@ export default { default: '' } }, - inject: ['txt', 'api'], + inject: ['txt', 'api', 'all'], data() { return { search: '',