Browse Source

Multi-language support! 🎏

v0.5.8
Ramiro Saenz 8 years ago
parent
commit
96544aa63e
  1. 10
      app/Application.js
  2. 1
      app/model/ServiceList.js
  3. 92
      app/store/ServicesList.js
  4. 4
      app/ux/Auth0.js
  5. 6
      app/ux/WebView.js
  6. 24
      app/view/add/Add.js
  7. 2
      app/view/add/AddController.js
  8. 14
      app/view/main/About.js
  9. 44
      app/view/main/Main.js
  10. 24
      app/view/main/MainController.js
  11. 64
      app/view/preferences/Preferences.js
  12. 9
      app/view/preferences/PreferencesController.js
  13. 17
      electron/main.js
  14. 539
      electron/menu.js
  15. 10
      index.html
  16. 51
      languages.js
  17. 1
      resources/languages/af.js
  18. 1
      resources/languages/ar.js
  19. 1
      resources/languages/ca.js
  20. 1
      resources/languages/cs.js
  21. 1
      resources/languages/da.js
  22. 1
      resources/languages/de.js
  23. 1
      resources/languages/el.js
  24. 1
      resources/languages/en.js
  25. 1
      resources/languages/es-ES.js
  26. 1
      resources/languages/fa.js
  27. 1
      resources/languages/fi.js
  28. 1
      resources/languages/fr.js
  29. 1
      resources/languages/he.js
  30. 1
      resources/languages/hu.js
  31. 1
      resources/languages/id.js
  32. 1
      resources/languages/it.js
  33. 1
      resources/languages/ja.js
  34. 1
      resources/languages/ko.js
  35. 1
      resources/languages/nl.js
  36. 1
      resources/languages/no.js
  37. 1
      resources/languages/pl.js
  38. 1
      resources/languages/pt-BR.js
  39. 1
      resources/languages/pt-PT.js
  40. 1
      resources/languages/ro.js
  41. 1
      resources/languages/ru.js
  42. 1
      resources/languages/sr.js
  43. 1
      resources/languages/sv-SE.js
  44. 1
      resources/languages/tr.js
  45. 1
      resources/languages/uk.js
  46. 1
      resources/languages/vi.js
  47. 1
      resources/languages/zh-CN.js
  48. 1
      resources/languages/zh-TW.js

10
app/Application.js

