AntonLV 9 лет назад
Родитель
Сommit
1bcf25b0ff

+ 7 - 3
inc/js/classes/BxDolPush.js

@@ -8,6 +8,10 @@ function BxDolPush(oOptions) {
     this._sSubfolder = oOptions.sSubfolder == undefined ? '/plugins_public/onesignal/' : oOptions.sSubfolder;
     this._sNotificationUrl = oOptions.sNotificationUrl == undefined ? '' : oOptions.sNotificationUrl;
 
+    this._sTxtNotificationRequest = oOptions.sTxtNotificationRequest == undefined ? 'Would you like to get notifications' : oOptions.sTxtNotificationRequest;
+    this._sTxtNotificationRequestYes = oOptions.sTxtNotificationRequestYes == undefined ? 'Yes' : oOptions.sTxtNotificationRequestYes;
+    this._sTxtNotificationRequestNo = oOptions.sTxtNotificationRequestNo == undefined ? 'No' : oOptions.sTxtNotificationRequestNo;
+
     var $this = this;
     $(document).ready(function() {
     	$this.init();
@@ -40,11 +44,11 @@ BxDolPush.prototype.init = function() {
 		promptOptions: {
 			/* These prompt options values configure both the HTTP prompt and the HTTP popup. */
 			/* actionMessage limited to 90 characters */
-			actionMessage: _t('_sys_push_notification_request', $this._sSiteName), 
+			actionMessage: $this._sTxtNotificationRequest, 
 			/* acceptButtonText limited to 15 characters */
-			acceptButtonText: _t('_sys_push_notification_request_yes'),
+			acceptButtonText: $this._sTxtNotificationRequestYes,
 			/* cancelButtonText limited to 15 characters */
-			cancelButtonText: _t('_sys_push_notification_request_no')
+			cancelButtonText: $this._sTxtNotificationRequestNo
 		}
 	}]);
 

+ 1 - 1
modules/boonex/russian/data/langs/system/ru.xml

@@ -2306,7 +2306,7 @@
 	<string name="_sys_ps_group_title_public"><![CDATA[Публичные]]></string>
 	<string name="_sys_ps_group_title_closed"><![CDATA[Закрытая]]></string>
     <string name="_sys_ps_group_title_secret"><![CDATA[Секретная]]></string>
-	<string name="_sys_push_notification_request"><![CDATA[Вы не хотели бы получать уведомления с сайта {0}?]]></string>   
+	<string name="_sys_push_notification_request"><![CDATA[Хотите получать уведомления с сайта {0}?]]></string>   
     <string name="_sys_push_notification_request_yes"><![CDATA[Да]]></string>   
     <string name="_sys_push_notification_request_no"><![CDATA[Нет, спасибо]]></string>
     <string name="_sys_read_more"><![CDATA[Продолжить чтение "{0}"]]></string>

+ 3 - 6
template/scripts/BxBaseServices.php

@@ -200,12 +200,6 @@ class BxBaseServices extends BxDol implements iBxDolProfileService
             'BxDolPush.js',
         ));
 
-        $oTemplate->addJsTranslation(array(
-            '_sys_push_notification_request',
-            '_sys_push_notification_request_yes',
-            '_sys_push_notification_request_no'
-        ));
-
         $sJsClass = 'BxDolPush';
         $sJsObject = 'oBxDolPush';
 
@@ -218,6 +212,9 @@ class BxBaseServices extends BxDol implements iBxDolProfileService
             'sSafariWebId' => $sSafariWebId,
             'sSubfolder' => $sSubfolder,
             'sNotificationUrl' => BX_DOL_URL_ROOT,
+            'sTxtNotificationRequest' => bx_js_string(_t('_sys_push_notification_request', getParam('site_title'))),
+            'sTxtNotificationRequestYes' => bx_js_string(_t('_sys_push_notification_request_yes')),
+            'sTxtNotificationRequestNo' => bx_js_string(_t('_sys_push_notification_request_no')),
         )) . ");";
 
         return $oTemplate->_wrapInTagJsCode($sContent);