Zero108 Posted January 16, 2019 Share Posted January 16, 2019 (edited) Вставляю в GlobalTemplate перед </body> следующий код. Как вместо английского текста ниже optInOptions: вставить правильно ссылки на языковые строки вида {lang="aaa_pushes_on"}, чтобы работало? <!--Wonderpush starts here--> <script> (function(w,d,s,i,n){w[n]=w[n]||{q:[],init:function(o){w[n].initOpts=o;},ready:function(c){w[n].q.push(c);}}; setTimeout(function(j,k){if(!d.getElementById(i)){k=d.getElementsByTagName(s)[0];j=d.createElement(s);j.id=i; j.src="https://cdn.by.wonderpush.com/sdk/1.1/wonderpush-loader.min.js";k.parentNode.insertBefore(j,k);}},0); }(window,document,"script","wonderpush-jssdk-loader","WonderPush")); WonderPush.init({ webKey: "d42613ddbacf45f06333ff55fda2c7fe365c797f5d028089068319a201cf783", optInOptions: { externalBoxMessage: "We'd like to send you notifications", externalBoxExampleTitle: "Example notification", externalBoxExampleMessage: "This is an example notification", externalBoxDisclaimer: "You can always unsubscribe at anytime.", externalBoxProcessingMessage: "Subscribing...", externalBoxSuccessMessage: "Thanks for subscribing!", externalBoxFailureMessage: "Sorry, something went wrong.", externalBoxTooLongHint: "Poor connection or private browsing?", externalBoxCloseHint: "Close", modalBoxMessage: "We will send you personalized notifications.<br/>You can always unsubscribe at any time.", modalBoxButton: "Got it!" } }); </script> <!--Wonderpush ends here--> Edited January 16, 2019 by Zero108 Link to comment Share on other sites More sharing options...
siv1987 Posted January 16, 2019 Share Posted January 16, 2019 I. Создать для каждой опции отдельный лэнгII. Создать в одном лэнге весь список с опциямиIII. Создать объект optInOptions и использовать условие в зависимости от языка Link to comment Share on other sites More sharing options...
Zero108 Posted January 16, 2019 Author Share Posted January 16, 2019 (edited) Может быть я неправильно выразился. Существует ли простое решение, так как конструкция вида externalBoxMessage: "{lang="aaa_pushes_on"}", скорее всего работать не будет из-за кавычек. Прошу подсказать простое решение, если оно существует. Есть ли какой-то вариант с изменением синтаксиса? Edited January 16, 2019 by Zero108 Link to comment Share on other sites More sharing options...
siv1987 Posted January 16, 2019 Share Posted January 16, 2019 Должно работать, что кавычки интерпретирует содержимое внутри как простой текст в шаблонах?Я бы еще проще сделал optInOptions: { {lang="aaa_pushes_on"} }и все опции загнал в одном лэнге, не удобно за то практично. В IPS еще есть js языковые строки как вариант ips.getString('lang_key') 1 Link to comment Share on other sites More sharing options...
Zero108 Posted January 16, 2019 Author Share Posted January 16, 2019 Да, действительно, двойные ковычки не помеха. Поторопился с созданием темы. Иногда проще методом тыка. Спасибо. externalBoxMessage: "{lang="aaa_pushes_on"}", Link to comment Share on other sites More sharing options...
Dmitriy427 Posted January 17, 2019 Share Posted January 17, 2019 Dell. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now