@ -227,17 +227,17 @@ Ext.define('Rambox.Application', {
'->' '->'
,{ ,{
xtype: 'label' xtype: 'label'
,html: '<b>New version is available!</b> ('+json.version+')' + ( process.platform === 'win32' ? ' Is downloading in the background and you will notify when is ready to install it.' : '' ) ,html: '<b>'+locale['app.update[0]']+'</b> ('+json.version+')' + ( process.platform === 'win32' ? ' Is downloading in the background and you will notify when is ready to install it.' : '' )
} }
,{ ,{
xtype: 'button' xtype: 'button'
,text: 'Download' ,text: locale['app.update[1]']
,href: process.platform === 'darwin' ? 'https://getrambox.herokuapp.com/download/'+process.platform+'_'+process.arch : 'https://github.com/saenzramiro/rambox/releases/latest' ,href: process.platform === 'darwin' ? 'https://getrambox.herokuapp.com/download/'+process.platform+'_'+process.arch : 'https://github.com/saenzramiro/rambox/releases/latest'
,hidden: process.platform === 'win32' ,hidden: process.platform === 'win32'
} }
,{ ,{
xtype: 'button' xtype: 'button'
,text: 'Changelog' ,text: locale['app.update[2]']
,ui: 'decline' ,ui: 'decline'
,tooltip: 'Click here to see more information about the new version.' ,tooltip: 'Click here to see more information about the new version.'
,href: 'https://github.com/saenzramiro/rambox/releases/tag/'+json.version ,href: 'https://github.com/saenzramiro/rambox/releases/tag/'+json.version
@ -255,8 +255,8 @@ Ext.define('Rambox.Application', {
return; return;
} else if ( !silence ) { } else if ( !silence ) {
Ext.Msg.show({ Ext.Msg.show({
title: 'You are up to date!' title: locale['app.update[3]']
,message: 'You have the latest version of Rambox.' ,message: locale['app.update[4]']
,icon: Ext.Msg.INFO ,icon: Ext.Msg.INFO
,buttons: Ext.Msg.OK ,buttons: Ext.Msg.OK
}); });

1
app/model/ServiceList.js

@ -13,6 +13,7 @@ Ext.define('Rambox.model.ServiceList', {
},{ },{
name: 'description' name: 'description'
,type: 'string' ,type: 'string'
,defaultValue: locale['services[27]']
},{ },{
name: 'url' name: 'url'
,type: 'string' ,type: 'string'

92
app/store/ServicesList.js

@ -25,7 +25,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'whatsapp' id: 'whatsapp'
,logo: 'whatsapp.png' ,logo: 'whatsapp.png'
,name: 'WhatsApp' ,name: 'WhatsApp'
,description: 'WhatsApp is a cross-platform mobile messaging app for iPhone, BlackBerry, Android, Windows Phone and Nokia. Send text, video, images, audio for free.' ,description: locale['services[0]']
,url: 'https://web.whatsapp.com/' ,url: 'https://web.whatsapp.com/'
,type: 'messaging' ,type: 'messaging'
,js_unread: 'function checkUnread(){var a=document.getElementsByClassName("infinite-list-item"),b=0;for(i=0;i<a.length;i++)if(!(a[i].getElementsByClassName("icon-muted").length>0||0===a[i].getElementsByClassName("unread-count").length)){var c=parseInt(a[i].getElementsByClassName("unread-count")[0].innerHTML.trim());b+=isNaN(c)?0:c}updateBadge(b)}function updateBadge(count) { if (count && count >= 1) { rambox.setUnreadCount(count); } else { rambox.clearUnreadCount(); } }setInterval(checkUnread,1e3);' ,js_unread: 'function checkUnread(){var a=document.getElementsByClassName("infinite-list-item"),b=0;for(i=0;i<a.length;i++)if(!(a[i].getElementsByClassName("icon-muted").length>0||0===a[i].getElementsByClassName("unread-count").length)){var c=parseInt(a[i].getElementsByClassName("unread-count")[0].innerHTML.trim());b+=isNaN(c)?0:c}updateBadge(b)}function updateBadge(count) { if (count && count >= 1) { rambox.setUnreadCount(count); } else { rambox.clearUnreadCount(); } }setInterval(checkUnread,1e3);'
@ -35,7 +35,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'slack' id: 'slack'
,logo: 'slack.png' ,logo: 'slack.png'
,name: 'Slack' ,name: 'Slack'
,description: 'Slack brings all your communication together in one place. It’s real-time messaging, archiving and search for modern teams.' ,description: locale['services[1]']
,url: 'https://___.slack.com/' ,url: 'https://___.slack.com/'
,type: 'messaging' ,type: 'messaging'
,js_unread: 'function checkUnread(){var a=0,b=0;$(".unread_msgs").each(function(){a+=isNaN(parseInt($(this).html())) ? 0 : parseInt($(this).html())}),$(".unread_highlights").each(function(){b+=isNaN(parseInt($(this).html())) ? 0 : parseInt($(this).html())}),updateBadge(a,b)}function updateBadge(a,b){var c=b>0?"("+b+") ":a>0?"(•) ":"";document.title=c+originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);' ,js_unread: 'function checkUnread(){var a=0,b=0;$(".unread_msgs").each(function(){a+=isNaN(parseInt($(this).html())) ? 0 : parseInt($(this).html())}),$(".unread_highlights").each(function(){b+=isNaN(parseInt($(this).html())) ? 0 : parseInt($(this).html())}),updateBadge(a,b)}function updateBadge(a,b){var c=b>0?"("+b+") ":a>0?"(•) ":"";document.title=c+originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);'
@ -44,7 +44,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'noysi' id: 'noysi'
,logo: 'noysi.png' ,logo: 'noysi.png'
,name: 'Noysi' ,name: 'Noysi'
,description: 'Noysi is a communication tool for teams where privacy is guaranteed. With Noysi you can access all your conversations and files in seconds from anywhere and unlimited.' ,description: locale['services[2]']
,url: 'https://noysi.com/#/identity/sign-in' ,url: 'https://noysi.com/#/identity/sign-in'
,type: 'messaging' ,type: 'messaging'
}, },
@ -52,7 +52,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'messenger' id: 'messenger'
,logo: 'messenger.png' ,logo: 'messenger.png'
,name: 'Messenger' ,name: 'Messenger'
,description: 'Instantly reach the people in your life for free. Messenger is just like texting, but you don\'t have to pay for every message.' ,description: locale['services[3]']
,url: 'https://www.messenger.com/login/' ,url: 'https://www.messenger.com/login/'
,type: 'messaging' ,type: 'messaging'
,titleBlink: true ,titleBlink: true
@ -62,7 +62,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'skype' id: 'skype'
,logo: 'skype.png' ,logo: 'skype.png'
,name: 'Skype' ,name: 'Skype'
,description: 'Stay in touch with family and friends for free. Get international calling, free online calls and Skype for Business on desktop and mobile.' ,description: locale['services[4]']
,url: 'https://web.skype.com/' ,url: 'https://web.skype.com/'
,type: 'messaging' ,type: 'messaging'
,userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586' ,userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586'
@ -72,7 +72,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'hangouts' id: 'hangouts'
,logo: 'hangouts.png' ,logo: 'hangouts.png'
,name: 'Hangouts' ,name: 'Hangouts'
,description: 'Hangouts bring conversations to life with photos, emoji, and even group video calls for free. Connect with friends across computers, Android, and Apple devices.' ,description: locale['services[5]']
,url: 'https://hangouts.google.com/' ,url: 'https://hangouts.google.com/'
,type: 'messaging' ,type: 'messaging'
,titleBlink: true ,titleBlink: true
@ -84,7 +84,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'hipchat' id: 'hipchat'
,logo: 'hipchat.png' ,logo: 'hipchat.png'
,name: 'HipChat' ,name: 'HipChat'
,description: 'HipChat is hosted group chat and video chat built for teams. Supercharge real-time collaboration with persistent chat rooms, file sharing, and screen sharing.' ,description: locale['services[6]']
,url: 'https://___.hipchat.com/chat' ,url: 'https://___.hipchat.com/chat'
,type: 'messaging' ,type: 'messaging'
,js_unread: 'function checkUnread(){var e=document.getElementsByClassName("hc-badge"),t=0;for(i=0;i<e.length;i++)t+=parseInt(e[i].innerHTML.trim());updateBadge(t)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);' ,js_unread: 'function checkUnread(){var e=document.getElementsByClassName("hc-badge"),t=0;for(i=0;i<e.length;i++)t+=parseInt(e[i].innerHTML.trim());updateBadge(t)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);'
@ -94,7 +94,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'telegram' id: 'telegram'
,logo: 'telegram.png' ,logo: 'telegram.png'
,name: 'Telegram' ,name: 'Telegram'
,description: 'Telegram is a messaging app with a focus on speed and security. It’s super-fast, simple, secure and free.' ,description: locale['services[7]']
,url: 'https://web.telegram.org/' ,url: 'https://web.telegram.org/'
,type: 'messaging' ,type: 'messaging'
,js_unread: 'function checkUnread(){var e=document.getElementsByClassName("im_dialog_badge badge"),t=0;for(i=0;i<e.length;i++)if(!e[i].classList.contains("im_dialog_badge_muted")){t+=parseInt(e[i].innerHTML.trim())}updateBadge(t)}function updateBadge(e){e>=1?rambox.setUnreadCount(e):rambox.clearUnreadCount()}setInterval(checkUnread,3000);' ,js_unread: 'function checkUnread(){var e=document.getElementsByClassName("im_dialog_badge badge"),t=0;for(i=0;i<e.length;i++)if(!e[i].classList.contains("im_dialog_badge_muted")){t+=parseInt(e[i].innerHTML.trim())}updateBadge(t)}function updateBadge(e){e>=1?rambox.setUnreadCount(e):rambox.clearUnreadCount()}setInterval(checkUnread,3000);'
@ -104,7 +104,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'wechat' id: 'wechat'
,logo: 'wechat.png' ,logo: 'wechat.png'
,name: 'WeChat' ,name: 'WeChat'
,description: 'WeChat is a free messaging calling app that allows you to easily connect with family; friends across countries. It’s the all-in-one communications app for free text (SMS/MMS), voice; video calls, moments, photo sharing, and games.' ,description: locale['services[8]']
,url: 'https://web.wechat.com/' ,url: 'https://web.wechat.com/'
,type: 'messaging' ,type: 'messaging'
}, },
@ -112,7 +112,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'gmail' id: 'gmail'
,logo: 'gmail.png' ,logo: 'gmail.png'
,name: 'Gmail' ,name: 'Gmail'
,description: 'Gmail, Google\'s free email service, is one of the world\'s most popular email programs.' ,description: locale['services[9]']
,url: 'https://mail.google.com/mail/' ,url: 'https://mail.google.com/mail/'
,type: 'email' ,type: 'email'
,allow_popups: true ,allow_popups: true
@ -123,7 +123,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'inbox' id: 'inbox'
,logo: 'inbox.png' ,logo: 'inbox.png'
,name: 'Inbox' ,name: 'Inbox'
,description: 'Inbox by Gmail is a new app from the Gmail team. Inbox is an organized place to get things done and get back to what matters. Bundles keep emails organized.' ,description: locale['services[10]']
,url: 'http://inbox.google.com/?cid=imp' ,url: 'http://inbox.google.com/?cid=imp'
,type: 'email' ,type: 'email'
,manual_notifications: true ,manual_notifications: true
@ -134,7 +134,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'chatwork' id: 'chatwork'
,logo: 'chatwork.png' ,logo: 'chatwork.png'
,name: 'ChatWork' ,name: 'ChatWork'
,description: 'ChatWork is a group chat app for business. Secure messaging, video chat, task management and file sharing. Real-time communication and increase productivity for teams.' ,description: locale['services[11]']
,url: 'https://www.chatwork.com/login.php' ,url: 'https://www.chatwork.com/login.php'
,type: 'messaging' ,type: 'messaging'
,note: 'To enable desktop notifications, you have to go to Options inside ChatWork.' ,note: 'To enable desktop notifications, you have to go to Options inside ChatWork.'
@ -143,7 +143,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'groupme' id: 'groupme'
,logo: 'groupme.png' ,logo: 'groupme.png'
,name: 'GroupMe' ,name: 'GroupMe'
,description: 'GroupMe brings group text messaging to every phone. Group message with the people in your life that are important to you.' ,description: locale['services[12]']
,url: 'https://web.groupme.com/signin' ,url: 'https://web.groupme.com/signin'
,type: 'messaging' ,type: 'messaging'
,note: 'To enable desktop notifications, you have to go to Options inside GroupMe. To count unread messages, be sure to be in Chats.' ,note: 'To enable desktop notifications, you have to go to Options inside GroupMe. To count unread messages, be sure to be in Chats.'
@ -154,7 +154,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'grape' id: 'grape'
,logo: 'grape.png' ,logo: 'grape.png'
,name: 'Grape' ,name: 'Grape'
,description: 'The world\'s most advanced team chat meets enterprise search' ,description: locale['services[13]']
,url: 'https://chatgrape.com/accounts/login/' ,url: 'https://chatgrape.com/accounts/login/'
,type: 'messaging' ,type: 'messaging'
}, },
@ -162,7 +162,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'gitter' id: 'gitter'
,logo: 'gitter.png' ,logo: 'gitter.png'
,name: 'Gitter' ,name: 'Gitter'
,description: 'Gitter is built on top of GitHub and is tightly integrated with your organisations, repositories, issues and activity.' ,description: locale['services[14]']
,url: 'https://gitter.im/' ,url: 'https://gitter.im/'
,type: 'messaging' ,type: 'messaging'
,js_unread: 'function checkUnread(){var e=document.getElementsByClassName("room-item__unread-indicator"),t=0;for(i=0;i<e.length;i++)t+=isNaN(parseInt(e[i].innerHTML.trim())) ? 0 : parseInt(e[i].innerHTML.trim());updateBadge(t)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);' ,js_unread: 'function checkUnread(){var e=document.getElementsByClassName("room-item__unread-indicator"),t=0;for(i=0;i<e.length;i++)t+=isNaN(parseInt(e[i].innerHTML.trim())) ? 0 : parseInt(e[i].innerHTML.trim());updateBadge(t)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);'
@ -171,7 +171,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'steam' id: 'steam'
,logo: 'steam.png' ,logo: 'steam.png'
,name: 'Steam Chat' ,name: 'Steam Chat'
,description: 'Steam is a digital distribution platform developed by Valve Corporation offering digital rights management (DRM), multiplayer gaming and social networking services.' ,description: locale['services[15]']
,url: 'https://steamcommunity.com/chat' ,url: 'https://steamcommunity.com/chat'
,type: 'messaging' ,type: 'messaging'
,note: 'To enable desktop notifications, you have to go to Options inside Steam Chat.' ,note: 'To enable desktop notifications, you have to go to Options inside Steam Chat.'
@ -181,7 +181,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'discord' id: 'discord'
,logo: 'discord.png' ,logo: 'discord.png'
,name: 'Discord' ,name: 'Discord'
,description: 'Step up your game with a modern voice & text chat app. Crystal clear voice, multiple server and channel support, mobile apps, and more.' ,description: locale['services[16]']
,url: 'https://discordapp.com/login' ,url: 'https://discordapp.com/login'
,type: 'messaging' ,type: 'messaging'
,titleBlink: true ,titleBlink: true
@ -192,7 +192,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'outlook' id: 'outlook'
,logo: 'outlook.png' ,logo: 'outlook.png'
,name: 'Outlook' ,name: 'Outlook'
,description: 'Take control. Do more. Outlook is the free email and calendar service that helps you stay on top of what matters and get things done.' ,description: locale['services[17]']
,url: 'https://mail.live.com/' ,url: 'https://mail.live.com/'
,type: 'email' ,type: 'email'
,manual_notifications: true ,manual_notifications: true
@ -202,7 +202,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'outlook365' id: 'outlook365'
,logo: 'outlook365.png' ,logo: 'outlook365.png'
,name: 'Outlook 365' ,name: 'Outlook 365'
,description: 'Outlook for Business' ,description: locale['services[18]']
,url: 'https://outlook.office.com/owa/' ,url: 'https://outlook.office.com/owa/'
,type: 'email' ,type: 'email'
,manual_notifications: true ,manual_notifications: true
@ -212,7 +212,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'yahoo' id: 'yahoo'
,logo: 'yahoo.png' ,logo: 'yahoo.png'
,name: 'Yahoo! Mail' ,name: 'Yahoo! Mail'
,description: 'Web-based email service offered by the American company Yahoo!. The service is free for personal use, and paid-for business email plans are available.' ,description: locale['services[19]']
,url: 'https://mail.yahoo.com/' ,url: 'https://mail.yahoo.com/'
,type: 'email' ,type: 'email'
,note: 'To enable desktop notifications, you have to go to Options inside Yahoo! Mail.' ,note: 'To enable desktop notifications, you have to go to Options inside Yahoo! Mail.'
@ -221,7 +221,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'protonmail' id: 'protonmail'
,logo: 'protonmail.png' ,logo: 'protonmail.png'
,name: 'ProtonMail' ,name: 'ProtonMail'
,description: 'Free and web-based encrypted email service founded in 2013 at the CERN research facility. ProtonMail is designed as a zero-knowledge system,[note 1] using client-side encryption to protect emails and user data before they are sent to ProtonMail servers, in contrast to other common webmail services such as Gmail and Hotmail.' ,description: locale['services[20]']
,url: 'https://mail.protonmail.com/inbox' ,url: 'https://mail.protonmail.com/inbox'
,type: 'email' ,type: 'email'
}, },
@ -229,7 +229,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'protonmailch' id: 'protonmailch'
,logo: 'protonmail.png' ,logo: 'protonmail.png'
,name: 'ProtonMail CH' ,name: 'ProtonMail CH'
,description: 'Free and web-based encrypted email service founded in 2013 at the CERN research facility. ProtonMail is designed as a zero-knowledge system,[note 1] using client-side encryption to protect emails and user data before they are sent to ProtonMail servers, in contrast to other common webmail services such as Gmail and Hotmail.' ,description: locale['services[20]']
,url: 'https://app.protonmail.ch/inbox' ,url: 'https://app.protonmail.ch/inbox'
,type: 'email' ,type: 'email'
,note: 'Read <a href="https://protonmail.com/support/knowledge-base/what-is-the-difference-between-protonmail-com-and-protonmail-ch/" target="_blank">HERE</a> to see the differences between protonmail.com and protonmail.ch.' ,note: 'Read <a href="https://protonmail.com/support/knowledge-base/what-is-the-difference-between-protonmail-com-and-protonmail-ch/" target="_blank">HERE</a> to see the differences between protonmail.com and protonmail.ch.'
@ -238,7 +238,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'tutanota' id: 'tutanota'
,logo: 'tutanota.png' ,logo: 'tutanota.png'
,name: 'Tutanota' ,name: 'Tutanota'
,description: 'Tutanota is an open-source end-to-end encrypted email software and freemium hosted secure email service based on this software' ,description: locale['services[21]']
,url: 'https://app.tutanota.de/' ,url: 'https://app.tutanota.de/'
,type: 'email' ,type: 'email'
}, },
@ -246,7 +246,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'hushmail' id: 'hushmail'
,logo: 'hushmail.png' ,logo: 'hushmail.png'
,name: 'Hushmail' ,name: 'Hushmail'
,description: 'Web-based email service offering PGP-encrypted e-mail and vanity domain service. Hushmail offers "free" and "paid" versions of service. Hushmail uses OpenPGP standards and the source is available for download.' ,description: locale['services[22]']
,url: 'https://www.hushmail.com/hushmail/index.php' ,url: 'https://www.hushmail.com/hushmail/index.php'
,type: 'email' ,type: 'email'
}, },
@ -254,7 +254,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'missive' id: 'missive'
,logo: 'missive.png' ,logo: 'missive.png'
,name: 'Missive' ,name: 'Missive'
,description: 'Collaborative email and threaded group chat for productive teams. A single app for all your internal and external communication.' ,description: locale['services[23]']
,url: 'https://mail.missiveapp.com/login' ,url: 'https://mail.missiveapp.com/login'
,type: 'messaging' ,type: 'messaging'
,js_unread: 'function checkUnread(){var e=document.getElementsByClassName("unseen-count"),t=0;for(i=0;i<e.length;i++)t+=parseInt(e[i].innerHTML.trim());updateBadge(t)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);' ,js_unread: 'function checkUnread(){var e=document.getElementsByClassName("unseen-count"),t=0;for(i=0;i<e.length;i++)t+=parseInt(e[i].innerHTML.trim());updateBadge(t)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);'
@ -263,7 +263,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'rocketchat' id: 'rocketchat'
,logo: 'rocketchat.png' ,logo: 'rocketchat.png'
,name: 'Rocket Chat' ,name: 'Rocket Chat'
,description: 'From group messages and video calls all the way to helpdesk killer features our goal is to become the number one cross-platform open source chat solution.' ,description: locale['services[24]']
,url: '___' ,url: '___'
,type: 'messaging' ,type: 'messaging'
,note: 'You have to use this service by signing in with your email or username (No SSO allowed yet).' ,note: 'You have to use this service by signing in with your email or username (No SSO allowed yet).'
@ -272,7 +272,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'wire' id: 'wire'
,logo: 'wire.png' ,logo: 'wire.png'
,name: 'Wire' ,name: 'Wire'
,description: 'HD quality calls, private and group chats with inline photos, music and video. Also available for your phone or tablet.' ,description: locale['services[25]']
,url: 'https://app.wire.com/' ,url: 'https://app.wire.com/'
,type: 'messaging' ,type: 'messaging'
}, },
@ -280,7 +280,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'sync' id: 'sync'
,logo: 'sync.png' ,logo: 'sync.png'
,name: 'Sync' ,name: 'Sync'
,description: 'Sync is a business chat tool that will boost productivity for your team.' ,description: locale['services[26]']
,url: 'https://m.wantedly.com/login' ,url: 'https://m.wantedly.com/login'
,type: 'messaging' ,type: 'messaging'
}, },
@ -295,7 +295,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'yahoomessenger' id: 'yahoomessenger'
,logo: 'yahoomessenger.png' ,logo: 'yahoomessenger.png'
,name: 'Yahoo! Messenger' ,name: 'Yahoo! Messenger'
,description: 'Allows you to instant message with anyone on the Yahoo server. Tells you when you get mail, and gives stock quotes.' ,description: locale['services[28]']
,url: 'https://messenger.yahoo.com/' ,url: 'https://messenger.yahoo.com/'
,type: 'messaging' ,type: 'messaging'
,js_unread: 'function checkUnread(){updateBadge(document.getElementsByClassName("list-item-unread-indicator").length)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);' ,js_unread: 'function checkUnread(){updateBadge(document.getElementsByClassName("list-item-unread-indicator").length)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);'
@ -304,7 +304,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'voxer' id: 'voxer'
,logo: 'voxer.png' ,logo: 'voxer.png'
,name: 'Voxer' ,name: 'Voxer'
,description: 'Voxer is a messaging app for your smartphone with live voice (like a PTT walkie talkie), text, photo and location sharing.' ,description: locale['services[29]']
,url: 'https://web.voxer.com/' ,url: 'https://web.voxer.com/'
,type: 'messaging' ,type: 'messaging'
}, },
@ -312,7 +312,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'dasher' id: 'dasher'
,logo: 'dasher.png' ,logo: 'dasher.png'
,name: 'Dasher' ,name: 'Dasher'
,description: 'Dasher lets you say what you really want with pics, GIFs, links and more. Take a poll to find out what your friends really think of your new boo.' ,description: locale['services[30]']
,url: 'https://dasher.im/' ,url: 'https://dasher.im/'
,type: 'messaging' ,type: 'messaging'
}, },
@ -320,7 +320,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'flowdock' id: 'flowdock'
,logo: 'flowdock.png' ,logo: 'flowdock.png'
,name: 'Flowdock' ,name: 'Flowdock'
,description: 'Flowdock is your team\'s chat with a shared inbox. Teams using Flowdock stay up-to-date, react in seconds instead of days, and never forget anything' ,description: locale['services[31]']
,url: 'https://www.flowdock.com/login' ,url: 'https://www.flowdock.com/login'
,type: 'messaging' ,type: 'messaging'
}, },
@ -328,7 +328,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'mattermost' id: 'mattermost'
,logo: 'mattermost.png' ,logo: 'mattermost.png'
,name: 'Mattermost' ,name: 'Mattermost'
,description: 'Mattermost is an open source, self-hosted Slack-alternative. As an alternative to proprietary SaaS messaging, Mattermost brings all your team communication into one place, making it searchable and accessible anywhere.' ,description: locale['services[32]']
,url: '___' ,url: '___'
,type: 'messaging' ,type: 'messaging'
,js_unread: 'Object.defineProperty(document,"title",{configurable:!0,set:function(a){document.getElementsByTagName("title")[0].innerHTML=a[0]==="*"?"(•) Mattermost":a},get:function(){return document.getElementsByTagName("title")[0].innerHTML}});' ,js_unread: 'Object.defineProperty(document,"title",{configurable:!0,set:function(a){document.getElementsByTagName("title")[0].innerHTML=a[0]==="*"?"(•) Mattermost":a},get:function(){return document.getElementsByTagName("title")[0].innerHTML}});'
@ -337,7 +337,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'dingtalk' id: 'dingtalk'
,logo: 'dingtalk.png' ,logo: 'dingtalk.png'
,name: 'DingTalk' ,name: 'DingTalk'
,description: 'DingTalk is a multi-sided platform empowers small and medium-sized business to communicate effectively.' ,description: locale['services[33]']
,url: 'https://im.dingtalk.com/' ,url: 'https://im.dingtalk.com/'
,type: 'messaging' ,type: 'messaging'
}, },
@ -345,7 +345,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'mysms' id: 'mysms'
,logo: 'mysms.png' ,logo: 'mysms.png'
,name: 'mysms' ,name: 'mysms'
,description: 'The mysms family of applications helps you text anywhere and enhances your messaging experience on your smartphone, tablet and computer.' ,description: locale['services[34]']
,url: 'https://app.mysms.com/#login' ,url: 'https://app.mysms.com/#login'
,type: 'messaging' ,type: 'messaging'
,js_unread: 'function checkUnread(){var e=document.getElementsByClassName("unread"),t=0;for(i=0;i<e.length;i++)t+=parseInt(e[i].firstChild.innerHTML.trim());updateBadge(t)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}"https://app.mysms.com/#login"===document.baseURI&&(document.getElementsByClassName("innerPanel")[0].rows[0].style.display="none",document.getElementsByClassName("innerPanel")[0].rows[1].cells[0].firstElementChild.style.display="none",document.getElementsByClassName("msisdnLoginPanel")[0].style.display="inline");var originalTitle=document.title;setInterval(checkUnread,3000);' ,js_unread: 'function checkUnread(){var e=document.getElementsByClassName("unread"),t=0;for(i=0;i<e.length;i++)t+=parseInt(e[i].firstChild.innerHTML.trim());updateBadge(t)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}"https://app.mysms.com/#login"===document.baseURI&&(document.getElementsByClassName("innerPanel")[0].rows[0].style.display="none",document.getElementsByClassName("innerPanel")[0].rows[1].cells[0].firstElementChild.style.display="none",document.getElementsByClassName("msisdnLoginPanel")[0].style.display="inline");var originalTitle=document.title;setInterval(checkUnread,3000);'
@ -355,7 +355,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'icq' id: 'icq'
,logo: 'icq.png' ,logo: 'icq.png'
,name: 'ICQ' ,name: 'ICQ'
,description: 'ICQ is an open source instant messaging computer program that was first developed and popularized.' ,description: locale['services[35]']
,url: 'https://web.icq.com/' ,url: 'https://web.icq.com/'
,type: 'messaging' ,type: 'messaging'
,js_unread: 'function checkUnread(){updateBadge(parseInt(document.getElementsByClassName("nwa-msg-counter")[0].style.display==="block"?document.getElementsByClassName("nwa-msg-counter")[0].innerHTML.trim():0))}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);' ,js_unread: 'function checkUnread(){updateBadge(parseInt(document.getElementsByClassName("nwa-msg-counter")[0].style.display==="block"?document.getElementsByClassName("nwa-msg-counter")[0].innerHTML.trim():0))}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);'
@ -364,7 +364,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'tweetdeck' id: 'tweetdeck'
,logo: 'tweetdeck.png' ,logo: 'tweetdeck.png'
,name: 'TweetDeck' ,name: 'TweetDeck'
,description: 'TweetDeck is a social media dashboard application for management of Twitter accounts.' ,description: locale['services[36]']
,url: 'https://tweetdeck.twitter.com/' ,url: 'https://tweetdeck.twitter.com/'
,type: 'messaging' ,type: 'messaging'
}, },
@ -372,7 +372,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'custom' id: 'custom'
,logo: 'custom.png' ,logo: 'custom.png'
,name: '_Custom Service' ,name: '_Custom Service'
,description: 'Add a custom service if is not listed above.' ,description: locale['services[38]']
,url: '___' ,url: '___'
,type: 'custom' ,type: 'custom'
,allow_popups: true ,allow_popups: true
@ -381,7 +381,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'zinc' id: 'zinc'
,logo: 'zinc.png' ,logo: 'zinc.png'
,name: 'Zinc' ,name: 'Zinc'
,description: 'Zinc is a secure communication app for mobile workers, with text, voice, video, file sharing and more.' ,description: locale['services[39]']
,url: 'https://zinc-app.com/' ,url: 'https://zinc-app.com/'
,type: 'messaging' ,type: 'messaging'
}, },
@ -389,7 +389,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'freenode' id: 'freenode'
,logo: 'freenode.png' ,logo: 'freenode.png'
,name: 'FreeNode' ,name: 'FreeNode'
,description: 'Freenode, formerly known as Open Projects Network, is an IRC network used to discuss peer-directed projects.' ,description: locale['services[40]']
,url: 'https://webchat.freenode.net/' ,url: 'https://webchat.freenode.net/'
,type: 'messaging' ,type: 'messaging'
}, },
@ -397,7 +397,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'mightytext' id: 'mightytext'
,logo: 'mightytext.png' ,logo: 'mightytext.png'
,name: 'Mighty Text' ,name: 'Mighty Text'
,description: 'Text from your computer, sync\'d with your Android phone & number.' ,description: locale['services[41]']
,url: 'https://mightytext.net/web/' ,url: 'https://mightytext.net/web/'
,type: 'messaging' ,type: 'messaging'
}, },
@ -405,7 +405,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'roundcube' id: 'roundcube'
,logo: 'roundcube.png' ,logo: 'roundcube.png'
,name: 'Roundcube' ,name: 'Roundcube'
,description: 'Free and open source webmail software for the masses, written in PHP.' ,description: locale['services[42]']
,url: '___' ,url: '___'
,type: 'email' ,type: 'email'
}, },
@ -413,7 +413,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'horde' id: 'horde'
,logo: 'horde.png' ,logo: 'horde.png'
,name: 'Horde' ,name: 'Horde'
,description: 'Horde is a free and open source web-based groupware.' ,description: locale['services[43]']
,url: '___' ,url: '___'
,type: 'email' ,type: 'email'
,js_unread: 'function checkUnread(){var e=document.getElementsByClassName("count"),t=0;for(i=0;i<e.length;i++)t+=parseInt(e[i].innerHTML.match(/\d+/g));updateBadge(t)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);' ,js_unread: 'function checkUnread(){var e=document.getElementsByClassName("count"),t=0;for(i=0;i<e.length;i++)t+=parseInt(e[i].innerHTML.match(/\d+/g));updateBadge(t)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);'
@ -423,7 +423,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'squirrelmail' id: 'squirrelmail'
,logo: 'squirrelmail.png' ,logo: 'squirrelmail.png'
,name: 'SquirrelMail' ,name: 'SquirrelMail'
,description: 'SquirrelMail is a standards-based webmail package written in PHP.' ,description: locale['services[44]']
,url: '___' ,url: '___'
,type: 'email' ,type: 'email'
,js_unread: 'function checkUnread(){var e=document.getElementsByClassName("leftunseen"),t=0;for(i=0;i<e.length;i++)t+=parseInt(e[i].innerHTML);updateBadge(t)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);' ,js_unread: 'function checkUnread(){var e=document.getElementsByClassName("leftunseen"),t=0;for(i=0;i<e.length;i++)t+=parseInt(e[i].innerHTML);updateBadge(t)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);'
@ -432,7 +432,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'zohoemail' id: 'zohoemail'
,logo: 'zohoemail.png' ,logo: 'zohoemail.png'
,name: 'Zoho Email' ,name: 'Zoho Email'
,description: 'Ad-free business Email Hosting with a clean, minimalist interface. Integrated Calendar, Contacts, Notes, Tasks apps.' ,description: locale['services[45]']
,url: 'https://mail.zoho.com/' ,url: 'https://mail.zoho.com/'
,type: 'email' ,type: 'email'
,js_unread: 'zmail.aInfo[zmail.accId].mailId = "a";' ,js_unread: 'zmail.aInfo[zmail.accId].mailId = "a";'
@ -442,7 +442,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'zohochat' id: 'zohochat'
,logo: 'zohochat.png' ,logo: 'zohochat.png'
,name: 'Zoho Chat' ,name: 'Zoho Chat'
,description: 'Zoho chat is a secure and scalable real-time communication and collaboration platform for teams to improve their productivity.' ,description: locale['services[46]']
,url: 'https://chat.zoho.com/' ,url: 'https://chat.zoho.com/'
,type: 'messaging' ,type: 'messaging'
,js_unread: 'NotifyByTitle.show = function(){};NotifyByTitle.start = function(){};NotifyByTitle.stop = function(){};function checkUnread(){var t=0;$(".msgnotify").each(function() { t += isNaN(parseInt($(this).html())) ? 0 : parseInt(parseInt($(this).html())) });updateBadge(t)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);' ,js_unread: 'NotifyByTitle.show = function(){};NotifyByTitle.start = function(){};NotifyByTitle.stop = function(){};function checkUnread(){var t=0;$(".msgnotify").each(function() { t += isNaN(parseInt($(this).html())) ? 0 : parseInt(parseInt($(this).html())) });updateBadge(t)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);'

