diff --git a/languages/en-GB/persona.json b/languages/en-GB/persona.json new file mode 100644 index 0000000..ffbe507 --- /dev/null +++ b/languages/en-GB/persona.json @@ -0,0 +1,3 @@ +{ + "mobile-menu-side": "Switch which side each mobile menu is on" +} \ No newline at end of file diff --git a/languages/en-US/persona.json b/languages/en-US/persona.json new file mode 100644 index 0000000..ffbe507 --- /dev/null +++ b/languages/en-US/persona.json @@ -0,0 +1,3 @@ +{ + "mobile-menu-side": "Switch which side each mobile menu is on" +} \ No newline at end of file diff --git a/lib/persona.js b/lib/persona.js index 80b57a1..a7f8cd6 100644 --- a/lib/persona.js +++ b/lib/persona.js @@ -268,17 +268,21 @@ $(document).ready(function() { function setupSetting() { if (ajaxify.data.template['account/settings'] && !document.getElementById('persona:menus:legacy-layout')) { - $('
') - .appendTo('#content .account > .row > div:first-child') - .find('input') - .prop('checked', Storage.getItem('persona:menus:legacy-layout', 'true')) - .change(function (e) { - if (e.target.checked) { - Storage.setItem('persona:menus:legacy-layout', 'true'); - } else { - Storage.removeItem('persona:menus:legacy-layout'); - } + require(['translator'], function (translator) { + translator.translate('[[persona:mobile-menu-side]]', function (translated) { + $('
') + .appendTo('#content .account > .row > div:first-child') + .find('input') + .prop('checked', Storage.getItem('persona:menus:legacy-layout', 'true')) + .change(function (e) { + if (e.target.checked) { + Storage.setItem('persona:menus:legacy-layout', 'true'); + } else { + Storage.removeItem('persona:menus:legacy-layout'); + } + }); }); + }) } } diff --git a/plugin.json b/plugin.json index d643683..d2ded57 100644 --- a/plugin.json +++ b/plugin.json @@ -21,5 +21,6 @@ }, "acpScripts": [ "lib/admin.js" - ] + ], + "languages": "languages" } \ No newline at end of file