Skip to content

Commit 0d6437f

Browse files
committed
Translate all groups on BCC Login Settings page
1 parent 7b9068d commit 0d6437f

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

plugins/bcc-login/includes/class-bcc-coreapi-client.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ public function get_all_groups() {
5555
return $this->_all_groups;
5656
}
5757

58+
function get_translated_all_groups() {
59+
$all_groups = $this->get_all_groups();
60+
61+
foreach ($all_groups as $id => $group) {
62+
$all_groups[$id]->name = __( $group->name, 'bcc-login' );
63+
}
64+
65+
return $all_groups;
66+
}
67+
5868
function get_site_groups() {
5969
if (isset($this->_site_groups)) {
6070
return $this->_site_groups;

plugins/bcc-login/includes/class-bcc-login-settings.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ function register_settings() {
377377
);
378378

379379
if ($use_groups_settings) {
380-
$all_groups = $this->_coreapi->get_all_groups();
380+
$all_groups = $this->_coreapi->get_translated_all_groups();
381381

382382
add_settings_field(
383383
'bcc_site_group_tags',
@@ -786,9 +786,9 @@ private function createGUID() {
786786
$set_uuid = chr(123)
787787
.substr($set_charid, 0, 8).$set_hyphen
788788
.substr($set_charid, 8, 4).$set_hyphen
789-
.substr($set_charid,12, 4).$set_hyphen
790-
.substr($set_charid,16, 4).$set_hyphen
791-
.substr($set_charid,20,12)
789+
.substr($set_charid, 12, 4).$set_hyphen
790+
.substr($set_charid, 16, 4).$set_hyphen
791+
.substr($set_charid, 20, 12)
792792
.chr(125);
793793
// "}"
794794
return $set_uuid;

0 commit comments

Comments
 (0)