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. 93
      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'
,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'
,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'
,hidden: process.platform === 'win32'
}
,{
xtype: 'button'
,text: 'Changelog'
,text: locale['app.update[2]']
,ui: 'decline'
,tooltip: 'Click here to see more information about the new version.'
,href: 'https://github.com/saenzramiro/rambox/releases/tag/'+json.version
@ -255,8 +255,8 @@ Ext.define('Rambox.Application', {
return;
} else if ( !silence ) {
Ext.Msg.show({
title: 'You are up to date!'
,message: 'You have the latest version of Rambox.'
title: locale['app.update[3]']
,message: locale['app.update[4]']
,icon: Ext.Msg.INFO
,buttons: Ext.Msg.OK
});

1
app/model/ServiceList.js

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

92
app/store/ServicesList.js

@ -25,7 +25,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'whatsapp'
,logo: 'whatsapp.png'
,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/'
,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);'
@ -35,7 +35,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'slack'
,logo: 'slack.png'
,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/'
,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);'
@ -44,7 +44,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'noysi'
,logo: 'noysi.png'
,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'
,type: 'messaging'
},
@ -52,7 +52,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'messenger'
,logo: 'messenger.png'
,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/'
,type: 'messaging'
,titleBlink: true
@ -62,7 +62,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'skype'
,logo: 'skype.png'
,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/'
,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'
@ -72,7 +72,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'hangouts'
,logo: 'hangouts.png'
,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/'
,type: 'messaging'
,titleBlink: true
@ -84,7 +84,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'hipchat'
,logo: 'hipchat.png'
,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'
,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);'
@ -94,7 +94,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'telegram'
,logo: 'telegram.png'
,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/'
,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);'
@ -104,7 +104,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'wechat'
,logo: 'wechat.png'
,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/'
,type: 'messaging'
},
@ -112,7 +112,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'gmail'
,logo: 'gmail.png'
,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/'
,type: 'email'
,allow_popups: true
@ -123,7 +123,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'inbox'
,logo: 'inbox.png'
,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'
,type: 'email'
,manual_notifications: true
@ -134,7 +134,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'chatwork'
,logo: 'chatwork.png'
,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'
,type: 'messaging'
,note: 'To enable desktop notifications, you have to go to Options inside ChatWork.'
@ -143,7 +143,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'groupme'
,logo: 'groupme.png'
,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'
,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.'
@ -154,7 +154,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'grape'
,logo: 'grape.png'
,name: 'Grape'
,description: 'The world\'s most advanced team chat meets enterprise search'
,description: locale['services[13]']
,url: 'https://chatgrape.com/accounts/login/'
,type: 'messaging'
},
@ -162,7 +162,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'gitter'
,logo: 'gitter.png'
,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/'
,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);'
@ -171,7 +171,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'steam'
,logo: 'steam.png'
,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'
,type: 'messaging'
,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'
,logo: 'discord.png'
,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'
,type: 'messaging'
,titleBlink: true
@ -192,7 +192,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'outlook'
,logo: 'outlook.png'
,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/'
,type: 'email'
,manual_notifications: true
@ -202,7 +202,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'outlook365'
,logo: 'outlook365.png'
,name: 'Outlook 365'
,description: 'Outlook for Business'
,description: locale['services[18]']
,url: 'https://outlook.office.com/owa/'
,type: 'email'
,manual_notifications: true
@ -212,7 +212,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'yahoo'
,logo: 'yahoo.png'
,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/'
,type: 'email'
,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'
,logo: 'protonmail.png'
,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'
,type: 'email'
},
@ -229,7 +229,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'protonmailch'
,logo: 'protonmail.png'
,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'
,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.'
@ -238,7 +238,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'tutanota'
,logo: 'tutanota.png'
,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/'
,type: 'email'
},
@ -246,7 +246,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'hushmail'
,logo: 'hushmail.png'
,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'
,type: 'email'
},
@ -254,7 +254,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'missive'
,logo: 'missive.png'
,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'
,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);'
@ -263,7 +263,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'rocketchat'
,logo: 'rocketchat.png'
,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: '___'
,type: 'messaging'
,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'
,logo: 'wire.png'
,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/'
,type: 'messaging'
},
@ -280,7 +280,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'sync'
,logo: 'sync.png'
,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'
,type: 'messaging'
},
@ -295,7 +295,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'yahoomessenger'
,logo: 'yahoomessenger.png'
,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/'
,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);'
@ -304,7 +304,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'voxer'
,logo: 'voxer.png'
,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/'
,type: 'messaging'
},
@ -312,7 +312,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'dasher'
,logo: 'dasher.png'
,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/'
,type: 'messaging'
},
@ -320,7 +320,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'flowdock'
,logo: 'flowdock.png'
,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'
,type: 'messaging'
},
@ -328,7 +328,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'mattermost'
,logo: 'mattermost.png'
,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: '___'
,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}});'
@ -337,7 +337,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'dingtalk'
,logo: 'dingtalk.png'
,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/'
,type: 'messaging'
},
@ -345,7 +345,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'mysms'
,logo: 'mysms.png'
,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'
,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);'
@ -355,7 +355,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'icq'
,logo: 'icq.png'
,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/'
,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);'
@ -364,7 +364,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'tweetdeck'
,logo: 'tweetdeck.png'
,name: 'TweetDeck'
,description: 'TweetDeck is a social media dashboard application for management of Twitter accounts.'
,description: locale['services[36]']
,url: 'https://tweetdeck.twitter.com/'
,type: 'messaging'
},
@ -372,7 +372,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'custom'
,logo: 'custom.png'
,name: '_Custom Service'
,description: 'Add a custom service if is not listed above.'
,description: locale['services[38]']
,url: '___'
,type: 'custom'
,allow_popups: true
@ -381,7 +381,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'zinc'
,logo: 'zinc.png'
,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/'
,type: 'messaging'
},
@ -389,7 +389,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'freenode'
,logo: 'freenode.png'
,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/'
,type: 'messaging'
},
@ -397,7 +397,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'mightytext'
,logo: 'mightytext.png'
,name: 'Mighty Text'
,description: 'Text from your computer, sync\'d with your Android phone & number.'
,description: locale['services[41]']
,url: 'https://mightytext.net/web/'
,type: 'messaging'
},
@ -405,7 +405,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'roundcube'
,logo: 'roundcube.png'
,name: 'Roundcube'
,description: 'Free and open source webmail software for the masses, written in PHP.'
,description: locale['services[42]']
,url: '___'
,type: 'email'
},
@ -413,7 +413,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'horde'
,logo: 'horde.png'
,name: 'Horde'
,description: 'Horde is a free and open source web-based groupware.'
,description: locale['services[43]']
,url: '___'
,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);'
@ -423,7 +423,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'squirrelmail'
,logo: 'squirrelmail.png'
,name: 'SquirrelMail'
,description: 'SquirrelMail is a standards-based webmail package written in PHP.'
,description: locale['services[44]']
,url: '___'
,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);'
@ -432,7 +432,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'zohoemail'
,logo: 'zohoemail.png'
,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/'
,type: 'email'
,js_unread: 'zmail.aInfo[zmail.accId].mailId = "a";'
@ -442,7 +442,7 @@ Ext.define('Rambox.store.ServicesList', {
id: 'zohochat'
,logo: 'zohochat.png'
,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/'
,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);'

4
app/ux/Auth0.js

@ -26,7 +26,7 @@ Ext.define('Rambox.ux.Auth0', {
,popupOptions: {
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 });
@ -46,7 +46,7 @@ Ext.define('Rambox.ux.Auth0', {
}
// 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
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'
,scope: me
,handler: me.reloadService
}
,'-'
,{
text: 'Toggle Developer Tools'
text: locale['app.webview[3]']
,glyph: 'xf121@FontAwesome'
,scope: me
,handler: me.toggleDevTools
@ -198,7 +198,7 @@ Ext.define('Rambox.ux.WebView',{
,dock: 'bottom'
,defaultText: '<i class="fa fa-check fa-fw" aria-hidden="true"></i> Ready'
,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: [
{
xtype: 'tbtext'

24
app/view/add/Add.js

@ -27,7 +27,7 @@ Ext.define('Rambox.view.add.Add',{
,initComponent: function() {
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.items = [
{
@ -35,7 +35,7 @@ Ext.define('Rambox.view.add.Add',{
,items: [
{
xtype: 'textfield'
,fieldLabel: 'Name'
,fieldLabel: locale['app.window[2]']
,labelWidth: 40
,value: me.record.get('type') === 'custom' ? (me.edit ? me.record.get('name') : '') : me.record.get('name')
,name: 'serviceName'
@ -49,7 +49,7 @@ Ext.define('Rambox.view.add.Add',{
,items: [
{
xtype: 'label'
,text: 'URL:'
,text: locale['app.window[17]']+':'
,width: 45
}
,{
@ -126,7 +126,7 @@ Ext.define('Rambox.view.add.Add',{
}
,{
xtype: 'textfield'
,fieldLabel: 'Logo'
,fieldLabel: locale['app.window[18]']
,emptyText: 'http://url.com/image.png'
,name: 'logo'
,vtype: me.record.get('type') === 'custom' ? 'url' : ''
@ -139,7 +139,7 @@ Ext.define('Rambox.view.add.Add',{
}
,{
xtype: 'fieldset'
,title: 'Options'
,title: locale['app.window[3]']
,margin: '10 0 0 0'
,items: [
{
@ -148,7 +148,7 @@ Ext.define('Rambox.view.add.Add',{
,items: [
{
xtype: 'checkbox'
,boxLabel: 'Align to Right'
,boxLabel: locale['app.window[4]']
,checked: me.edit ? (me.record.get('align') === 'right' ? true : false) : false
,name: 'align'
,uncheckedValue: 'left'
@ -156,7 +156,7 @@ Ext.define('Rambox.view.add.Add',{
}
,{
xtype: 'checkbox'
,boxLabel: 'Mute all sounds'
,boxLabel: locale['app.window[6]']
,name: 'muted'
,checked: me.edit ? me.record.get('muted') : false
,uncheckedValue: false
@ -172,7 +172,7 @@ Ext.define('Rambox.view.add.Add',{
}
,{
xtype: 'checkbox'
,boxLabel: 'Show notifications'
,boxLabel: locale['app.window[5]']
,name: 'notifications'
,checked: me.edit ? me.record.get('notifications') : true
,uncheckedValue: false
@ -188,7 +188,7 @@ Ext.define('Rambox.view.add.Add',{
}
,{
xtype: 'checkbox'
,boxLabel: 'Trust invalid authority certificates'
,boxLabel: locale['app.window[19]']
,name: 'trust'
,hidden: me.record.get('type') !== 'custom'
,checked: me.edit ? me.record.get('trust') : true
@ -230,14 +230,14 @@ Ext.define('Rambox.view.add.Add',{
}
,{
xtype: 'fieldset'
,title: 'Advanced'
,title: locale['app.window[7]']
,margin: '10 0 0 0'
,collapsible: true
,collapsed: true
,items: [
{
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
,name: 'js_unread'
,value: me.edit ? me.record.get('js_unread') : ''
@ -263,7 +263,7 @@ Ext.define('Rambox.view.add.Add',{
me.buttons = [
{
text: 'Cancel'
text: locale['button[1]']
,ui: 'decline'
,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
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();
});
}

14
app/view/main/About.js

@ -1,13 +1,13 @@
Ext.define('Rambox.view.main.About', {
extend: 'Ext.window.Window'
,xtype: 'about'
,title: 'About Rambox'
,title: locale['app.about[0]']
,autoShow: true
,modal: true
,resizable: false
,constrain: true
,width: 300
,height: 385
,height: 450
,bodyPadding: 10
,data: {
version: require('electron').remote.app.getVersion()
@ -19,15 +19,15 @@ Ext.define('Rambox.view.main.About', {
}
,tpl: [
'<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>'
,'<div><b>Version:</b> {version}</div>'
,'<div><b>Platform:</b> {platform} ({arch})</div>'
,'<h3>'+locale['app.about[1]']+'</h3>'
,'<div><b>'+locale['app.about[2]']+':</b> {version}</div>'
,'<div><b>'+locale['app.about[3]']+':</b> {platform} ({arch})</div>'
,'<div><b>Electron:</b> {electron}</div>'
,'<div><b>Chromium:</b> {chromium}</div>'
,'<div><b>Node:</b> {node}</div>'
,'<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 />'
,'<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: [
{
xtype: 'panel'
,title: 'Add a new Service'
,title: locale['app.main[0]']
,margin: '0 5 0 0'
,flex: 1
,header: { height: 50 }
@ -47,7 +47,7 @@ Ext.define('Rambox.view.main.Main', {
,items: [
{
xtype: 'checkbox'
,boxLabel: 'Messaging'
,boxLabel: locale['app.main[1]']
,name: 'messaging'
,checked: true
,uncheckedValue: false
@ -55,7 +55,7 @@ Ext.define('Rambox.view.main.Main', {
}
,{
xtype: 'checkbox'
,boxLabel: 'Email'
,boxLabel: locale['app.main[2]']
,margin: '0 10 0 10'
,name: 'email'
,checked: true
@ -104,7 +104,7 @@ Ext.define('Rambox.view.main.Main', {
,'</div>'
,'</tpl>'
]
,emptyText: '<div style="padding: 20px;">No services found... Try another search.</div>'
,emptyText: '<div style="padding: 20px;">'+locale['app.main[3]']+'</div>'
,listeners: {
itemclick: 'onNewServiceSelect'
}
@ -113,7 +113,7 @@ Ext.define('Rambox.view.main.Main', {
}
,{
xtype: 'grid'
,title: 'Enabled Services'
,title: locale['app.main[4]']
,store: 'Services'
,hideHeaders: true
,margin: '0 0 0 5'
@ -123,7 +123,7 @@ Ext.define('Rambox.view.main.Main', {
{
ftype:'grouping'
,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: {
@ -135,7 +135,7 @@ Ext.define('Rambox.view.main.Main', {
xtype: 'button'
,glyph: 'xf1f8@FontAwesome'
,baseCls: ''
,tooltip: 'Remove all Services'
,tooltip: locale['app.main[10]']
,handler: 'removeAllServices'
}
]
@ -162,14 +162,14 @@ Ext.define('Rambox.view.main.Main', {
,items: [
{
glyph: 0xf1f7
,tooltip: 'Prevent notifications'
,tooltip: locale['app.main[11]']
,getClass: function( value, metaData, record, rowIndex, colIndex, store, view ){
if ( record.get('notifications') ) return 'x-hidden';
}
}
,{
glyph: 0xf026
,tooltip: 'Muted'
,tooltip: locale['app.main[12]']
,getClass: function( value, metaData, record, rowIndex, colIndex, store, view ){
if ( !record.get('muted') ) return 'x-hidden';
}
@ -183,13 +183,13 @@ Ext.define('Rambox.view.main.Main', {
,items: [
{
glyph: 0xf013
,tooltip: 'Configure'
,tooltip: locale['app.main[13]']
,handler: 'configureService'
,getClass: function(){ return 'x-hidden-display'; }
}
,{
glyph: 0xf1f8
,tooltip: 'Remove'
,tooltip: locale['app.main[14]']
,handler: 'removeService'
,getClass: function(){ return 'x-hidden-display'; }
}
@ -209,7 +209,7 @@ Ext.define('Rambox.view.main.Main', {
}
]
,viewConfig: {
emptyText: 'No services added...'
emptyText: locale['app.main[15]']
,forceFit: true
,stripeRows: true
}
@ -228,8 +228,8 @@ Ext.define('Rambox.view.main.Main', {
,items: [
{
glyph: 'xf1f7@FontAwesome'
,text: 'Don\'t Disturb: '+(JSON.parse(localStorage.getItem('dontDisturb')) ? 'ON' : 'OFF')
,tooltip: 'Disable notifications and sounds in all services. Perfect to be concentrated and focused.<br/><b>Shortcut key: F1</b>'
,text: locale['app.main[16]']+': '+(JSON.parse(localStorage.getItem('dontDisturb')) ? locale['app.window[20]'] : locale['app.window[21]'])
,tooltip: locale['app.main[17]']+'<br/><b>'+locale['app.main[18]']+': F1</b>'
,enableToggle: true
,handler: 'dontDisturb'
,reference: 'disturbBtn'
@ -238,8 +238,8 @@ Ext.define('Rambox.view.main.Main', {
}
,{
glyph: 'xf023@FontAwesome'
,text: 'Lock Rambox'
,tooltip: 'Lock this app if you will be away for a period of time.<br/><b>Shortcut key: F2</b>'
,text: locale['app.main[19]']
,tooltip: locale['app.main[20]']+'<br/><b>'+locale['app.main[18]']+': F2</b>'
,handler: 'lockRambox'
,id: 'lockRamboxBtn'
}
@ -294,24 +294,24 @@ Ext.define('Rambox.view.main.Main', {
}
,'-'
,{
text: 'Logout'
text: locale['app.main[21]']
,glyph: 'xf08b@FontAwesome'
,handler: 'logout'
}
]
}
,{
text: 'Login'
text: locale['app.main[22]']
,icon: 'resources/auth0.png'
,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: {
hidden: '{username}'
}
,handler: 'login'
}
,{
tooltip: 'Preferences'
tooltip: locale['preferences[0]']
,glyph: 'xf013@FontAwesome'
,handler: 'openPreferences'
}
@ -327,7 +327,7 @@ Ext.define('Rambox.view.main.Main', {
,pressed: true
}
,{
text: 'Donation'
text: locale['app.main[25]']
,glyph: 'xf21e@FontAwesome'
,handler: 'showDonate'
}
@ -341,7 +341,7 @@ Ext.define('Rambox.view.main.Main', {
,'->'
,{
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 ) {
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'));
});
}
@ -118,7 +118,7 @@ Ext.define('Rambox.view.main.MainController', {
document.title = 'Rambox';
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' ) {
Ext.cq1('app-main').suspendEvent('remove');
Ext.getStore('Services').load();
@ -227,7 +227,7 @@ Ext.define('Rambox.view.main.MainController', {
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 ( !e ) return;
@ -244,7 +244,7 @@ Ext.define('Rambox.view.main.MainController', {
var me = this;
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' ) {
setLock(ipc.sendSync('getConfig').master_password);
} else {
@ -256,14 +256,14 @@ Ext.define('Rambox.view.main.MainController', {
}
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' ) {
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 ( text !== text2 ) {
Ext.Msg.show({
title: 'Warning'
,message: 'Passwords are not the same. Please try again...'
title: locale['app.window[24]']
,message: locale['app.window[25]']
,icon: Ext.Msg.WARNING
,buttons: Ext.Msg.OK
,fn: me.lockRambox
@ -337,7 +337,7 @@ Ext.define('Rambox.view.main.MainController', {
xtype: 'component'
,autoEl: {
tag: 'h1'
,html: 'Rambox is locked'
,html: locale['app.window[26]']
,style: 'text-align:center;width:256px;'
}
}
@ -355,7 +355,7 @@ Ext.define('Rambox.view.main.MainController', {
}
,{
xtype: 'button'
,text: 'UNLOCK'
,text: locale['app.window[27]']
,glyph: 'xf13e@FontAwesome'
,width: 256
,scale: 'large'
@ -384,7 +384,7 @@ Ext.define('Rambox.view.main.MainController', {
var me = this;
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
ga_storage._trackEvent('Users', 'loggedOut');
@ -401,7 +401,7 @@ Ext.define('Rambox.view.main.MainController', {
}
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' ) {
logoutFn(function() {
me.removeAllServices();

64
app/view/preferences/Preferences.js

@ -14,7 +14,7 @@ Ext.define('Rambox.view.preferences.Preferences',{
type: 'preferences-preferences'
}
,title: 'Preferences'
,title: locale['preferences[0]']
,width: 420
,modal: true
,closable: true
@ -24,13 +24,13 @@ Ext.define('Rambox.view.preferences.Preferences',{
,resizable: false
,buttons: [
{
text: 'Cancel'
text: locale['button[1]']
,ui: 'decline'
,handler: 'cancel'
}
,'->'
,{
text: 'Save'
text: locale['button[4]']
,handler: 'save'
}
]
@ -44,21 +44,73 @@ Ext.define('Rambox.view.preferences.Preferences',{
,bodyPadding: 20
,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'
,name: 'auto_launch'
,boxLabel: 'Start automatically on system startup'
,boxLabel: locale['preferences[5]']
,value: config.auto_launch
}
,{
xtype: 'checkbox'
,name: 'start_minimized'
,boxLabel: 'Start minimized'
,boxLabel: locale['preferences[4]']
,value: config.start_minimized
}
,{
xtype: 'checkbox'
,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
,hidden: process.platform !== 'win32'
}

9
app/view/preferences/PreferencesController.js

@ -39,6 +39,15 @@ Ext.define('Rambox.view.preferences.PreferencesController', {
// Proxy
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);
me.getView().close();
}

17
electron/main.js

@ -1,8 +1,6 @@
'use strict';
const {app, protocol, BrowserWindow, dialog, shell, Menu, ipcMain, nativeImage, session} = require('electron');
// Menu
const appMenu = require('./menu');
// Tray
const tray = require('./tray');
// AutoLaunch
@ -32,6 +30,7 @@ const config = new Config({
,proxy: false
,proxyHost: ''
,proxyPort: ''
,locale: 'en'
,x: undefined
,y: undefined
@ -41,6 +40,9 @@ const config = new Config({
}
});
// Menu
const appMenu = require('./menu')(config);
// Configure AutoLaunch
const appLauncher = new AutoLaunch({
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) => {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {

93
electron/menu.js

@ -16,9 +16,11 @@ function sendAction(action) {
win.webContents.send(action);
}
const helpSubmenu = [
module.exports = function(config) {
const locale = require('../resources/languages/'+config.get('locale'));
const helpSubmenu = [
{
label: `&Visit ${appName} Website`,
label: `&`+locale['menu.help[0]'],
click() {
shell.openExternal('http://rambox.pro');
}
@ -45,24 +47,24 @@ const helpSubmenu = [
type: 'separator'
},
{
label: '&Report an Issue...',
label: '&'+locale['menu.help[1]'],
click() {
const body = `
<!-- Please describe here your issue and steps to reproduce it. -->
<!-- Please describe here your issue and steps to reproduce it. -->
<!-- DON'T REMOVE THE FOLLOWING LINES -->
-
> ${app.getName()} ${app.getVersion()}
> Electron ${process.versions.electron}
> ${process.platform} ${process.arch} ${os.release()}`;
<!-- DON'T REMOVE THE FOLLOWING LINES -->
-
> ${app.getName()} ${app.getVersion()}
> Electron ${process.versions.electron}
> ${process.platform} ${process.arch} ${os.release()}`;
shell.openExternal(`https://github.com/saenzramiro/rambox/issues/new?body=${encodeURIComponent(body)}`);
}
},
{
label: `&Ask for Help`,
label: `&`+locale['menu.help[2]'],
click() {
shell.openExternal('https://gitter.im/saenzramiro/rambox');
}
@ -94,40 +96,46 @@ const helpSubmenu = [
type: 'separator'
},
{
label: `&Donate`,
label: `&`+locale['menu.help[3]'],
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: [
{
role: 'undo'
,label: locale['menu.edit[1]']
},
{
role: 'redo'
,label: locale['menu.edit[2]']
},
{
type: 'separator'
},
{
role: 'cut'
,label: locale['menu.edit[3]']
},
{
role: 'copy'
,label: locale['menu.edit[4]']
},
{
role: 'paste'
,label: locale['menu.edit[5]']
},
{
role: 'pasteandmatchstyle'
},
{
role: 'selectall'
,label: locale['menu.edit[6]']
},
{
role: 'delete'
@ -135,10 +143,10 @@ let tpl = [
]
},
{
label: '&View',
label: '&'+locale['menu.view[0]'],
submenu: [
{
label: '&Reload',
label: '&'+locale['menu.view[1]'],
accelerator: 'CmdOrCtrl+R',
click(item, focusedWindow) {
if (focusedWindow) focusedWindow.reload();
@ -166,16 +174,16 @@ let tpl = [
]
},
{
label: '&Window',
label: '&'+locale['menu.window[0]'],
role: 'window',
submenu: [
{
label: '&Minimize',
label: '&'+locale['menu.window[1]'],
accelerator: 'CmdOrCtrl+M',
role: 'minimize'
},
{
label: '&Close',
label: '&'+locale['menu.window[2]'],
accelerator: 'CmdOrCtrl+W',
role: 'close'
},
@ -184,9 +192,10 @@ let tpl = [
},
{
role: 'togglefullscreen'
,label: locale['menu.view[2]']
},
{
label: '&Toggle Developer Tools',
label: '&'+locale['menu.view[3]'],
accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
click(item, focusedWindow) {
if (focusedWindow) focusedWindow.webContents.toggleDevTools();
@ -195,23 +204,23 @@ let tpl = [
]
},
{
label: '&Help',
label: '&'+locale['menu.help[4]'],
role: 'help'
}
];
];
if (process.platform === 'darwin') {
if (process.platform === 'darwin') {
tpl.unshift({
label: appName,
submenu: [
{
label: 'Preferences',
label: locale['preferences[0]'],
click() {
sendAction('showPreferences')
}
},
{
label: `Check for updates...`,
label: locale['menu.help[5]'],
click(item, win) {
const webContents = win.webContents;
const send = webContents.send.bind(win.webContents);
@ -219,7 +228,7 @@ if (process.platform === 'darwin') {
}
},
{
label: `About ${appName}`,
label: locale['menu.help[6]'],
click() {
sendAction('showAbout')
}
@ -228,7 +237,7 @@ if (process.platform === 'darwin') {
type: 'separator'
},
{
label: 'Services',
label: locale['menu.osx[0]'],
role: 'services',
submenu: []
},
@ -236,33 +245,34 @@ if (process.platform === 'darwin') {
type: 'separator'
},
{
label: `Hide ${appName}`,
label: locale['menu.osx[1]'],
accelerator: 'Command+H',
role: 'hide'
},
{
label: 'Hide Others',
label: locale['menu.osx[2]'],
accelerator: 'Command+Alt+H',
role: 'hideothers'
},
{
label: 'Show All',
label: locale['menu.osx[3]'],
role: 'unhide'
},
{
type: 'separator'
},
{
role: 'quit'
role: 'quit',
label: locale['tray[1]']
}
]
});
} else {
} else {
tpl.unshift({
label: '&File',
label: '&'+locale['menu.file[0]'],
submenu: [
{
label: 'Preferences',
label: locale['preferences[0]'],
click() {
sendAction('showPreferences')
}
@ -271,7 +281,8 @@ if (process.platform === 'darwin') {
type: 'separator'
},
{
role: 'quit'
role: 'quit',
label: locale['menu.file[1]']
}
]
});
@ -279,7 +290,7 @@ if (process.platform === 'darwin') {
type: 'separator'
});
helpSubmenu.push({
label: `&Check for updates...`,
label: `&`+locale['menu.help[5]'],
click(item, win) {
const webContents = win.webContents;
const send = webContents.send.bind(win.webContents);
@ -287,14 +298,14 @@ if (process.platform === 'darwin') {
}
});
helpSubmenu.push({
label: `&About ${appName}`,
label: `&`+locale['menu.help[6]'],
click() {
sendAction('showAbout')
}
});
}
}
tpl[tpl.length - 1].submenu = helpSubmenu;
tpl[tpl.length - 1].submenu = helpSubmenu;
var menu = electron.Menu.buildFromTemplate(tpl);
module.exports = menu;
return electron.Menu.buildFromTemplate(tpl);
};

10
index.html

@ -33,6 +33,16 @@
<!-- The line below must be kept intact for Sencha Cmd to build your application -->
<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 -->
<script type='text/javascript'>
(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