Skip to content

Commit

Permalink
fix(plugins/plugin-client-common): missed i18n strings in Dropdown menus
Browse files Browse the repository at this point in the history
Fixes #4850
  • Loading branch information
myan9 authored and starpit committed Jun 9, 2020
1 parent d6b0b86 commit c516238
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions plugins/plugin-client-common/i18n/resources_en_US.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"Remove": "Remove",
"ok": "ok",
"Show as table": "Show as table",
"Stop watching": "Stop watching"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
*/

import * as React from 'react'
import { REPL, inBrowser } from '@kui-shell/core'
import { REPL, inBrowser, i18n } from '@kui-shell/core'

import Width from './width'
import Icons from '../../spi/Icons'
import DropDown from '../../spi/DropDown'
import Breadcrumb, { BreadcrumbView } from '../../spi/Breadcrumb'

const strings = i18n('plugin-client-common', 'screenshot')

export interface Props {
kind?: string
name?: string
Expand Down Expand Up @@ -78,7 +80,7 @@ export default class Window extends React.PureComponent<Props> {
} else {
return [
{
label: 'Screenshot',
label: strings('Screenshot'),
handler: () => this.props.willScreenshot()
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import * as React from 'react'
import { dots as spinnerFrames } from 'cli-spinners'
import { Tab as KuiTab, inBrowser, doCancel } from '@kui-shell/core'
import { Tab as KuiTab, inBrowser, doCancel, i18n } from '@kui-shell/core'

import onPaste from './OnPaste'
import onKeyDown from './OnKeyDown'
Expand All @@ -28,6 +28,9 @@ import { BlockModel, isActive, isProcessing, isFinished, hasCommand, isEmpty, ha

import DropDown from '../../../spi/DropDown'

const strings = i18n('plugin-client-common')
const strings2 = i18n('plugin-client-common', 'screenshot')

export interface InputOptions {
/** Optional: placeholder value for prompt */
promptPlaceholder?: string // was: from '@kui-shell/client/config.d/style.json'
Expand Down Expand Up @@ -359,15 +362,15 @@ export default class Input extends InputProvider {
}

private removeAction() {
return !this.props.willRemove ? [] : [{ label: 'Remove', handler: () => this.props.willRemove() }]
return !this.props.willRemove ? [] : [{ label: strings('Remove'), handler: () => this.props.willRemove() }]
}

private screenshotAction() {
return !this.props.willScreenshot || inBrowser()
? []
: [
{
label: 'Screenshot',
label: strings2('Screenshot'),
handler: () => this.props.willScreenshot()
}
]
Expand Down

0 comments on commit c516238

Please sign in to comment.