Skip to content

Commit

Permalink
Merge pull request #2772 from vienai8d/localize_tooltips_ja
Browse files Browse the repository at this point in the history
Localize tooltips for Japanese
  • Loading branch information
Rokt33r authored Jan 7, 2019
2 parents 04ae8a8 + e6a927e commit d980931
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 10 deletions.
16 changes: 9 additions & 7 deletions browser/main/Detail/FullscreenButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ import styles from './FullscreenButton.styl'
import i18n from 'browser/lib/i18n'

const OSX = global.process.platform === 'darwin'
const hotkey = (OSX ? i18n.__('Command(⌘)') : i18n.__('Ctrl(^)')) + '+B'
const FullscreenButton = ({
onClick
}) => (
<button styleName='control-fullScreenButton' title={i18n.__('Fullscreen')} onMouseDown={(e) => onClick(e)}>
<img styleName='iconInfo' src='../resources/icon/icon-full.svg' />
<span styleName='tooltip'>{i18n.__('Fullscreen')}({hotkey})</span>
</button>
)
}) => {
const hotkey = (OSX ? i18n.__('Command(⌘)') : i18n.__('Ctrl(^)')) + '+B'
return (
<button styleName='control-fullScreenButton' title={i18n.__('Fullscreen')} onMouseDown={(e) => onClick(e)}>
<img styleName='iconInfo' src='../resources/icon/icon-full.svg' />
<span lang={i18n.locale} styleName='tooltip'>{i18n.__('Fullscreen')}({hotkey})</span>
</button>
)
}

FullscreenButton.propTypes = {
onClick: PropTypes.func.isRequired
Expand Down
4 changes: 4 additions & 0 deletions browser/main/Detail/FullscreenButton.styl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
opacity 0
transition 0.1s

.tooltip:lang(ja)
@extend .tooltip
right 35px

body[data-theme="dark"]
.control-fullScreenButton
topBarButtonDark()
2 changes: 1 addition & 1 deletion browser/main/Detail/StarButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class StarButton extends React.Component {
: '../resources/icon/icon-star.svg'
}
/>
<span styleName='tooltip'>{i18n.__('Star')}</span>
<span lang={i18n.locale} styleName='tooltip'>{i18n.__('Star')}</span>
</button>
)
}
Expand Down
5 changes: 5 additions & 0 deletions browser/main/Detail/StarButton.styl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
opacity 0
transition 0.1s

.tooltip:lang(ja)
@extend .tooltip
right 103px
width 70px

.root--active
@extend .root
transition 0.15s
Expand Down
2 changes: 1 addition & 1 deletion browser/main/Detail/ToggleModeButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const ToggleModeButton = ({
<div styleName={editorType === 'EDITOR_PREVIEW' ? 'active' : 'non-active'} onClick={() => onClick('EDITOR_PREVIEW')}>
<img styleName='item-star' src={editorType === 'EDITOR_PREVIEW' ? '' : '../resources/icon/icon-mode-split-on-active.svg'} />
</div>
<span styleName='tooltip'>{i18n.__('Toggle Mode')}</span>
<span lang={i18n.locale} styleName='tooltip'>{i18n.__('Toggle Mode')}</span>
</div>
)

Expand Down
5 changes: 5 additions & 0 deletions browser/main/Detail/ToggleModeButton.styl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
opacity 0
transition 0.1s

.tooltip:lang(ja)
@extend .tooltip
left -8px
width 70px

body[data-theme="dark"]
.control-fullScreenButton
topBarButtonDark()
Expand Down
2 changes: 1 addition & 1 deletion browser/main/Detail/TrashButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const TrashButton = ({
onClick={(e) => onClick(e)}
>
<img styleName='iconInfo' src='../resources/icon/icon-trash.svg' />
<span styleName='tooltip'>{i18n.__('Trash')}</span>
<span lang={i18n.locale} styleName='tooltip'>{i18n.__('Trash')}</span>
</button>
)

Expand Down
4 changes: 4 additions & 0 deletions browser/main/Detail/TrashButton.styl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
opacity 0
transition 0.1s

.tooltip:lang(ja)
@extend .tooltip
right 46px

.control-trashButton--in-trash
top 60px
topBarButtonRight()
Expand Down
3 changes: 3 additions & 0 deletions locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"to create a new note": "ノートを新規に作成",
"Toggle Mode": "モード切替",
"Add tag...": "タグを追加...",
"Star": "お気に入り",
"Fullscreen": "全画面",
"Trash": "ゴミ箱",
"Info": "情報",
"MODIFICATION DATE": "修正日",
"Words": "ワード",
"Letters": "文字",
Expand Down

0 comments on commit d980931

Please sign in to comment.