4
app/ux/Auth0.js

@ -26,7 +26,7 @@ Ext.define('Rambox.ux.Auth0', {
,popupOptions: { ,popupOptions: {
nodeIntegration: 'no' nodeIntegration: 'no'
} }
//,language: 'en' ,language: localStorage.getItem('locale-auth0') === null ? 'en' : localStorage.getItem('locale-auth0')
}); });
me.auth0 = new Auth0({ clientID: auth0Cfg.clientID, domain : auth0Cfg.domain }); me.auth0 = new Auth0({ clientID: auth0Cfg.clientID, domain : auth0Cfg.domain });
@ -46,7 +46,7 @@ Ext.define('Rambox.ux.Auth0', {
} }
// Display a spinner while waiting // Display a spinner while waiting
Ext.Msg.wait('Please wait until we get your configuration.', 'Connecting...'); Ext.Msg.wait(locale['app.window[29]'], locale['app.window[28]']);
// Google Analytics Event // Google Analytics Event
ga_storage._trackEvent('Users', 'loggedIn'); ga_storage._trackEvent('Users', 'loggedIn');

6
app/ux/WebView.js

@ -108,14 +108,14 @@ Ext.define('Rambox.ux.WebView',{
} }
,'-' ,'-'
,{ ,{
text: 'Reload' text: locale['app.webview[0]']
,glyph: 'xf021@FontAwesome' ,glyph: 'xf021@FontAwesome'
,scope: me ,scope: me
,handler: me.reloadService ,handler: me.reloadService
} }
,'-' ,'-'
,{ ,{
text: 'Toggle Developer Tools' text: locale['app.webview[3]']
,glyph: 'xf121@FontAwesome' ,glyph: 'xf121@FontAwesome'
,scope: me ,scope: me
,handler: me.toggleDevTools ,handler: me.toggleDevTools
@ -198,7 +198,7 @@ Ext.define('Rambox.ux.WebView',{
,dock: 'bottom' ,dock: 'bottom'
,defaultText: '<i class="fa fa-check fa-fw" aria-hidden="true"></i> Ready' ,defaultText: '<i class="fa fa-check fa-fw" aria-hidden="true"></i> Ready'
,busyIconCls : '' ,busyIconCls : ''
,busyText: '<i class="fa fa-circle-o-notch fa-spin fa-fw"></i> Loading...' ,busyText: '<i class="fa fa-circle-o-notch fa-spin fa-fw"></i> '+locale['app.webview[4]']
,items: [ ,items: [
{ {
xtype: 'tbtext' xtype: 'tbtext'

24
app/view/add/Add.js

@ -27,7 +27,7 @@ Ext.define('Rambox.view.add.Add',{
,initComponent: function() { ,initComponent: function() {
var me = this; var me = this;
me.title = (!me.edit ? 'Add ' : 'Edit ') + me.record.get('name'); me.title = (!me.edit ? locale['app.window[0]'] : locale['app.window[1]']) + ' ' + me.record.get('name');
me.icon = me.record.get('type') === 'custom' ? (!me.edit ? 'resources/icons/custom.png' : (me.record.get('logo') === '' ? 'resources/icons/custom.png' : me.record.get('logo'))) : 'resources/icons/'+me.record.get('logo'); me.icon = me.record.get('type') === 'custom' ? (!me.edit ? 'resources/icons/custom.png' : (me.record.get('logo') === '' ? 'resources/icons/custom.png' : me.record.get('logo'))) : 'resources/icons/'+me.record.get('logo');
me.items = [ me.items = [
{ {
@ -35,7 +35,7 @@ Ext.define('Rambox.view.add.Add',{
,items: [ ,items: [
{ {
xtype: 'textfield' xtype: 'textfield'
,fieldLabel: 'Name' ,fieldLabel: locale['app.window[2]']
,labelWidth: 40 ,labelWidth: 40
,value: me.record.get('type') === 'custom' ? (me.edit ? me.record.get('name') : '') : me.record.get('name') ,value: me.record.get('type') === 'custom' ? (me.edit ? me.record.get('name') : '') : me.record.get('name')
,name: 'serviceName' ,name: 'serviceName'
@ -49,7 +49,7 @@ Ext.define('Rambox.view.add.Add',{
,items: [ ,items: [
{ {
xtype: 'label' xtype: 'label'
,text: 'URL:' ,text: locale['app.window[17]']+':'
,width: 45 ,width: 45
} }
,{ ,{
@ -126,7 +126,7 @@ Ext.define('Rambox.view.add.Add',{
} }
,{ ,{
xtype: 'textfield' xtype: 'textfield'
,fieldLabel: 'Logo' ,fieldLabel: locale['app.window[18]']
,emptyText: 'http://url.com/image.png' ,emptyText: 'http://url.com/image.png'
,name: 'logo' ,name: 'logo'
,vtype: me.record.get('type') === 'custom' ? 'url' : '' ,vtype: me.record.get('type') === 'custom' ? 'url' : ''
@ -139,7 +139,7 @@ Ext.define('Rambox.view.add.Add',{
} }
,{ ,{
xtype: 'fieldset' xtype: 'fieldset'
,title: 'Options' ,title: locale['app.window[3]']
,margin: '10 0 0 0' ,margin: '10 0 0 0'
,items: [ ,items: [
{ {
@ -148,7 +148,7 @@ Ext.define('Rambox.view.add.Add',{
,items: [ ,items: [
{ {
xtype: 'checkbox' xtype: 'checkbox'
,boxLabel: 'Align to Right' ,boxLabel: locale['app.window[4]']
,checked: me.edit ? (me.record.get('align') === 'right' ? true : false) : false ,checked: me.edit ? (me.record.get('align') === 'right' ? true : false) : false
,name: 'align' ,name: 'align'
,uncheckedValue: 'left' ,uncheckedValue: 'left'
@ -156,7 +156,7 @@ Ext.define('Rambox.view.add.Add',{
} }
,{ ,{
xtype: 'checkbox' xtype: 'checkbox'
,boxLabel: 'Mute all sounds' ,boxLabel: locale['app.window[6]']
,name: 'muted' ,name: 'muted'
,checked: me.edit ? me.record.get('muted') : false ,checked: me.edit ? me.record.get('muted') : false
,uncheckedValue: false ,uncheckedValue: false
@ -172,7 +172,7 @@ Ext.define('Rambox.view.add.Add',{
} }
,{ ,{
xtype: 'checkbox' xtype: 'checkbox'
,boxLabel: 'Show notifications' ,boxLabel: locale['app.window[5]']
,name: 'notifications' ,name: 'notifications'
,checked: me.edit ? me.record.get('notifications') : true ,checked: me.edit ? me.record.get('notifications') : true
,uncheckedValue: false ,uncheckedValue: false
@ -188,7 +188,7 @@ Ext.define('Rambox.view.add.Add',{
} }
,{ ,{
xtype: 'checkbox' xtype: 'checkbox'
,boxLabel: 'Trust invalid authority certificates' ,boxLabel: locale['app.window[19]']
,name: 'trust' ,name: 'trust'
,hidden: me.record.get('type') !== 'custom' ,hidden: me.record.get('type') !== 'custom'
,checked: me.edit ? me.record.get('trust') : true ,checked: me.edit ? me.record.get('trust') : true
@ -230,14 +230,14 @@ Ext.define('Rambox.view.add.Add',{
} }
,{ ,{
xtype: 'fieldset' xtype: 'fieldset'
,title: 'Advanced' ,title: locale['app.window[7]']
,margin: '10 0 0 0' ,margin: '10 0 0 0'
,collapsible: true ,collapsible: true
,collapsed: true ,collapsed: true
,items: [ ,items: [
{ {
xtype: 'textarea' xtype: 'textarea'
,fieldLabel: 'Custom Code (<a href="https://github.com/saenzramiro/rambox/wiki/Inject-JavaScript-Code" target="_blank">read more</a>)' ,fieldLabel: locale['app.window[8]']+' (<a href="https://github.com/saenzramiro/rambox/wiki/Inject-JavaScript-Code" target="_blank">'+locale['app.window[9]']+'</a>)'
,allowBlank: true ,allowBlank: true
,name: 'js_unread' ,name: 'js_unread'
,value: me.edit ? me.record.get('js_unread') : '' ,value: me.edit ? me.record.get('js_unread') : ''
@ -263,7 +263,7 @@ Ext.define('Rambox.view.add.Add',{
me.buttons = [ me.buttons = [
{ {
text: 'Cancel' text: locale['button[1]']
,ui: 'decline' ,ui: 'decline'
,handler: 'doCancel' ,handler: 'doCancel'
} }

2
app/view/add/AddController.js

@ -66,7 +66,7 @@ Ext.define('Rambox.view.add.AddController', {
} }
// Apply the JS Code of the Tab // Apply the JS Code of the Tab
if ( win.down('textarea').isDirty() ) { if ( win.down('textarea').isDirty() ) {
Ext.Msg.confirm('CUSTOM CODE', 'Rambox needs to reload the service to execute the new JavaScript code. Do you want to do it now?', function( btnId ) { Ext.Msg.confirm(locale['app.window[8]'].toUpperCase(), 'Rambox needs to reload the service to execute the new JavaScript code. Do you want to do it now?', function( btnId ) {
if ( btnId === 'yes' ) view.reloadService(); if ( btnId === 'yes' ) view.reloadService();
}); });
} }

14
app/view/main/About.js

@ -1,13 +1,13 @@
Ext.define('Rambox.view.main.About', { Ext.define('Rambox.view.main.About', {
extend: 'Ext.window.Window' extend: 'Ext.window.Window'
,xtype: 'about' ,xtype: 'about'
,title: 'About Rambox' ,title: locale['app.about[0]']
,autoShow: true ,autoShow: true
,modal: true ,modal: true
,resizable: false ,resizable: false
,constrain: true ,constrain: true
,width: 300 ,width: 300
,height: 385 ,height: 450
,bodyPadding: 10 ,bodyPadding: 10
,data: { ,data: {
version: require('electron').remote.app.getVersion() version: require('electron').remote.app.getVersion()
@ -19,15 +19,15 @@ Ext.define('Rambox.view.main.About', {
} }
,tpl: [ ,tpl: [
'<div style="text-align:center;"><img src="resources/Icon.png" width="100" /></div>' '<div style="text-align:center;"><img src="resources/Icon.png" width="100" /></div>'
,'<h3>Free, Open Source and Cross Platform messaging and emailing app that combines common web applications into one.</h3>' ,'<h3>'+locale['app.about[1]']+'</h3>'
,'<div><b>Version:</b> {version}</div>' ,'<div><b>'+locale['app.about[2]']+':</b> {version}</div>'
,'<div><b>Platform:</b> {platform} ({arch})</div>' ,'<div><b>'+locale['app.about[3]']+':</b> {platform} ({arch})</div>'
,'<div><b>Electron:</b> {electron}</div>' ,'<div><b>Electron:</b> {electron}</div>'
,'<div><b>Chromium:</b> {chromium}</div>' ,'<div><b>Chromium:</b> {chromium}</div>'
,'<div><b>Node:</b> {node}</div>' ,'<div><b>Node:</b> {node}</div>'
,'<br />' ,'<br />'
,'<div style="text-align:center;"><a href="https://github.com/saenzramiro/rambox" target="_blank">GitHub</a> - <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WU75QWS7LH2CA" target="_blank">Donate</a> - <a href="http://rambox.pro" target="_blank">rambox.pro</a></div>' ,'<div style="text-align:center;"><a href="https://github.com/saenzramiro/rambox" target="_blank">GitHub</a> - <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WU75QWS7LH2CA" target="_blank">'+locale['app.main[25]']+'</a> - <a href="http://rambox.pro" target="_blank">rambox.pro</a></div>'
,'<br />' ,'<br />'
,'<div style="text-align:center;"><i>Developed by Ramiro Saenz</i></div>' ,'<div style="text-align:center;"><i>'+locale['app.about[4]']+' Ramiro Saenz</i></div>'
] ]
}); });

44
app/view/main/Main.js

@ -37,7 +37,7 @@ Ext.define('Rambox.view.main.Main', {
,items: [ ,items: [
{ {
xtype: 'panel' xtype: 'panel'
,title: 'Add a new Service' ,title: locale['app.main[0]']
,margin: '0 5 0 0' ,margin: '0 5 0 0'
,flex: 1 ,flex: 1
,header: { height: 50 } ,header: { height: 50 }
@ -47,7 +47,7 @@ Ext.define('Rambox.view.main.Main', {
,items: [ ,items: [
{ {
xtype: 'checkbox' xtype: 'checkbox'
,boxLabel: 'Messaging' ,boxLabel: locale['app.main[1]']
,name: 'messaging' ,name: 'messaging'
,checked: true ,checked: true
,uncheckedValue: false ,uncheckedValue: false
@ -55,7 +55,7 @@ Ext.define('Rambox.view.main.Main', {
} }
,{ ,{
xtype: 'checkbox' xtype: 'checkbox'
,boxLabel: 'Email' ,boxLabel: locale['app.main[2]']
,margin: '0 10 0 10' ,margin: '0 10 0 10'
,name: 'email' ,name: 'email'
,checked: true ,checked: true
@ -104,7 +104,7 @@ Ext.define('Rambox.view.main.Main', {
,'</div>' ,'</div>'
,'</tpl>' ,'</tpl>'
] ]
,emptyText: '<div style="padding: 20px;">No services found... Try another search.</div>' ,emptyText: '<div style="padding: 20px;">'+locale['app.main[3]']+'</div>'
,listeners: { ,listeners: {
itemclick: 'onNewServiceSelect' itemclick: 'onNewServiceSelect'
} }
@ -113,7 +113,7 @@ Ext.define('Rambox.view.main.Main', {
} }
,{ ,{
xtype: 'grid' xtype: 'grid'
,title: 'Enabled Services' ,title: locale['app.main[4]']
,store: 'Services' ,store: 'Services'
,hideHeaders: true ,hideHeaders: true
,margin: '0 0 0 5' ,margin: '0 0 0 5'
@ -123,7 +123,7 @@ Ext.define('Rambox.view.main.Main', {
{ {
ftype:'grouping' ftype:'grouping'
,collapsible: false ,collapsible: false
,groupHeaderTpl: '{columnName:uppercase}: {name:capitalize} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})' ,groupHeaderTpl: '{columnName:uppercase}: {name:capitalize} ({rows.length} {[values.rows.length > 1 ? "'+locale['app.main[9]']+'" : "'+locale['app.main[8]']+'"]})'
} }
] ]
,plugins: { ,plugins: {
@ -135,7 +135,7 @@ Ext.define('Rambox.view.main.Main', {
xtype: 'button' xtype: 'button'
,glyph: 'xf1f8@FontAwesome' ,glyph: 'xf1f8@FontAwesome'
,baseCls: '' ,baseCls: ''
,tooltip: 'Remove all Services' ,tooltip: locale['app.main[10]']
,handler: 'removeAllServices' ,handler: 'removeAllServices'
} }
] ]
@ -162,14 +162,14 @@ Ext.define('Rambox.view.main.Main', {
,items: [ ,items: [
{ {
glyph: 0xf1f7 glyph: 0xf1f7
,tooltip: 'Prevent notifications' ,tooltip: locale['app.main[11]']
,getClass: function( value, metaData, record, rowIndex, colIndex, store, view ){ ,getClass: function( value, metaData, record, rowIndex, colIndex, store, view ){
if ( record.get('notifications') ) return 'x-hidden'; if ( record.get('notifications') ) return 'x-hidden';
} }
} }
,{ ,{
glyph: 0xf026 glyph: 0xf026
,tooltip: 'Muted' ,tooltip: locale['app.main[12]']
,getClass: function( value, metaData, record, rowIndex, colIndex, store, view ){ ,getClass: function( value, metaData, record, rowIndex, colIndex, store, view ){
if ( !record.get('muted') ) return 'x-hidden'; if ( !record.get('muted') ) return 'x-hidden';
} }
@ -183,13 +183,13 @@ Ext.define('Rambox.view.main.Main', {
,items: [ ,items: [
{ {
glyph: 0xf013 glyph: 0xf013
,tooltip: 'Configure' ,tooltip: locale['app.main[13]']
,handler: 'configureService' ,handler: 'configureService'
,getClass: function(){ return 'x-hidden-display'; } ,getClass: function(){ return 'x-hidden-display'; }
} }
,{ ,{
glyph: 0xf1f8 glyph: 0xf1f8
,tooltip: 'Remove' ,tooltip: locale['app.main[14]']
,handler: 'removeService' ,handler: 'removeService'
,getClass: function(){ return 'x-hidden-display'; } ,getClass: function(){ return 'x-hidden-display'; }
} }
@ -209,7 +209,7 @@ Ext.define('Rambox.view.main.Main', {
} }
] ]
,viewConfig: { ,viewConfig: {
emptyText: 'No services added...' emptyText: locale['app.main[15]']
,forceFit: true ,forceFit: true
,stripeRows: true ,stripeRows: true
} }
@ -228,8 +228,8 @@ Ext.define('Rambox.view.main.Main', {
,items: [ ,items: [
{ {
glyph: 'xf1f7@FontAwesome' glyph: 'xf1f7@FontAwesome'
,text: 'Don\'t Disturb: '+(JSON.parse(localStorage.getItem('dontDisturb')) ? 'ON' : 'OFF') ,text: locale['app.main[16]']+': '+(JSON.parse(localStorage.getItem('dontDisturb')) ? locale['app.window[20]'] : locale['app.window[21]'])
,tooltip: 'Disable notifications and sounds in all services. Perfect to be concentrated and focused.<br/><b>Shortcut key: F1</b>' ,tooltip: locale['app.main[17]']+'<br/><b>'+locale['app.main[18]']+': F1</b>'
,enableToggle: true ,enableToggle: true
,handler: 'dontDisturb' ,handler: 'dontDisturb'
,reference: 'disturbBtn' ,reference: 'disturbBtn'
@ -238,8 +238,8 @@ Ext.define('Rambox.view.main.Main', {
} }
,{ ,{
glyph: 'xf023@FontAwesome' glyph: 'xf023@FontAwesome'
,text: 'Lock Rambox' ,text: locale['app.main[19]']
,tooltip: 'Lock this app if you will be away for a period of time.<br/><b>Shortcut key: F2</b>' ,tooltip: locale['app.main[20]']+'<br/><b>'+locale['app.main[18]']+': F2</b>'
,handler: 'lockRambox' ,handler: 'lockRambox'
,id: 'lockRamboxBtn' ,id: 'lockRamboxBtn'
} }
@ -294,24 +294,24 @@ Ext.define('Rambox.view.main.Main', {
} }
,'-' ,'-'
,{ ,{
text: 'Logout' text: locale['app.main[21]']
,glyph: 'xf08b@FontAwesome' ,glyph: 'xf08b@FontAwesome'
,handler: 'logout' ,handler: 'logout'
} }
] ]
} }
,{ ,{
text: 'Login' text: locale['app.main[22]']
,icon: 'resources/auth0.png' ,icon: 'resources/auth0.png'
,id: 'loginBtn' ,id: 'loginBtn'
,tooltip: 'Login to save your configuration (no credentials stored) to sync with all your computers.<br /><br /><i>Powered by Auth0 (http://auth0.com)</i>' ,tooltip: locale['app.main[23]']+'<br /><br /><i>'+locale['app.main[24]']+' Auth0 (http://auth0.com)</i>'
,bind: { ,bind: {
hidden: '{username}' hidden: '{username}'
} }
,handler: 'login' ,handler: 'login'
} }
,{ ,{
tooltip: 'Preferences' tooltip: locale['preferences[0]']
,glyph: 'xf013@FontAwesome' ,glyph: 'xf013@FontAwesome'
,handler: 'openPreferences' ,handler: 'openPreferences'
} }
@ -327,7 +327,7 @@ Ext.define('Rambox.view.main.Main', {
,pressed: true ,pressed: true
} }
,{ ,{
text: 'Donation' text: locale['app.main[25]']
,glyph: 'xf21e@FontAwesome' ,glyph: 'xf21e@FontAwesome'
,handler: 'showDonate' ,handler: 'showDonate'
} }
@ -341,7 +341,7 @@ Ext.define('Rambox.view.main.Main', {
,'->' ,'->'
,{ ,{
xtype: 'label' xtype: 'label'
,html: '<span class="fa fa-code" style="color:black;"></span> with <span class="fa fa-heart" style="color:red;"></span> from <img src="resources/flag.png" alt="Argentina" data-qtip="Argentina" /> as an Open Source project.' ,html: '<span class="fa fa-code" style="color:black;"></span> '+locale['app.main[26]']+' <span class="fa fa-heart" style="color:red;"></span> '+locale['app.main[27]'].replace('Argentina', '<img src="resources/flag.png" alt="Argentina" data-qtip="Argentina" />')
} }
,'->' ,'->'
,{ ,{

24
app/view/main/MainController.js

@ -106,7 +106,7 @@ Ext.define('Rambox.view.main.MainController', {
,removeService: function( gridView, rowIndex, colIndex, col, e, rec, rowEl ) { ,removeService: function( gridView, rowIndex, colIndex, col, e, rec, rowEl ) {
var me = this; var me = this;
Ext.Msg.confirm('Please confirm...', 'Are you sure you want to remove <b>'+rec.get('name')+'</b>?', function(btnId) { Ext.Msg.confirm(locale['app.window[12]'], locale['app.window[13]']+' <b>'+rec.get('name')+'</b>?', function(btnId) {
if ( btnId === 'yes' ) me.removeServiceFn(rec.get('id')); if ( btnId === 'yes' ) me.removeServiceFn(rec.get('id'));
}); });
} }
@ -118,7 +118,7 @@ Ext.define('Rambox.view.main.MainController', {
document.title = 'Rambox'; document.title = 'Rambox';
if ( btn ) { if ( btn ) {
Ext.Msg.confirm('Please confirm...', 'Are you sure you want to remove all services?', function(btnId) { Ext.Msg.confirm(locale['app.window[12]'], locale['app.window[14]'], function(btnId) {
if ( btnId === 'yes' ) { if ( btnId === 'yes' ) {
Ext.cq1('app-main').suspendEvent('remove'); Ext.cq1('app-main').suspendEvent('remove');
Ext.getStore('Services').load(); Ext.getStore('Services').load();
@ -227,7 +227,7 @@ Ext.define('Rambox.view.main.MainController', {
localStorage.setItem('dontDisturb', btn.pressed); localStorage.setItem('dontDisturb', btn.pressed);
btn.setText('Don\'t Disturb: ' + ( btn.pressed ? 'ON' : 'OFF' )); btn.setText(locale['app.main[16]']+': ' + ( btn.pressed ? locale['app.window[20]'] : locale['app.window[21]'] ));
// If this method is called from Lock method, prevent showing toast // If this method is called from Lock method, prevent showing toast
if ( !e ) return; if ( !e ) return;
@ -244,7 +244,7 @@ Ext.define('Rambox.view.main.MainController', {
var me = this; var me = this;
if ( ipc.sendSync('getConfig').master_password ) { if ( ipc.sendSync('getConfig').master_password ) {
Ext.Msg.confirm('Lock Rambox', 'Do you want to use the Master Password as your temporal password?', function(btnId) { Ext.Msg.confirm(locale['app.main[19]'], 'Do you want to use the Master Password as your temporal password?', function(btnId) {
if ( btnId === 'yes' ) { if ( btnId === 'yes' ) {
setLock(ipc.sendSync('getConfig').master_password); setLock(ipc.sendSync('getConfig').master_password);
} else { } else {
@ -256,14 +256,14 @@ Ext.define('Rambox.view.main.MainController', {
} }
function showTempPass() { function showTempPass() {
var msgbox = Ext.Msg.prompt('Lock Rambox', 'Enter a temporal password to unlock it later', function(btnId, text) { var msgbox = Ext.Msg.prompt(locale['app.main[19]'], locale['app.window[22]'], function(btnId, text) {
if ( btnId === 'ok' ) { if ( btnId === 'ok' ) {
var msgbox2 = Ext.Msg.prompt('Lock Rambox', 'Repeat the temporal password', function(btnId, text2) { var msgbox2 = Ext.Msg.prompt(locale['app.main[19]'], locale['app.window[23]'], function(btnId, text2) {
if ( btnId === 'ok' ) { if ( btnId === 'ok' ) {
if ( text !== text2 ) { if ( text !== text2 ) {
Ext.Msg.show({ Ext.Msg.show({
title: 'Warning' title: locale['app.window[24]']
,message: 'Passwords are not the same. Please try again...' ,message: locale['app.window[25]']
,icon: Ext.Msg.WARNING ,icon: Ext.Msg.WARNING
,buttons: Ext.Msg.OK ,buttons: Ext.Msg.OK
,fn: me.lockRambox ,fn: me.lockRambox
@ -337,7 +337,7 @@ Ext.define('Rambox.view.main.MainController', {
xtype: 'component' xtype: 'component'
,autoEl: { ,autoEl: {
tag: 'h1' tag: 'h1'
,html: 'Rambox is locked' ,html: locale['app.window[26]']
,style: 'text-align:center;width:256px;' ,style: 'text-align:center;width:256px;'
} }
} }
@ -355,7 +355,7 @@ Ext.define('Rambox.view.main.MainController', {
} }
,{ ,{
xtype: 'button' xtype: 'button'
,text: 'UNLOCK' ,text: locale['app.window[27]']
,glyph: 'xf13e@FontAwesome' ,glyph: 'xf13e@FontAwesome'
,width: 256 ,width: 256
,scale: 'large' ,scale: 'large'
@ -384,7 +384,7 @@ Ext.define('Rambox.view.main.MainController', {
var me = this; var me = this;
var logoutFn = function(callback) { var logoutFn = function(callback) {
Ext.Msg.wait('Closing you session...', 'Logout'); Ext.Msg.wait(locale['app.window[37]'], locale['app.main[21]']);
// Google Analytics Event // Google Analytics Event
ga_storage._trackEvent('Users', 'loggedOut'); ga_storage._trackEvent('Users', 'loggedOut');
@ -401,7 +401,7 @@ Ext.define('Rambox.view.main.MainController', {
} }
if ( btn ) { if ( btn ) {
Ext.Msg.confirm('Logout', 'Are you sure you want to logout?', function(btnId) { Ext.Msg.confirm(locale['app.main[21]'], locale['app.window[38]'], function(btnId) {
if ( btnId === 'yes' ) { if ( btnId === 'yes' ) {
logoutFn(function() { logoutFn(function() {
me.removeAllServices(); me.removeAllServices();

64
app/view/preferences/Preferences.js

@ -14,7 +14,7 @@ Ext.define('Rambox.view.preferences.Preferences',{
type: 'preferences-preferences' type: 'preferences-preferences'
} }
,title: 'Preferences' ,title: locale['preferences[0]']
,width: 420 ,width: 420
,modal: true ,modal: true
,closable: true ,closable: true
@ -24,13 +24,13 @@ Ext.define('Rambox.view.preferences.Preferences',{
,resizable: false ,resizable: false
,buttons: [ ,buttons: [
{ {
text: 'Cancel' text: locale['button[1]']
,ui: 'decline' ,ui: 'decline'
,handler: 'cancel' ,handler: 'cancel'
} }
,'->' ,'->'
,{ ,{
text: 'Save' text: locale['button[4]']
,handler: 'save' ,handler: 'save'
} }
] ]
@ -44,21 +44,73 @@ Ext.define('Rambox.view.preferences.Preferences',{
,bodyPadding: 20 ,bodyPadding: 20
,items: [ ,items: [
{ {
xtype: 'container'
,layout: 'hbox'
,items: [
{
xtype: 'combo'
,name: 'locale'
,fieldLabel: 'Language'
,labelAlign: 'left'
,flex: 1
,labelWidth: 80
,value: config.locale
,displayField: 'label'
,valueField: 'value'
,editable: false
,store: Ext.create('Ext.data.Store', {
fields: ['value', 'label']
,data: [
{ 'value': 'ar', 'auth0': 'en', 'label': 'Arabic' }
,{ 'value': 'cs', 'auth0': 'cs', 'label': 'Czech' }
,{ 'value': 'nl', 'auth0': 'nl', 'label': 'Dutch' }
,{ 'value': 'en', 'auth0': 'en', 'label': 'English' }
,{ 'value': 'fr', 'auth0': 'fr', 'label': 'French' }
,{ 'value': 'de', 'auth0': 'de', 'label': 'German' }
,{ 'value': 'el', 'auth0': 'en', 'label': 'Greek' }
,{ 'value': 'id', 'auth0': 'en', 'label': 'Indonesian' }
,{ 'value': 'it', 'auth0': 'it', 'label': 'Italian' }
,{ 'value': 'ko', 'auth0': 'en', 'label': 'Korean' }
,{ 'value': 'fa', 'auth0': 'fa', 'label': 'Persian' }
,{ 'value': 'pl', 'auth0': 'pl', 'label': 'Polish' }
,{ 'value': 'pt-PT', 'auth0': 'pt-br', 'label': 'Portuguese' }
,{ 'value': 'pt-BR', 'auth0': 'pt-br', 'label': 'Portuguese (Brazilian)' }
,{ 'value': 'ru', 'auth0': 'ru', 'label': 'Russian' }
,{ 'value': 'es-ES', 'auth0': 'es', 'label': 'Spanish' }
,{ 'value': 'tr', 'auth0': 'tr', 'label': 'Turkish' }
]
})
}
,{
xtype: 'button'
,text: 'Help us Translate'
,style: 'border-top-left-radius:0;border-bottom-left-radius:0;'
,href: 'https://crowdin.com/project/rambox/invite'
}
]
}
,{
xtype: 'label'
,text: 'English is the only language that has full translation. We are working with all the others, help us!'
,style: 'display:block;font-size:10px;line-height:15px;'
,margin: '0 0 10 0'
}
,{
xtype: 'checkbox' xtype: 'checkbox'
,name: 'auto_launch' ,name: 'auto_launch'
,boxLabel: 'Start automatically on system startup' ,boxLabel: locale['preferences[5]']
,value: config.auto_launch ,value: config.auto_launch
} }
,{ ,{
xtype: 'checkbox' xtype: 'checkbox'
,name: 'start_minimized' ,name: 'start_minimized'
,boxLabel: 'Start minimized' ,boxLabel: locale['preferences[4]']
,value: config.start_minimized ,value: config.start_minimized
} }
,{ ,{
xtype: 'checkbox' xtype: 'checkbox'
,name: 'hide_menu_bar' ,name: 'hide_menu_bar'
,boxLabel: 'Auto-hide Menu bar (<code>Alt</code> key to display)' ,boxLabel: locale['preferences[1]']+' (<code>Alt</code> key to display)'
,value: config.hide_menu_bar ,value: config.hide_menu_bar
,hidden: process.platform !== 'win32' ,hidden: process.platform !== 'win32'
} }

9
app/view/preferences/PreferencesController.js

@ -39,6 +39,15 @@ Ext.define('Rambox.view.preferences.PreferencesController', {
// Proxy // Proxy
if ( values.proxy && (Ext.isEmpty(values.proxyHost) || Ext.isEmpty(values.proxyPort)) ) return; if ( values.proxy && (Ext.isEmpty(values.proxyHost) || Ext.isEmpty(values.proxyPort)) ) return;
// Locale
if ( values.locale !== ipc.sendSync('getConfig').locale ) {
localStorage.setItem('locale', values.locale);
localStorage.setItem('locale-auth0', me.getView().down('form').down('combo[name="locale"]').getSelection().get('auth0'));
Ext.Msg.confirm('Action required', 'To change the language of Rambox, you need to reload the app. Do you want to do it now?', function(btnId) {
if ( btnId === 'yes' ) ipc.send('relaunchApp');
});
}
ipc.send('setConfig', values); ipc.send('setConfig', values);
me.getView().close(); me.getView().close();
} }

17
electron/main.js

@ -1,8 +1,6 @@
'use strict'; 'use strict';
const {app, protocol, BrowserWindow, dialog, shell, Menu, ipcMain, nativeImage, session} = require('electron'); const {app, protocol, BrowserWindow, dialog, shell, Menu, ipcMain, nativeImage, session} = require('electron');
// Menu
const appMenu = require('./menu');
// Tray // Tray
const tray = require('./tray'); const tray = require('./tray');
// AutoLaunch // AutoLaunch
@ -32,6 +30,7 @@ const config = new Config({
,proxy: false ,proxy: false
,proxyHost: '' ,proxyHost: ''
,proxyPort: '' ,proxyPort: ''
,locale: 'en'
,x: undefined ,x: undefined
,y: undefined ,y: undefined
@ -41,6 +40,9 @@ const config = new Config({
} }
}); });
// Menu
const appMenu = require('./menu')(config);
// Configure AutoLaunch // Configure AutoLaunch
const appLauncher = new AutoLaunch({ const appLauncher = new AutoLaunch({
name: 'Rambox' name: 'Rambox'
@ -307,6 +309,17 @@ ipcMain.on('setServiceNotifications', function(event, partition, op) {
}); });
}); });
// Reload app
ipcMain.on('reloadApp', function(event) {
mainWindow.reload();
});
// Relaunch app
ipcMain.on('relaunchApp', function(event) {
app.relaunch();
app.exit(0);
});
const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => { const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => {
// Someone tried to run a second instance, we should focus our window. // Someone tried to run a second instance, we should focus our window.
if (mainWindow) { if (mainWindow) {

539
electron/menu.js

@ -16,285 +16,296 @@ function sendAction(action) {
win.webContents.send(action); win.webContents.send(action);
} }
const helpSubmenu = [ module.exports = function(config) {
{ const locale = require('../resources/languages/'+config.get('locale'));
label: `&Visit ${appName} Website`, const helpSubmenu = [
click() { {
shell.openExternal('http://rambox.pro'); label: `&`+locale['menu.help[0]'],
} click() {
}, shell.openExternal('http://rambox.pro');
{ }
label: `&Facebook`, },
click() { {
shell.openExternal('https://www.facebook.com/ramboxapp'); label: `&Facebook`,
} click() {
}, shell.openExternal('https://www.facebook.com/ramboxapp');
{ }
label: `&Twitter`, },
click() { {
shell.openExternal('https://www.twitter.com/ramboxapp'); label: `&Twitter`,
} click() {
}, shell.openExternal('https://www.twitter.com/ramboxapp');
{ }
label: `&GitHub`, },
click() { {
shell.openExternal('https://www.github.com/saenzramiro/rambox'); label: `&GitHub`,
} click() {
}, shell.openExternal('https://www.github.com/saenzramiro/rambox');
{ }
type: 'separator' },
}, {
{ type: 'separator'
label: '&Report an Issue...', },
click() { {
const body = ` label: '&'+locale['menu.help[1]'],
<!-- Please describe here your issue and steps to reproduce it. --> click() {
const body = `
<!-- Please describe here your issue and steps to reproduce it. -->
<!-- DON'T REMOVE THE FOLLOWING LINES --> <!-- DON'T REMOVE THE FOLLOWING LINES -->
- -
> ${app.getName()} ${app.getVersion()} > ${app.getName()} ${app.getVersion()}
> Electron ${process.versions.electron} > Electron ${process.versions.electron}
> ${process.platform} ${process.arch} ${os.release()}`; > ${process.platform} ${process.arch} ${os.release()}`;
shell.openExternal(`https://github.com/saenzramiro/rambox/issues/new?body=${encodeURIComponent(body)}`); shell.openExternal(`https://github.com/saenzramiro/rambox/issues/new?body=${encodeURIComponent(body)}`);
} }
}, },
{ {
label: `&Ask for Help`, label: `&`+locale['menu.help[2]'],
click() { click() {
shell.openExternal('https://gitter.im/saenzramiro/rambox'); shell.openExternal('https://gitter.im/saenzramiro/rambox');
} }
}, },
{ {
label: `&Tools`, label: `&Tools`,
submenu: [ submenu: [
{ {
label: `&Clear Cache`, label: `&Clear Cache`,
click(item, win) { click(item, win) {
win.webContents.session.clearCache(function() { win.webContents.session.clearCache(function() {
win.reload(); win.reload();
}); });
} }
}, },
{ {
label: `&Clear Local Storage`, label: `&Clear Local Storage`,
click(item, win) { click(item, win) {
win.webContents.session.clearStorageData({ win.webContents.session.clearStorageData({
storages: ['localstorage'] storages: ['localstorage']
}, function() { }, function() {
win.reload(); win.reload();
}); });
}
} }
]
},
{
type: 'separator'
},
{
label: `&`+locale['menu.help[3]'],
click() {
shell.openExternal('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WU75QWS7LH2CA');
} }
]
},
{
type: 'separator'
},
{
label: `&Donate`,
click() {
shell.openExternal('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WU75QWS7LH2CA');
} }
} ];
];
let tpl = [ let tpl = [
{ {
label: '&Edit', label: '&'+locale['menu.edit[0]'],
submenu: [ submenu: [
{ {
role: 'undo' role: 'undo'
}, ,label: locale['menu.edit[1]']
{ },
role: 'redo' {
}, role: 'redo'
{ ,label: locale['menu.edit[2]']
type: 'separator' },
}, {
{ type: 'separator'
role: 'cut' },
}, {
{ role: 'cut'
role: 'copy' ,label: locale['menu.edit[3]']
}, },
{ {
role: 'paste' role: 'copy'
}, ,label: locale['menu.edit[4]']
{ },
role: 'pasteandmatchstyle' {
}, role: 'paste'
{ ,label: locale['menu.edit[5]']
role: 'selectall' },
}, {
{ role: 'pasteandmatchstyle'
role: 'delete' },
} {
] role: 'selectall'
}, ,label: locale['menu.edit[6]']
{ },
label: '&View', {
submenu: [ role: 'delete'
{
label: '&Reload',
accelerator: 'CmdOrCtrl+R',
click(item, focusedWindow) {
if (focusedWindow) focusedWindow.reload();
} }
}, ]
{ },
label: '&Reload current Service', {
accelerator: 'CmdOrCtrl+Shift+R', label: '&'+locale['menu.view[0]'],
click() { submenu: [
sendAction('reloadCurrentService'); {
label: '&'+locale['menu.view[1]'],
accelerator: 'CmdOrCtrl+R',
click(item, focusedWindow) {
if (focusedWindow) focusedWindow.reload();
}
},
{
label: '&Reload current Service',
accelerator: 'CmdOrCtrl+Shift+R',
click() {
sendAction('reloadCurrentService');
}
},
{
type: 'separator'
},
{
role: 'zoomin'
},
{
role: 'zoomout'
},
{
role: 'resetzoom'
} }
}, ]
{ },
type: 'separator' {
}, label: '&'+locale['menu.window[0]'],
{ role: 'window',
role: 'zoomin' submenu: [
}, {
{ label: '&'+locale['menu.window[1]'],
role: 'zoomout' accelerator: 'CmdOrCtrl+M',
}, role: 'minimize'
{ },
role: 'resetzoom' {
} label: '&'+locale['menu.window[2]'],
] accelerator: 'CmdOrCtrl+W',
}, role: 'close'
{ },
label: '&Window', {
role: 'window', type: 'separator'
submenu: [ },
{ {
label: '&Minimize', role: 'togglefullscreen'
accelerator: 'CmdOrCtrl+M', ,label: locale['menu.view[2]']
role: 'minimize' },
}, {
{ label: '&'+locale['menu.view[3]'],
label: '&Close', accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
accelerator: 'CmdOrCtrl+W', click(item, focusedWindow) {
role: 'close' if (focusedWindow) focusedWindow.webContents.toggleDevTools();
}, }
{
type: 'separator'
},
{
role: 'togglefullscreen'
},
{
label: '&Toggle Developer Tools',
accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
click(item, focusedWindow) {
if (focusedWindow) focusedWindow.webContents.toggleDevTools();
} }
} ]
] },
}, {
{ label: '&'+locale['menu.help[4]'],
label: '&Help', role: 'help'
role: 'help' }
} ];
];
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
tpl.unshift({ tpl.unshift({
label: appName, label: appName,
submenu: [ submenu: [
{ {
label: 'Preferences', label: locale['preferences[0]'],
click() { click() {
sendAction('showPreferences') sendAction('showPreferences')
} }
}, },
{ {
label: `Check for updates...`, label: locale['menu.help[5]'],
click(item, win) { click(item, win) {
const webContents = win.webContents; const webContents = win.webContents;
const send = webContents.send.bind(win.webContents); const send = webContents.send.bind(win.webContents);
send('autoUpdater:check-update'); send('autoUpdater:check-update');
}
},
{
label: locale['menu.help[6]'],
click() {
sendAction('showAbout')
}
},
{
type: 'separator'
},
{
label: locale['menu.osx[0]'],
role: 'services',
submenu: []
},
{
type: 'separator'
},
{
label: locale['menu.osx[1]'],
accelerator: 'Command+H',
role: 'hide'
},
{
label: locale['menu.osx[2]'],
accelerator: 'Command+Alt+H',
role: 'hideothers'
},
{
label: locale['menu.osx[3]'],
role: 'unhide'
},
{
type: 'separator'
},
{
role: 'quit',
label: locale['tray[1]']
} }
}, ]
{ });
label: `About ${appName}`, } else {
click() { tpl.unshift({
sendAction('showAbout') label: '&'+locale['menu.file[0]'],
submenu: [
{
label: locale['preferences[0]'],
click() {
sendAction('showPreferences')
}
},
{
type: 'separator'
},
{
role: 'quit',
label: locale['menu.file[1]']
} }
}, ]
{ });
type: 'separator' helpSubmenu.push({
}, type: 'separator'
{ });
label: 'Services', helpSubmenu.push({
role: 'services', label: `&`+locale['menu.help[5]'],
submenu: [] click(item, win) {
}, const webContents = win.webContents;
{ const send = webContents.send.bind(win.webContents);
type: 'separator' send('autoUpdater:check-update');
},
{
label: `Hide ${appName}`,
accelerator: 'Command+H',
role: 'hide'
},
{
label: 'Hide Others',
accelerator: 'Command+Alt+H',
role: 'hideothers'
},
{
label: 'Show All',
role: 'unhide'
},
{
type: 'separator'
},
{
role: 'quit'
} }
] });
}); helpSubmenu.push({
} else { label: `&`+locale['menu.help[6]'],
tpl.unshift({ click() {
label: '&File', sendAction('showAbout')
submenu: [
{
label: 'Preferences',
click() {
sendAction('showPreferences')
}
},
{
type: 'separator'
},
{
role: 'quit'
} }
] });
}); }
helpSubmenu.push({
type: 'separator'
});
helpSubmenu.push({
label: `&Check for updates...`,
click(item, win) {
const webContents = win.webContents;
const send = webContents.send.bind(win.webContents);
send('autoUpdater:check-update');
}
});
helpSubmenu.push({
label: `&About ${appName}`,
click() {
sendAction('showAbout')
}
});
}
tpl[tpl.length - 1].submenu = helpSubmenu; tpl[tpl.length - 1].submenu = helpSubmenu;
var menu = electron.Menu.buildFromTemplate(tpl); return electron.Menu.buildFromTemplate(tpl);
module.exports = menu; };

10
index.html

@ -33,6 +33,16 @@
<!-- The line below must be kept intact for Sencha Cmd to build your application --> <!-- The line below must be kept intact for Sencha Cmd to build your application -->
<script id="microloader" type="text/javascript" src="bootstrap.js"></script> <script id="microloader" type="text/javascript" src="bootstrap.js"></script>
<!--- Localization -->
<script type='text/javascript'>
(function(d, s){
var t = d.createElement(s), e = d.getElementsByTagName(s)[0];
t.type = "text/javascript"; e.parentNode.insertBefore(t, e);
t.src = "resources/languages/"+require('electron').ipcRenderer.sendSync('getConfig').locale+".js";
})(document, "script");
</script>
<!--- Localization -->
<!--- Tooltip player --> <!--- Tooltip player -->
<script type='text/javascript'> <script type='text/javascript'>
(function(d, s){ (function(d, s){

51
languages.js

@ -0,0 +1,51 @@
const fs = require('fs');
const path = require('path');
const replaceall = require("replaceall");
const csvjson = require('csvjson');
const Crowdin = require('crowdin');
var deleteFolderRecursive = function(path) {
if( fs.existsSync(path) ) {
fs.readdirSync(path).forEach(function(file,index){
var curPath = path + "/" + file;
if(fs.lstatSync(curPath).isDirectory()) { // recurse
deleteFolderRecursive(curPath);
} else { // delete file
fs.unlinkSync(curPath);
}
});
fs.rmdirSync(path);
}
};
var crowdin = new Crowdin({
apiKey: '',
endpointUrl: 'https://api.crowdin.net/api/project/rambox'
});
var args = process.argv.slice(2);
if ( args.indexOf('download') >= 0 ) crowdin.downloadToPath('resources/languages').then(function() { console.info('Download finished!') });
if ( args.indexOf('generate') >= 0 ) {
fs.readdirSync(__dirname+'/resources/languages').filter(file => fs.lstatSync(path.join(__dirname+'/resources/languages', file)).isDirectory()).forEach(function(locale) {
var result = 'var locale=[];';
var path = __dirname+'/resources/languages/'+locale;
fs.readdirSync(path).forEach(function(file) {
var data = fs.readFileSync(path+'/'+file, { encoding : 'utf8'});
csvjson.toObject(data, {
headers: 'prop,text'
,delimiter: ','
,quote: '"'
}).forEach(function(obj) {
result += 'locale["'+obj.prop+'"]="'+obj.text+'";';
});
});
result += 'module.exports = locale;';
fs.writeFileSync(path+'/../'+locale+'.js', result);
console.log(locale, "File was generated!");
deleteFolderRecursive(path);
});
}
if ( args.length === 0 ) console.error('No arguments passed');

1
resources/languages/af.js

File diff suppressed because one or more lines are too long

1
resources/languages/ar.js

File diff suppressed because one or more lines are too long

1
resources/languages/ca.js

File diff suppressed because one or more lines are too long

1
resources/languages/cs.js

File diff suppressed because one or more lines are too long

1
resources/languages/da.js

File diff suppressed because one or more lines are too long

1
resources/languages/de.js

File diff suppressed because one or more lines are too long

1
resources/languages/el.js

File diff suppressed because one or more lines are too long

1
resources/languages/en.js

File diff suppressed because one or more lines are too long

1
resources/languages/es-ES.js

File diff suppressed because one or more lines are too long

1
resources/languages/fa.js

File diff suppressed because one or more lines are too long

1
resources/languages/fi.js

File diff suppressed because one or more lines are too long

1
resources/languages/fr.js

File diff suppressed because one or more lines are too long

1
resources/languages/he.js

File diff suppressed because one or more lines are too long

1
resources/languages/hu.js

File diff suppressed because one or more lines are too long

1
resources/languages/id.js

File diff suppressed because one or more lines are too long

1
resources/languages/it.js

File diff suppressed because one or more lines are too long

1
resources/languages/ja.js

File diff suppressed because one or more lines are too long

1
resources/languages/ko.js

File diff suppressed because one or more lines are too long

1
resources/languages/nl.js

File diff suppressed because one or more lines are too long

1
resources/languages/no.js

File diff suppressed because one or more lines are too long

1
resources/languages/pl.js

File diff suppressed because one or more lines are too long

1
resources/languages/pt-BR.js

File diff suppressed because one or more lines are too long

1
resources/languages/pt-PT.js

File diff suppressed because one or more lines are too long

1
resources/languages/ro.js

File diff suppressed because one or more lines are too long

1
resources/languages/ru.js

File diff suppressed because one or more lines are too long

1
resources/languages/sr.js

File diff suppressed because one or more lines are too long

1
resources/languages/sv-SE.js

File diff suppressed because one or more lines are too long

1
resources/languages/tr.js

File diff suppressed because one or more lines are too long

1
resources/languages/uk.js

File diff suppressed because one or more lines are too long

1
resources/languages/vi.js

File diff suppressed because one or more lines are too long

1
resources/languages/zh-CN.js

File diff suppressed because one or more lines are too long

1
resources/languages/zh-TW.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save