Skip to content

Commit f7dd3dd

Browse files
committed
Add missing domains and use trans instead of l
1 parent c4a9fa4 commit f7dd3dd

2 files changed

Lines changed: 31 additions & 31 deletions

File tree

classes/Form/ConfigurationForm.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -70,88 +70,88 @@ public function generate()
7070
$helper->submit_action = 'submit' . $this->module->name;
7171
$helper->toolbar_btn = [
7272
'save' => [
73-
'desc' => $this->module->l('Save'),
73+
'desc' => $this->module->getTranslator()->trans('Save', [], 'Modules.GAnalytics.Admin'),
7474
'href' => AdminController::$currentIndex . '&configure=' . $this->module->name . '&save=' . $this->module->name .
7575
'&token=' . $helper->token,
7676
],
7777
'back' => [
7878
'href' => AdminController::$currentIndex . '&token=' . $helper->token,
79-
'desc' => $this->module->l('Back to list'),
79+
'desc' => $this->module->getTranslator()->trans('Back to list', [], 'Modules.GAnalytics.Admin'),
8080
],
8181
];
8282

8383
$fields_form = [];
8484
// Init Fields form array
8585
$fields_form[0]['form'] = [
8686
'legend' => [
87-
'title' => $this->module->l('Settings'),
87+
'title' => $this->module->getTranslator()->trans('Settings', [], 'Modules.GAnalytics.Admin'),
8888
],
8989
'input' => [
9090
[
9191
'type' => 'text',
92-
'label' => $this->module->l('Google Analytics Tracking ID'),
92+
'label' => $this->module->getTranslator()->trans('Google Analytics Tracking ID', [], 'Modules.GAnalytics.Admin'),
9393
'name' => 'GA_ACCOUNT_ID',
9494
'size' => 20,
9595
'required' => true,
96-
'hint' => $this->module->l('This information is available in your Google Analytics account'),
96+
'hint' => $this->module->getTranslator()->trans('This information is available in your Google Analytics account', [], 'Modules.GAnalytics.Admin'),
9797
],
9898
[
9999
'type' => 'switch',
100-
'label' => $this->module->l('Enable User ID tracking'),
100+
'label' => $this->module->getTranslator()->trans('Enable User ID tracking', [], 'Modules.GAnalytics.Admin'),
101101
'name' => 'GA_USERID_ENABLED',
102102
'values' => [
103103
[
104104
'id' => 'ga_userid_enabled',
105105
'value' => 1,
106-
'label' => $this->module->l('Yes'),
106+
'label' => $this->module->getTranslator()->trans('Yes', [], 'Modules.GAnalytics.Admin'),
107107
],
108108
[
109109
'id' => 'ga_userid_disabled',
110110
'value' => 0,
111-
'label' => $this->module->l('No'),
111+
'label' => $this->module->getTranslator()->trans('No', [], 'Modules.GAnalytics.Admin'),
112112
], ],
113113
],
114114
[
115115
'type' => 'switch',
116-
'label' => $this->module->l('Anonymize IP'),
116+
'label' => $this->module->getTranslator()->trans('Anonymize IP', [], 'Modules.GAnalytics.Admin'),
117117
'name' => 'GA_ANONYMIZE_ENABLED',
118-
'hint' => $this->module->l('Use this option to anonymize the visitor’s IP to comply with data privacy laws in some countries'),
118+
'hint' => $this->module->getTranslator()->trans('Use this option to anonymize the visitor’s IP to comply with data privacy laws in some countries', [], 'Modules.GAnalytics.Admin'),
119119
'values' => [
120120
[
121121
'id' => 'ga_anonymize_enabled',
122122
'value' => 1,
123-
'label' => $this->module->l('Yes'),
123+
'label' => $this->module->getTranslator()->trans('Yes', [], 'Modules.GAnalytics.Admin'),
124124
],
125125
[
126126
'id' => 'ga_anonymize_disabled',
127127
'value' => 0,
128-
'label' => $this->module->l('No'),
128+
'label' => $this->module->getTranslator()->trans('No', [], 'Modules.GAnalytics.Admin'),
129129
],
130130
],
131131
],
132132
[
133133
'type' => 'switch',
134-
'label' => $this->module->l('Enable Back Office Tracking'),
134+
'label' => $this->module->getTranslator()->trans('Enable Back Office Tracking', [], 'Modules.GAnalytics.Admin'),
135135
'name' => 'GA_TRACK_BACKOFFICE_ENABLED',
136-
'hint' => $this->module->l('Use this option to enable the tracking inside the Back Office'),
136+
'hint' => $this->module->getTranslator()->trans('Use this option to enable the tracking inside the Back Office', [], 'Modules.GAnalytics.Admin'),
137137
'values' => [
138138
[
139139
'id' => 'ga_track_backoffice',
140140
'value' => 1,
141-
'label' => $this->module->l('Yes'),
141+
'label' => $this->module->getTranslator()->trans('Yes', [], 'Modules.GAnalytics.Admin'),
142142
],
143143
[
144144
'id' => 'ga_do_not_track_backoffice',
145145
'value' => 0,
146-
'label' => $this->module->l('No'),
146+
'label' => $this->module->getTranslator()->trans('No', [], 'Modules.GAnalytics.Admin'),
147147
],
148148
],
149149
],
150150
[
151151
'type' => 'select',
152-
'label' => $this->module->l('Cancelled order states'),
152+
'label' => $this->module->getTranslator()->trans('Cancelled order states', [], 'Modules.GAnalytics.Admin'),
153153
'name' => 'GA_CANCELLED_STATES',
154-
'desc' => $this->module->l('Choose order states, in which you consider the given order cancelled. This will be usually only the default "Cancelled" state, but some shops may have extra states like "Returned" etc.'),
154+
'desc' => $this->module->getTranslator()->trans('Choose order states, in which you consider the given order cancelled. This will be usually only the default "Cancelled" state, but some shops may have extra states like "Returned" etc.', [], 'Modules.GAnalytics.Admin'),
155155
'class' => 'chosen',
156156
'multiple' => true,
157157
'options' => [
@@ -162,25 +162,25 @@ public function generate()
162162
],
163163
],
164164
'submit' => [
165-
'title' => $this->module->l('Save'),
165+
'title' => $this->module->getTranslator()->trans('Save', [], 'Modules.GAnalytics.Admin'),
166166
],
167167
];
168168

169169
if ($is_multistore_active) {
170170
$fields_form[0]['form']['input'][] = [
171171
'type' => 'switch',
172-
'label' => $this->module->l('Enable Cross-Domain tracking'),
172+
'label' => $this->module->getTranslator()->trans('Enable Cross-Domain tracking', [], 'Modules.GAnalytics.Admin'),
173173
'name' => 'GA_CROSSDOMAIN_ENABLED',
174174
'values' => [
175175
[
176176
'id' => 'ga_crossdomain_enabled',
177177
'value' => 1,
178-
'label' => $this->module->l('Yes'),
178+
'label' => $this->module->getTranslator()->trans('Yes', [], 'Modules.GAnalytics.Admin'),
179179
],
180180
[
181181
'id' => 'ga_crossdomain_disabled',
182182
'value' => 0,
183-
'label' => $this->module->l('No'),
183+
'label' => $this->module->getTranslator()->trans('No', [], 'Modules.GAnalytics.Admin'),
184184
],
185185
],
186186
];
@@ -215,35 +215,35 @@ public function treat()
215215
if (!empty($gaAccountId)) {
216216
Configuration::updateValue('GA_ACCOUNT_ID', $gaAccountId);
217217
Configuration::updateValue('GANALYTICS_CONFIGURATION_OK', true);
218-
$treatmentResult .= $this->module->displayConfirmation($this->module->l('Account ID updated successfully'));
218+
$treatmentResult .= $this->module->displayConfirmation($this->module->getTranslator()->trans('Account ID updated successfully', [], 'Modules.GAnalytics.Admin'));
219219
}
220220

221221
if (null !== $gaUserIdEnabled) {
222222
Configuration::updateValue('GA_USERID_ENABLED', (bool) $gaUserIdEnabled);
223-
$treatmentResult .= $this->module->displayConfirmation($this->module->l('Settings for User ID updated successfully'));
223+
$treatmentResult .= $this->module->displayConfirmation($this->module->getTranslator()->trans('Settings for User ID updated successfully', [], 'Modules.GAnalytics.Admin'));
224224
}
225225

226226
if (null !== $gaCrossdomainEnabled) {
227227
Configuration::updateValue('GA_CROSSDOMAIN_ENABLED', (bool) $gaCrossdomainEnabled);
228-
$treatmentResult .= $this->module->displayConfirmation($this->module->l('Settings for User ID updated successfully'));
228+
$treatmentResult .= $this->module->displayConfirmation($this->module->getTranslator()->trans('Settings for User ID updated successfully', [], 'Modules.GAnalytics.Admin'));
229229
}
230230

231231
if (null !== $gaAnonymizeEnabled) {
232232
Configuration::updateValue('GA_ANONYMIZE_ENABLED', (bool) $gaAnonymizeEnabled);
233-
$treatmentResult .= $this->module->displayConfirmation($this->module->l('Settings for Anonymize IP updated successfully'));
233+
$treatmentResult .= $this->module->displayConfirmation($this->module->getTranslator()->trans('Settings for Anonymize IP updated successfully', [], 'Modules.GAnalytics.Admin'));
234234
}
235235

236236
if (null !== $gaTrackBackOffice) {
237237
Configuration::updateValue('GA_TRACK_BACKOFFICE_ENABLED', (bool) $gaTrackBackOffice);
238-
$treatmentResult .= $this->module->displayConfirmation($this->module->l('Settings for Enable Back Office tracking updated successfully'));
238+
$treatmentResult .= $this->module->displayConfirmation($this->module->getTranslator()->trans('Settings for Enable Back Office tracking updated successfully', [], 'Modules.GAnalytics.Admin'));
239239
}
240240

241241
if ($gaCancelledStates === false) {
242242
Configuration::updateValue('GA_CANCELLED_STATES', '');
243243
} else {
244244
Configuration::updateValue('GA_CANCELLED_STATES', json_encode($gaCancelledStates));
245245
}
246-
$treatmentResult .= $this->module->displayConfirmation($this->module->l('Settings for cancelled order states updated successfully'));
246+
$treatmentResult .= $this->module->displayConfirmation($this->module->getTranslator()->trans('Settings for cancelled order states updated successfully', [], 'Modules.GAnalytics.Admin'));
247247

248248
return $treatmentResult;
249249
}

ps_googleanalytics.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public function __construct()
6262

6363
parent::__construct();
6464

65-
$this->displayName = $this->l('Google Analytics');
66-
$this->description = $this->l('Gain clear insights into important metrics about your customers, using Google Analytics');
67-
$this->confirmUninstall = $this->l('Are you sure you want to uninstall Google Analytics? You will lose all the data related to this module.');
65+
$this->displayName = $this->trans('Google Analytics', [], 'Modules.GAnalytics.Admin');
66+
$this->description = $this->trans('Gain clear insights into important metrics about your customers, using Google Analytics', [], 'Modules.GAnalytics.Admin');
67+
$this->confirmUninstall = $this->trans('Are you sure you want to uninstall Google Analytics? You will lose all the data related to this module.', [], 'Modules.GAnalytics.Admin');
6868
$this->psVersionIs17 = (bool) version_compare(_PS_VERSION_, '1.7', '>=');
6969
}
7070

0 commit comments

Comments
 (0)