Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
pass all locales in the dom
Ioannis committed Apr 5, 2024
1 parent 4e0b92e commit bf27f1e
Showing 4 changed files with 24 additions and 4 deletions.
19 changes: 19 additions & 0 deletions 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));
}

/**
4 changes: 2 additions & 2 deletions Lib/lang.php
@@ -1,6 +1,6 @@
<?php

$cm_grouper_lite_widget_texts['en_US'] = array(
$cm_grouper_lite_widget_texts['en_US'] = [
'pl.grouperlite.config.display.title' => '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',
);
];
3 changes: 2 additions & 1 deletion View/GrouperGroups/index.ctp
@@ -75,8 +75,9 @@ $suffix = Configure::read('debug') > 0 ? '?time=' . time() : '';
hasActAs: <?= (int)!empty($vv_act_as_people) ?>,
actAsRecordId: <?= $vv_act_as_record_id ?? -1 ?>,
actAsPerson: <?= json_encode($vv_act_as_people ?? []) ?>,
permissions: <?= json_encode($permissions, JSON_THROW_ON_ERROR) ?>,
permissions: <?= json_encode($permissions, JSON_THROW_ON_ERROR) ?>
},
all: <?= json_encode($vv_cm_texts) ?>,
txt: {
adhocHeading: "<?= $vv_config['CoGrouperLiteWidget']['adhoc_heading'] ?? 'Ad-hoc groups' ?>",
wgHeading: "<?= $vv_config['CoGrouperLiteWidget']['wg_heading'] ?? 'Working groups' ?>",
2 changes: 1 addition & 1 deletion webroot/js/autocomplete.js
@@ -23,7 +23,7 @@ export default {
default: ''
}
},
inject: ['txt', 'api'],
inject: ['txt', 'api', 'all'],
data() {
return {
search: '',

0 comments on commit bf27f1e

Please sign in to comment.