diff --git a/languages/en_GB/custom-pages.json b/languages/en_GB/custom-pages.json new file mode 100644 index 0000000..7c94f6f --- /dev/null +++ b/languages/en_GB/custom-pages.json @@ -0,0 +1,15 @@ +{ + "custom-pages": "Custom Pages", + "intro": "Define and customise your new routes here.", + "add-content-info": "You can add content to your new routes from Extend → Widgets.", + "navigation-info": "You can add your new route to the site navigation from General → Navigation and select \"Custom Route\".", + "homepage-info": "If you wish to set a custom page as your homepage, go to General → Homepage and select \"Custom\".", + "page-title": "Page Title", + "path-to-page": "Path to Page", + "restrict-groups": "Restrict access to groups (leave blank for public):", + "saved": "Custom pages saved and activated", + "area-header": "%1 Header", + "area-footer": "%1 Footer", + "area-sidebar": "%1 Sidebar", + "area-content": "%1 Content" +} diff --git a/languages/he/custom-pages.json b/languages/he/custom-pages.json new file mode 100644 index 0000000..f8b7891 --- /dev/null +++ b/languages/he/custom-pages.json @@ -0,0 +1,15 @@ +{ + "custom-pages": "דפים מותאמים אישית", + "intro": "כאן ניתן להגדיר ולהתאים אישית נתיבים חדשים.", + "add-content-info": "ניתן להוסיף תוכן לנתיבים החדשים מתוך הרחבה ← רכיבים.", + "navigation-info": "ניתן להוסיף את הנתיב החדש לניווט האתר מתוך כללי ← ניווט ולבחור באפשרות \"נתיב מותאם אישית\".", + "homepage-info": "אם ברצונך להגדיר דף מותאם אישית כדף הבית, גש אל כללי ← דף הבית ובחר באפשרות \"מותאם אישית\".", + "page-title": "כותרת הדף", + "path-to-page": "נתיב לדף", + "restrict-groups": "הגבל גישה לקבוצות (השאר ריק לכלל הציבור):", + "saved": "הדפים המותאמים אישית נשמרו והופעלו", + "area-header": "כותרת עליונה של %1", + "area-footer": "כותרת תחתונה של %1", + "area-sidebar": "סרגל צד של %1", + "area-content": "תוכן של %1" +} diff --git a/library.js b/library.js index 3a6be10..ce85ae9 100644 --- a/library.js +++ b/library.js @@ -90,7 +90,7 @@ async function renderAdmin(req, res) { getGroupList(), ]); res.render('admin/plugins/custom-pages', { - title: 'Custom Pages', + title: '[[custom-pages:custom-pages]]', pages: pages, groups: groups, }); @@ -135,22 +135,22 @@ plugin.setWidgetAreas = async function (areas) { if (data.hasOwnProperty(d)) { areas = areas.concat([ { - name: data[d].name + ' Header', + name: '[[custom-pages:area-header, ' + data[d].name + ']]', template: data[d].route + '.tpl', location: 'header', }, { - name: data[d].name + ' Footer', + name: '[[custom-pages:area-footer, ' + data[d].name + ']]', template: data[d].route + '.tpl', location: 'footer', }, { - name: data[d].name + ' Sidebar', + name: '[[custom-pages:area-sidebar, ' + data[d].name + ']]', template: data[d].route + '.tpl', location: 'sidebar', }, { - name: data[d].name + ' Content', + name: '[[custom-pages:area-content, ' + data[d].name + ']]', template: data[d].route + '.tpl', location: 'content', }, @@ -164,7 +164,7 @@ plugin.addAdminNavigation = async function (header) { header.plugins.push({ route: '/plugins/custom-pages', icon: 'fa-mobile', - name: 'Custom Pages', + name: '[[custom-pages:custom-pages]]', }); return header; }; diff --git a/plugin.json b/plugin.json index 4cd3895..d5064d9 100644 --- a/plugin.json +++ b/plugin.json @@ -18,5 +18,7 @@ "modules": { "../admin/plugins/custom-pages.js": "static/lib/admin.js" }, - "templates": "./templates" + "templates": "./templates", + "languages": "languages", + "defaultLang": "en_GB" } \ No newline at end of file diff --git a/static/lib/admin.js b/static/lib/admin.js index 6b92f76..8a6ecf5 100644 --- a/static/lib/admin.js +++ b/static/lib/admin.js @@ -68,7 +68,7 @@ define('admin/plugins/custom-pages', ['alerts'], function (alerts) { }); socket.emit('admin.settings.saveCustomPages', arr, function () { - alerts.success('Custom pages saved and activated'); + alerts.success('[[custom-pages:saved]]'); }); }); }; diff --git a/templates/admin/plugins/custom-pages.tpl b/templates/admin/plugins/custom-pages.tpl index 5184ee2..62053d1 100644 --- a/templates/admin/plugins/custom-pages.tpl +++ b/templates/admin/plugins/custom-pages.tpl @@ -1,7 +1,7 @@
- Define and customise your new routes here. + [[custom-pages:intro]]
- You can add content to your new routes from Extend → Widgets. + [[custom-pages:add-content-info, {config.relative_path}]]
- You can add your new route to the site navigation from General → Navigation and select "Custom Route". + [[custom-pages:navigation-info, {config.relative_path}]]
- If you wish to set a custom page as your homepage, go to General → Homepage and select "Custom". + [[custom-pages:homepage-info, {config.relative_path}]]