=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);'
diff --git a/app/ux/Auth0.js b/app/ux/Auth0.js
index 764ac955..245bc3c4 100644
--- a/app/ux/Auth0.js
+++ b/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');
diff --git a/app/ux/WebView.js b/app/ux/WebView.js
index 3e721a92..9b37e37c 100644
--- a/app/ux/WebView.js
+++ b/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: ' Ready'
,busyIconCls : ''
- ,busyText: ' Loading...'
+ ,busyText: ' '+locale['app.webview[4]']
,items: [
{
xtype: 'tbtext'
diff --git a/app/view/add/Add.js b/app/view/add/Add.js
index 857d7e33..78544f08 100644
--- a/app/view/add/Add.js
+++ b/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 (read more)'
+ ,fieldLabel: locale['app.window[8]']+' ('+locale['app.window[9]']+')'
,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'
}
diff --git a/app/view/add/AddController.js b/app/view/add/AddController.js
index 18e74cc4..09a0b581 100644
--- a/app/view/add/AddController.js
+++ b/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();
});
}
diff --git a/app/view/main/About.js b/app/view/main/About.js
index 26417588..24e3c856 100644
--- a/app/view/main/About.js
+++ b/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: [
''
- ,'Free, Open Source and Cross Platform messaging and emailing app that combines common web applications into one.
'
- ,'Version: {version}
'
- ,'Platform: {platform} ({arch})
'
+ ,''+locale['app.about[1]']+'
'
+ ,''+locale['app.about[2]']+': {version}
'
+ ,''+locale['app.about[3]']+': {platform} ({arch})
'
,'Electron: {electron}
'
,'Chromium: {chromium}
'
,'Node: {node}
'
,'
'
- ,''
+ ,''
,'
'
- ,'Developed by Ramiro Saenz
'
+ ,''+locale['app.about[4]']+' Ramiro Saenz
'
]
});
diff --git a/app/view/main/Main.js b/app/view/main/Main.js
index 3a18be6a..bc0ba841 100644
--- a/app/view/main/Main.js
+++ b/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', {
,''
,''
]
- ,emptyText: 'No services found... Try another search.
'
+ ,emptyText: ''+locale['app.main[3]']+'
'
,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.
Shortcut key: F1'
+ ,text: locale['app.main[16]']+': '+(JSON.parse(localStorage.getItem('dontDisturb')) ? locale['app.window[20]'] : locale['app.window[21]'])
+ ,tooltip: locale['app.main[17]']+'
'+locale['app.main[18]']+': F1'
,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.
Shortcut key: F2'
+ ,text: locale['app.main[19]']
+ ,tooltip: locale['app.main[20]']+'
'+locale['app.main[18]']+': F2'
,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.
Powered by Auth0 (http://auth0.com)'
+ ,tooltip: locale['app.main[23]']+'
'+locale['app.main[24]']+' Auth0 (http://auth0.com)'
,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: ' with from
as an Open Source project.'
+ ,html: ' '+locale['app.main[26]']+' '+locale['app.main[27]'].replace('Argentina', '
')
}
,'->'
,{
diff --git a/app/view/main/MainController.js b/app/view/main/MainController.js
index 9be48271..5c780959 100644
--- a/app/view/main/MainController.js
+++ b/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 '+rec.get('name')+'?', function(btnId) {
+ Ext.Msg.confirm(locale['app.window[12]'], locale['app.window[13]']+' '+rec.get('name')+'?', 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();
diff --git a/app/view/preferences/Preferences.js b/app/view/preferences/Preferences.js
index 4d5733d8..27df1f2b 100644
--- a/app/view/preferences/Preferences.js
+++ b/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 (Alt
key to display)'
+ ,boxLabel: locale['preferences[1]']+' (Alt
key to display)'
,value: config.hide_menu_bar
,hidden: process.platform !== 'win32'
}
diff --git a/app/view/preferences/PreferencesController.js b/app/view/preferences/PreferencesController.js
index c90e9aec..5d356718 100644
--- a/app/view/preferences/PreferencesController.js
+++ b/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();
}
diff --git a/electron/main.js b/electron/main.js
index bc6b7241..1c6c6ca6 100644
--- a/electron/main.js
+++ b/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) {
diff --git a/electron/menu.js b/electron/menu.js
index cc703ec5..da6aa85f 100644
--- a/electron/menu.js
+++ b/electron/menu.js
@@ -16,285 +16,296 @@ function sendAction(action) {
win.webContents.send(action);
}
-const helpSubmenu = [
- {
- label: `&Visit ${appName} Website`,
- click() {
- shell.openExternal('http://rambox.pro');
- }
- },
- {
- label: `&Facebook`,
- click() {
- shell.openExternal('https://www.facebook.com/ramboxapp');
- }
- },
- {
- label: `&Twitter`,
- click() {
- shell.openExternal('https://www.twitter.com/ramboxapp');
- }
- },
- {
- label: `&GitHub`,
- click() {
- shell.openExternal('https://www.github.com/saenzramiro/rambox');
- }
- },
- {
- type: 'separator'
- },
- {
- label: '&Report an Issue...',
- click() {
- const body = `
-
+module.exports = function(config) {
+ const locale = require('../resources/languages/'+config.get('locale'));
+ const helpSubmenu = [
+ {
+ label: `&`+locale['menu.help[0]'],
+ click() {
+ shell.openExternal('http://rambox.pro');
+ }
+ },
+ {
+ label: `&Facebook`,
+ click() {
+ shell.openExternal('https://www.facebook.com/ramboxapp');
+ }
+ },
+ {
+ label: `&Twitter`,
+ click() {
+ shell.openExternal('https://www.twitter.com/ramboxapp');
+ }
+ },
+ {
+ label: `&GitHub`,
+ click() {
+ shell.openExternal('https://www.github.com/saenzramiro/rambox');
+ }
+ },
+ {
+ type: 'separator'
+ },
+ {
+ label: '&'+locale['menu.help[1]'],
+ click() {
+ const body = `
+
-
--
-> ${app.getName()} ${app.getVersion()}
-> Electron ${process.versions.electron}
-> ${process.platform} ${process.arch} ${os.release()}`;
+
+ -
+ > ${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`,
- click() {
- shell.openExternal('https://gitter.im/saenzramiro/rambox');
- }
- },
- {
- label: `&Tools`,
- submenu: [
- {
- label: `&Clear Cache`,
- click(item, win) {
- win.webContents.session.clearCache(function() {
- win.reload();
- });
- }
- },
- {
- label: `&Clear Local Storage`,
- click(item, win) {
- win.webContents.session.clearStorageData({
- storages: ['localstorage']
- }, function() {
- win.reload();
- });
+ shell.openExternal(`https://github.com/saenzramiro/rambox/issues/new?body=${encodeURIComponent(body)}`);
+ }
+ },
+ {
+ label: `&`+locale['menu.help[2]'],
+ click() {
+ shell.openExternal('https://gitter.im/saenzramiro/rambox');
+ }
+ },
+ {
+ label: `&Tools`,
+ submenu: [
+ {
+ label: `&Clear Cache`,
+ click(item, win) {
+ win.webContents.session.clearCache(function() {
+ win.reload();
+ });
+ }
+ },
+ {
+ label: `&Clear Local Storage`,
+ click(item, win) {
+ win.webContents.session.clearStorageData({
+ storages: ['localstorage']
+ }, function() {
+ 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 = [
- {
- label: '&Edit',
- submenu: [
- {
- role: 'undo'
- },
- {
- role: 'redo'
- },
- {
- type: 'separator'
- },
- {
- role: 'cut'
- },
- {
- role: 'copy'
- },
- {
- role: 'paste'
- },
- {
- role: 'pasteandmatchstyle'
- },
- {
- role: 'selectall'
- },
- {
- role: 'delete'
- }
- ]
- },
- {
- label: '&View',
- submenu: [
- {
- label: '&Reload',
- accelerator: 'CmdOrCtrl+R',
- click(item, focusedWindow) {
- if (focusedWindow) focusedWindow.reload();
+ let tpl = [
+ {
+ 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'
}
- },
- {
- label: '&Reload current Service',
- accelerator: 'CmdOrCtrl+Shift+R',
- click() {
- sendAction('reloadCurrentService');
+ ]
+ },
+ {
+ label: '&'+locale['menu.view[0]'],
+ submenu: [
+ {
+ 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'
- },
- {
- role: 'zoomin'
- },
- {
- role: 'zoomout'
- },
- {
- role: 'resetzoom'
- }
- ]
- },
- {
- label: '&Window',
- role: 'window',
- submenu: [
- {
- label: '&Minimize',
- accelerator: 'CmdOrCtrl+M',
- role: 'minimize'
- },
- {
- label: '&Close',
- accelerator: 'CmdOrCtrl+W',
- role: 'close'
- },
- {
- 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.window[0]'],
+ role: 'window',
+ submenu: [
+ {
+ label: '&'+locale['menu.window[1]'],
+ accelerator: 'CmdOrCtrl+M',
+ role: 'minimize'
+ },
+ {
+ label: '&'+locale['menu.window[2]'],
+ accelerator: 'CmdOrCtrl+W',
+ role: 'close'
+ },
+ {
+ type: 'separator'
+ },
+ {
+ role: 'togglefullscreen'
+ ,label: locale['menu.view[2]']
+ },
+ {
+ label: '&'+locale['menu.view[3]'],
+ accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
+ click(item, focusedWindow) {
+ if (focusedWindow) focusedWindow.webContents.toggleDevTools();
+ }
}
- }
- ]
- },
- {
- label: '&Help',
- role: 'help'
- }
-];
+ ]
+ },
+ {
+ label: '&'+locale['menu.help[4]'],
+ role: 'help'
+ }
+ ];
-if (process.platform === 'darwin') {
- tpl.unshift({
- label: appName,
- submenu: [
- {
- label: 'Preferences',
- click() {
- sendAction('showPreferences')
- }
- },
- {
- label: `Check for updates...`,
- click(item, win) {
- const webContents = win.webContents;
- const send = webContents.send.bind(win.webContents);
- send('autoUpdater:check-update');
+ if (process.platform === 'darwin') {
+ tpl.unshift({
+ label: appName,
+ submenu: [
+ {
+ label: locale['preferences[0]'],
+ click() {
+ sendAction('showPreferences')
+ }
+ },
+ {
+ label: locale['menu.help[5]'],
+ click(item, win) {
+ const webContents = win.webContents;
+ const send = webContents.send.bind(win.webContents);
+ 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}`,
- click() {
- sendAction('showAbout')
+ ]
+ });
+ } else {
+ tpl.unshift({
+ label: '&'+locale['menu.file[0]'],
+ submenu: [
+ {
+ label: locale['preferences[0]'],
+ click() {
+ sendAction('showPreferences')
+ }
+ },
+ {
+ type: 'separator'
+ },
+ {
+ role: 'quit',
+ label: locale['menu.file[1]']
}
- },
- {
- type: 'separator'
- },
- {
- label: 'Services',
- role: 'services',
- submenu: []
- },
- {
- type: 'separator'
- },
- {
- 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({
+ type: 'separator'
+ });
+ helpSubmenu.push({
+ label: `&`+locale['menu.help[5]'],
+ click(item, win) {
+ const webContents = win.webContents;
+ const send = webContents.send.bind(win.webContents);
+ send('autoUpdater:check-update');
}
- ]
- });
-} else {
- tpl.unshift({
- label: '&File',
- submenu: [
- {
- label: 'Preferences',
- click() {
- sendAction('showPreferences')
- }
- },
- {
- type: 'separator'
- },
- {
- role: 'quit'
+ });
+ helpSubmenu.push({
+ label: `&`+locale['menu.help[6]'],
+ click() {
+ sendAction('showAbout')
}
- ]
- });
- 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);
-module.exports = menu;
+ return electron.Menu.buildFromTemplate(tpl);
+};
diff --git a/index.html b/index.html
index 54cabb52..5891201c 100644
--- a/index.html
+++ b/index.html
@@ -33,6 +33,16 @@
+
+
+
+