mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Added strings in notifications
This commit is contained in:
@@ -5,6 +5,7 @@ import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||
import store from 'browser/main/store'
|
||||
import PropTypes from 'prop-types'
|
||||
import _ from 'lodash'
|
||||
import i18n from 'browser/lib/i18n'
|
||||
|
||||
const electron = require('electron')
|
||||
const { shell } = electron
|
||||
@@ -36,7 +37,7 @@ class Blog extends React.Component {
|
||||
this.handleSettingDone = () => {
|
||||
this.setState({BlogAlert: {
|
||||
type: 'success',
|
||||
message: 'Successfully applied!'
|
||||
message: i18n.__('Successfully applied!')
|
||||
}})
|
||||
}
|
||||
this.handleSettingError = (err) => {
|
||||
@@ -99,10 +100,10 @@ class Blog extends React.Component {
|
||||
return (
|
||||
<div styleName='root'>
|
||||
<div styleName='group'>
|
||||
<div styleName='group-header'>Blog</div>
|
||||
<div styleName='group-header'>{i18n.__('Blog')}</div>
|
||||
<div styleName='group-section'>
|
||||
<div styleName='group-section-label'>
|
||||
Blog Type
|
||||
{i18n.__('Blog Type')}
|
||||
</div>
|
||||
<div styleName='group-section-control'>
|
||||
<select
|
||||
@@ -115,7 +116,7 @@ class Blog extends React.Component {
|
||||
</div>
|
||||
</div>
|
||||
<div styleName='group-section'>
|
||||
<div styleName='group-section-label'>Blog Address</div>
|
||||
<div styleName='group-section-label'>{i18n.__('Blog Address')}</div>
|
||||
<div styleName='group-section-control'>
|
||||
<input styleName='group-section-control-input'
|
||||
onChange={(e) => this.handleBlogChange(e)}
|
||||
@@ -127,16 +128,16 @@ class Blog extends React.Component {
|
||||
</div>
|
||||
<div styleName='group-control'>
|
||||
<button styleName='group-control-rightButton'
|
||||
onClick={(e) => this.handleSaveButtonClick(e)}>Save
|
||||
onClick={(e) => this.handleSaveButtonClick(e)}>{i18n.__('Save')}
|
||||
</button>
|
||||
{blogAlertElement}
|
||||
</div>
|
||||
</div>
|
||||
<div styleName='group-header2'>Auth</div>
|
||||
<div styleName='group-header2'>{i18n.__('Auth')}</div>
|
||||
|
||||
<div styleName='group-section'>
|
||||
<div styleName='group-section-label'>
|
||||
Authentication Method
|
||||
{i18n.__('Authentication Method')}
|
||||
</div>
|
||||
<div styleName='group-section-control'>
|
||||
<select
|
||||
@@ -144,14 +145,14 @@ class Blog extends React.Component {
|
||||
ref='authMethodDropdown'
|
||||
onChange={(e) => this.handleBlogChange(e)}
|
||||
>
|
||||
<option value='JWT' key='JWT'>JWT</option>
|
||||
<option value='USER' key='USER'>USER</option>
|
||||
<option value='JWT' key='JWT'>{i18n.__('JWT')}</option>
|
||||
<option value='USER' key='USER'>{i18n.__('USER')}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{ config.blog.authMethod === 'JWT' &&
|
||||
<div styleName='group-section'>
|
||||
<div styleName='group-section-label'>Token</div>
|
||||
<div styleName='group-section-label'>{i18n.__('Token')}</div>
|
||||
<div styleName='group-section-control'>
|
||||
<input styleName='group-section-control-input'
|
||||
onChange={(e) => this.handleBlogChange(e)}
|
||||
@@ -164,7 +165,7 @@ class Blog extends React.Component {
|
||||
{ config.blog.authMethod === 'USER' &&
|
||||
<div>
|
||||
<div styleName='group-section'>
|
||||
<div styleName='group-section-label'>UserName</div>
|
||||
<div styleName='group-section-label'>{i18n.__('UserName')}</div>
|
||||
<div styleName='group-section-control'>
|
||||
<input styleName='group-section-control-input'
|
||||
onChange={(e) => this.handleBlogChange(e)}
|
||||
@@ -174,7 +175,7 @@ class Blog extends React.Component {
|
||||
</div>
|
||||
</div>
|
||||
<div styleName='group-section'>
|
||||
<div styleName='group-section-label'>Password</div>
|
||||
<div styleName='group-section-label'>{i18n.__('Password')}</div>
|
||||
<div styleName='group-section-control'>
|
||||
<input styleName='group-section-control-input'
|
||||
onChange={(e) => this.handleBlogChange(e)}
|
||||
|
||||
@@ -5,6 +5,7 @@ import styles from './ConfigTab.styl'
|
||||
import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||
import store from 'browser/main/store'
|
||||
import _ from 'lodash'
|
||||
import i18n from 'browser/lib/i18n'
|
||||
|
||||
const electron = require('electron')
|
||||
const ipc = electron.ipcRenderer
|
||||
@@ -23,7 +24,7 @@ class HotkeyTab extends React.Component {
|
||||
this.handleSettingDone = () => {
|
||||
this.setState({keymapAlert: {
|
||||
type: 'success',
|
||||
message: 'Successfully applied!'
|
||||
message: i18n.__('Successfully applied!')
|
||||
}})
|
||||
}
|
||||
this.handleSettingError = (err) => {
|
||||
@@ -77,7 +78,7 @@ class HotkeyTab extends React.Component {
|
||||
this.props.haveToSave({
|
||||
tab: 'Hotkey',
|
||||
type: 'warning',
|
||||
message: 'You have to save!'
|
||||
message: i18n.__('You have to save!')
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -102,9 +103,9 @@ class HotkeyTab extends React.Component {
|
||||
return (
|
||||
<div styleName='root'>
|
||||
<div styleName='group'>
|
||||
<div styleName='group-header'>Hotkeys</div>
|
||||
<div styleName='group-header'>{i18n.__('Hotkeys')}</div>
|
||||
<div styleName='group-section'>
|
||||
<div styleName='group-section-label'>Show/Hide Boostnote</div>
|
||||
<div styleName='group-section-label'>{i18n.__('Show/Hide Boostnote')}</div>
|
||||
<div styleName='group-section-control'>
|
||||
<input styleName='group-section-control-input'
|
||||
onChange={(e) => this.handleHotkeyChange(e)}
|
||||
@@ -124,7 +125,7 @@ class HotkeyTab extends React.Component {
|
||||
}
|
||||
</button>
|
||||
<button styleName='group-control-rightButton'
|
||||
onClick={(e) => this.handleSaveButtonClick(e)}>Save
|
||||
onClick={(e) => this.handleSaveButtonClick(e)}>{i18n.__('Save')}
|
||||
</button>
|
||||
{keymapAlertElement}
|
||||
</div>
|
||||
|
||||
@@ -39,11 +39,11 @@ class InfoTab extends React.Component {
|
||||
if (!newConfig.amaEnabled) {
|
||||
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('DISABLE_AMA')
|
||||
this.setState({
|
||||
amaMessage: 'We hope we will gain your trust'
|
||||
amaMessage: i18n.__('We hope we will gain your trust')
|
||||
})
|
||||
} else {
|
||||
this.setState({
|
||||
amaMessage: 'Thank\'s for trust us'
|
||||
amaMessage: i18n.__('Thank\'s for trust us')
|
||||
})
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ class InfoTab extends React.Component {
|
||||
type='checkbox'
|
||||
/>
|
||||
{i18n.__('Enable analytics to help improve Boostnote')}<br />
|
||||
<button styleName='policy-submit' onClick={(e) => this.handleSaveButtonClick(e)}>Save</button>
|
||||
<button styleName='policy-submit' onClick={(e) => this.handleSaveButtonClick(e)}>{i18n.__('Save')}</button>
|
||||
<br />
|
||||
{this.infoMessage()}
|
||||
</div>
|
||||
|
||||
@@ -47,9 +47,9 @@ class StorageItem extends React.Component {
|
||||
handleUnlinkButtonClick (e) {
|
||||
const index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||
type: 'warning',
|
||||
message: 'Unlink Storage',
|
||||
detail: 'Unlinking removes this linked storage from Boostnote. No data is removed, please manually delete the folder from your hard drive if needed.',
|
||||
buttons: ['Unlink', 'Cancel']
|
||||
message: i18n.__('Unlink Storage'),
|
||||
detail: i18n.__('Unlinking removes this linked storage from Boostnote. No data is removed, please manually delete the folder from your hard drive if needed.'),
|
||||
buttons: [i18n.__('Unlink'), i18n.__('Cancel')]
|
||||
})
|
||||
|
||||
if (index === 0) {
|
||||
|
||||
@@ -30,7 +30,7 @@ class UiTab extends React.Component {
|
||||
this.handleSettingDone = () => {
|
||||
this.setState({UiAlert: {
|
||||
type: 'success',
|
||||
message: 'Successfully applied!'
|
||||
message: i18n.__('Successfully applied!')
|
||||
}})
|
||||
}
|
||||
this.handleSettingError = (err) => {
|
||||
@@ -108,7 +108,7 @@ class UiTab extends React.Component {
|
||||
this.props.haveToSave({
|
||||
tab: 'UI',
|
||||
type: 'warning',
|
||||
message: 'You have to save!'
|
||||
message: i18n.__('You have to save!')
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -474,7 +474,7 @@ class UiTab extends React.Component {
|
||||
|
||||
<div styleName='group-control'>
|
||||
<button styleName='group-control-rightButton'
|
||||
onClick={(e) => this.handleSaveUIClick(e)}>Save
|
||||
onClick={(e) => this.handleSaveUIClick(e)}>{i18n.__('Save')}
|
||||
</button>
|
||||
{UiAlertElement}
|
||||
</div>
|
||||
|
||||
@@ -118,12 +118,12 @@ class Preferences extends React.Component {
|
||||
const content = this.renderContent()
|
||||
|
||||
const tabs = [
|
||||
{target: 'STORAGES', label: 'Storage'},
|
||||
{target: 'HOTKEY', label: 'Hotkeys', Hotkey: this.state.HotkeyAlert},
|
||||
{target: 'UI', label: 'Interface', UI: this.state.UIAlert},
|
||||
{target: 'INFO', label: 'About'},
|
||||
{target: 'CROWDFUNDING', label: 'Crowdfunding'},
|
||||
{target: 'BLOG', label: 'Blog', Blog: this.state.BlogAlert}
|
||||
{target: 'STORAGES', label: i18n.__('Storage')},
|
||||
{target: 'HOTKEY', label: i18n.__('Hotkeys'), Hotkey: this.state.HotkeyAlert},
|
||||
{target: 'UI', label: i18n.__('Interface'), UI: this.state.UIAlert},
|
||||
{target: 'INFO', label: i18n.__('About')},
|
||||
{target: 'CROWDFUNDING', label: i18n.__('Crowdfunding')},
|
||||
{target: 'BLOG', label: i18n.__('Blog'), Blog: this.state.BlogAlert}
|
||||
]
|
||||
|
||||
const navButtons = tabs.map((tab) => {
|
||||
|
||||
Reference in New Issue
Block a user