Skip to content

Commit

Permalink
fix i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Mar 10, 2020
1 parent f928379 commit 997a15c
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 55 deletions.
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"src/legacy/core_plugins/data",
"src/plugins/data"
],
"discover": "src/plugins/discover",
"embeddableApi": "src/plugins/embeddable",
"embeddableExamples": "examples/embeddable_examples",
"share": "src/plugins/share",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,52 +21,52 @@ import { i18n } from '@kbn/i18n';
export function getFieldTypeName(type: string) {
switch (type) {
case 'boolean':
return i18n.translate('kbn.discover.fieldNameIcons.booleanAriaLabel', {
return i18n.translate('discover.fieldNameIcons.booleanAriaLabel', {
defaultMessage: 'Boolean field',
});
case 'conflict':
return i18n.translate('kbn.discover.fieldNameIcons.conflictFieldAriaLabel', {
return i18n.translate('discover.fieldNameIcons.conflictFieldAriaLabel', {
defaultMessage: 'Conflicting field',
});
case 'date':
return i18n.translate('kbn.discover.fieldNameIcons.dateFieldAriaLabel', {
return i18n.translate('discover.fieldNameIcons.dateFieldAriaLabel', {
defaultMessage: 'Date field',
});
case 'geo_point':
return i18n.translate('kbn.discover.fieldNameIcons.geoPointFieldAriaLabel', {
return i18n.translate('discover.fieldNameIcons.geoPointFieldAriaLabel', {
defaultMessage: 'Geo point field',
});
case 'geo_shape':
return i18n.translate('kbn.discover.fieldNameIcons.geoShapeFieldAriaLabel', {
return i18n.translate('discover.fieldNameIcons.geoShapeFieldAriaLabel', {
defaultMessage: 'Geo shape field',
});
case 'ip':
return i18n.translate('kbn.discover.fieldNameIcons.ipAddressFieldAriaLabel', {
return i18n.translate('discover.fieldNameIcons.ipAddressFieldAriaLabel', {
defaultMessage: 'IP address field',
});
case 'murmur3':
return i18n.translate('kbn.discover.fieldNameIcons.murmur3FieldAriaLabel', {
return i18n.translate('discover.fieldNameIcons.murmur3FieldAriaLabel', {
defaultMessage: 'Murmur3 field',
});
case 'number':
return i18n.translate('kbn.discover.fieldNameIcons.numberFieldAriaLabel', {
return i18n.translate('discover.fieldNameIcons.numberFieldAriaLabel', {
defaultMessage: 'Number field',
});
case 'source':
// Note that this type is currently not provided, type for _source is undefined
return i18n.translate('kbn.discover.fieldNameIcons.sourceFieldAriaLabel', {
return i18n.translate('discover.fieldNameIcons.sourceFieldAriaLabel', {
defaultMessage: 'Source field',
});
case 'string':
return i18n.translate('kbn.discover.fieldNameIcons.stringFieldAriaLabel', {
return i18n.translate('discover.fieldNameIcons.stringFieldAriaLabel', {
defaultMessage: 'String field',
});
case 'nested':
return i18n.translate('kbn.discover.fieldNameIcons.nestedFieldAriaLabel', {
return i18n.translate('discover.fieldNameIcons.nestedFieldAriaLabel', {
defaultMessage: 'Nested field',
});
default:
return i18n.translate('kbn.discover.fieldNameIcons.unknownFieldAriaLabel', {
return i18n.translate('discover.fieldNameIcons.unknownFieldAriaLabel', {
defaultMessage: 'Unknown field',
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { i18n } from '@kbn/i18n';
import { DocViewRenderProps } from '../../doc_views/doc_views_types';

export function JsonCodeBlock({ hit }: DocViewRenderProps) {
const label = i18n.translate('kbn.discover.docViews.json.codeEditorAriaLabel', {
const label = i18n.translate('discover.docViews.json.codeEditorAriaLabel', {
defaultMessage: 'Read only JSON view of an elasticsearch document',
});
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface Props {
}

export function DocViewTableRowBtnCollapse({ onClick, isCollapsed }: Props) {
const label = i18n.translate('kbn.discover.docViews.table.toggleFieldDetails', {
const label = i18n.translate('discover.docViews.table.toggleFieldDetails', {
defaultMessage: 'Toggle field details',
});
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ export interface Props {
export function DocViewTableRowBtnFilterAdd({ onClick, disabled = false }: Props) {
const tooltipContent = disabled ? (
<FormattedMessage
id="kbn.discover.docViews.table.unindexedFieldsCanNotBeSearchedTooltip"
id="discover.docViews.table.unindexedFieldsCanNotBeSearchedTooltip"
defaultMessage="Unindexed fields can not be searched"
/>
) : (
<FormattedMessage
id="kbn.discover.docViews.table.filterForValueButtonTooltip"
id="discover.docViews.table.filterForValueButtonTooltip"
defaultMessage="Filter for value"
/>
);

return (
<EuiToolTip content={tooltipContent}>
<EuiButtonIcon
aria-label={i18n.translate('kbn.discover.docViews.table.filterForValueButtonAriaLabel', {
aria-label={i18n.translate('discover.docViews.table.filterForValueButtonAriaLabel', {
defaultMessage: 'Filter for value',
})}
className="kbnDocViewer__actionButton"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ export function DocViewTableRowBtnFilterExists({
const tooltipContent = disabled ? (
scripted ? (
<FormattedMessage
id="kbn.discover.docViews.table.unableToFilterForPresenceOfScriptedFieldsTooltip"
id="discover.docViews.table.unableToFilterForPresenceOfScriptedFieldsTooltip"
defaultMessage="Unable to filter for presence of scripted fields"
/>
) : (
<FormattedMessage
id="kbn.discover.docViews.table.unableToFilterForPresenceOfMetaFieldsTooltip"
id="discover.docViews.table.unableToFilterForPresenceOfMetaFieldsTooltip"
defaultMessage="Unable to filter for presence of meta fields"
/>
)
) : (
<FormattedMessage
id="kbn.discover.docViews.table.filterForFieldPresentButtonTooltip"
id="discover.docViews.table.filterForFieldPresentButtonTooltip"
defaultMessage="Filter for field present"
/>
);
Expand All @@ -55,7 +55,7 @@ export function DocViewTableRowBtnFilterExists({
<EuiToolTip content={tooltipContent}>
<EuiButtonIcon
aria-label={i18n.translate(
'kbn.discover.docViews.table.filterForFieldPresentButtonAriaLabel',
'discover.docViews.table.filterForFieldPresentButtonAriaLabel',
{
defaultMessage: 'Filter for field present',
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ export interface Props {
export function DocViewTableRowBtnFilterRemove({ onClick, disabled = false }: Props) {
const tooltipContent = disabled ? (
<FormattedMessage
id="kbn.discover.docViews.table.unindexedFieldsCanNotBeSearchedTooltip"
id="discover.docViews.table.unindexedFieldsCanNotBeSearchedTooltip"
defaultMessage="Unindexed fields can not be searched"
/>
) : (
<FormattedMessage
id="kbn.discover.docViews.table.filterOutValueButtonTooltip"
id="discover.docViews.table.filterOutValueButtonTooltip"
defaultMessage="Filter out value"
/>
);

return (
<EuiToolTip content={tooltipContent}>
<EuiButtonIcon
aria-label={i18n.translate('kbn.discover.docViews.table.filterOutValueButtonAriaLabel', {
aria-label={i18n.translate('discover.docViews.table.filterOutValueButtonAriaLabel', {
defaultMessage: 'Filter out value',
})}
className="kbnDocViewer__actionButton"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function DocViewTableRowBtnToggleColumn({ onClick, active, disabled = fal
return (
<EuiButtonIcon
aria-label={i18n.translate(
'kbn.discover.docViews.table.toggleColumnInTableButtonAriaLabel',
'discover.docViews.table.toggleColumnInTableButtonAriaLabel',
{
defaultMessage: 'Toggle column in table',
}
Expand All @@ -49,14 +49,14 @@ export function DocViewTableRowBtnToggleColumn({ onClick, active, disabled = fal
<EuiToolTip
content={
<FormattedMessage
id="kbn.discover.docViews.table.toggleColumnInTableButtonTooltip"
id="discover.docViews.table.toggleColumnInTableButtonTooltip"
defaultMessage="Toggle column in table"
/>
}
>
<EuiButtonIcon
aria-label={i18n.translate(
'kbn.discover.docViews.table.toggleColumnInTableButtonAriaLabel',
'discover.docViews.table.toggleColumnInTableButtonAriaLabel',
{
defaultMessage: 'Toggle column in table',
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import { i18n } from '@kbn/i18n';

export function DocViewTableRowIconNoMapping() {
const ariaLabel = i18n.translate(
'kbn.discover.docViews.table.noCachedMappingForThisFieldAriaLabel',
'discover.docViews.table.noCachedMappingForThisFieldAriaLabel',
{
defaultMessage: 'Warning',
}
);
const tooltipContent = i18n.translate(
'kbn.discover.docViews.table.noCachedMappingForThisFieldTooltip',
'discover.docViews.table.noCachedMappingForThisFieldTooltip',
{
defaultMessage:
'No cached mapping for this field. Refresh field list from the Management > Index Patterns page',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import { i18n } from '@kbn/i18n';

export function DocViewTableRowIconUnderscore() {
const ariaLabel = i18n.translate(
'kbn.discover.docViews.table.fieldNamesBeginningWithUnderscoreUnsupportedAriaLabel',
'discover.docViews.table.fieldNamesBeginningWithUnderscoreUnsupportedAriaLabel',
{
defaultMessage: 'Warning',
}
);
const tooltipContent = i18n.translate(
'kbn.discover.docViews.table.fieldNamesBeginningWithUnderscoreUnsupportedTooltip',
'discover.docViews.table.fieldNamesBeginningWithUnderscoreUnsupportedTooltip',
{
defaultMessage: 'Field names beginning with {underscoreSign} are not supported',
values: { underscoreSign: '_' },
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/discover/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ export class DiscoverPlugin implements Plugin<DiscoverSetup, DiscoverStart> {
this.docViewsRegistry = new DocViewsRegistry();
setDocViewsRegistry(this.docViewsRegistry);
this.docViewsRegistry.addDocView({
title: i18n.translate('kbn.discover.docViews.table.tableTitle', {
title: i18n.translate('discover.docViews.table.tableTitle', {
defaultMessage: 'Table',
}),
order: 10,
component: DocViewTable,
});
this.docViewsRegistry.addDocView({
title: i18n.translate('kbn.discover.docViews.json.jsonTitle', {
title: i18n.translate('discover.docViews.json.jsonTitle', {
defaultMessage: 'JSON',
}),
order: 20,
Expand Down
22 changes: 11 additions & 11 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,17 @@
"data.search.searchBar.savedQueryPopoverSavedQueryListItemDescriptionAriaLabel": "{savedQueryName} の説明",
"data.search.searchBar.savedQueryPopoverSavedQueryListItemSelectedButtonAriaLabel": "選択されたクエリボタン {savedQueryName} を保存しました。変更を破棄するには押してください。",
"data.search.searchBar.savedQueryPopoverTitleText": "保存されたクエリ",
"discover.fieldNameIcons.booleanAriaLabel": "ブールフィールド",
"discover.fieldNameIcons.conflictFieldAriaLabel": "矛盾フィールド",
"discover.fieldNameIcons.dateFieldAriaLabel": "日付フィールド",
"discover.fieldNameIcons.geoPointFieldAriaLabel": "地理ポイント",
"discover.fieldNameIcons.geoShapeFieldAriaLabel": "地理情報図形",
"discover.fieldNameIcons.ipAddressFieldAriaLabel": "IP アドレスフィールド",
"discover.fieldNameIcons.murmur3FieldAriaLabel": "Murmur3 フィールド",
"discover.fieldNameIcons.numberFieldAriaLabel": "数値フィールド",
"discover.fieldNameIcons.sourceFieldAriaLabel": "ソースフィールド",
"discover.fieldNameIcons.stringFieldAriaLabel": "文字列フィールド",
"discover.fieldNameIcons.unknownFieldAriaLabel": "不明なフィールド",
"charts.colormaps.bluesText": "青",
"charts.colormaps.greensText": "緑",
"charts.colormaps.greenToRedText": "緑から赤",
Expand Down Expand Up @@ -1082,17 +1093,6 @@
"kbn.discover.fieldChooser.searchPlaceHolder": "検索フィールド",
"kbn.discover.fieldChooser.toggleFieldFilterButtonHideAriaLabel": "フィールド設定を非表示",
"kbn.discover.fieldChooser.toggleFieldFilterButtonShowAriaLabel": "フィールド設定を表示",
"kbn.discover.fieldNameIcons.booleanAriaLabel": "ブールフィールド",
"kbn.discover.fieldNameIcons.conflictFieldAriaLabel": "矛盾フィールド",
"kbn.discover.fieldNameIcons.dateFieldAriaLabel": "日付フィールド",
"kbn.discover.fieldNameIcons.geoPointFieldAriaLabel": "地理ポイント",
"kbn.discover.fieldNameIcons.geoShapeFieldAriaLabel": "地理情報図形",
"kbn.discover.fieldNameIcons.ipAddressFieldAriaLabel": "IP アドレスフィールド",
"kbn.discover.fieldNameIcons.murmur3FieldAriaLabel": "Murmur3 フィールド",
"kbn.discover.fieldNameIcons.numberFieldAriaLabel": "数値フィールド",
"kbn.discover.fieldNameIcons.sourceFieldAriaLabel": "ソースフィールド",
"kbn.discover.fieldNameIcons.stringFieldAriaLabel": "文字列フィールド",
"kbn.discover.fieldNameIcons.unknownFieldAriaLabel": "不明なフィールド",
"kbn.discover.histogram.partialData.bucketTooltipText": "選択された時間範囲にはこのバケット全体は含まれていませんが、一部データが含まれている可能性があります。",
"kbn.discover.histogramOfFoundDocumentsAriaLabel": "発見されたドキュメントのヒストグラム",
"kbn.discover.hitsPluralTitle": "{hits, plural, one {ヒット} other {ヒット}}",
Expand Down
22 changes: 11 additions & 11 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,17 @@
"data.search.searchBar.savedQueryPopoverSavedQueryListItemDescriptionAriaLabel": "{savedQueryName} 描述",
"data.search.searchBar.savedQueryPopoverSavedQueryListItemSelectedButtonAriaLabel": "已保存查询按钮已选择 {savedQueryName}。按下可清除任何更改。",
"data.search.searchBar.savedQueryPopoverTitleText": "已保存查询",
"discover.fieldNameIcons.booleanAriaLabel": "布尔字段",
"discover.fieldNameIcons.conflictFieldAriaLabel": "冲突字段",
"discover.fieldNameIcons.dateFieldAriaLabel": "日期字段",
"discover.fieldNameIcons.geoPointFieldAriaLabel": "地理位置点字段",
"discover.fieldNameIcons.geoShapeFieldAriaLabel": "几何形状字段",
"discover.fieldNameIcons.ipAddressFieldAriaLabel": "IP 地址字段",
"discover.fieldNameIcons.murmur3FieldAriaLabel": "Murmur3 字段",
"discover.fieldNameIcons.numberFieldAriaLabel": "数字字段",
"discover.fieldNameIcons.sourceFieldAriaLabel": "源字段",
"discover.fieldNameIcons.stringFieldAriaLabel": "字符串字段",
"discover.fieldNameIcons.unknownFieldAriaLabel": "未知字段",
"charts.colormaps.bluesText": "蓝色",
"charts.colormaps.greensText": "绿色",
"charts.colormaps.greenToRedText": "绿到红",
Expand Down Expand Up @@ -1082,17 +1093,6 @@
"kbn.discover.fieldChooser.searchPlaceHolder": "搜索字段",
"kbn.discover.fieldChooser.toggleFieldFilterButtonHideAriaLabel": "隐藏字段设置",
"kbn.discover.fieldChooser.toggleFieldFilterButtonShowAriaLabel": "显示字段设置",
"kbn.discover.fieldNameIcons.booleanAriaLabel": "布尔字段",
"kbn.discover.fieldNameIcons.conflictFieldAriaLabel": "冲突字段",
"kbn.discover.fieldNameIcons.dateFieldAriaLabel": "日期字段",
"kbn.discover.fieldNameIcons.geoPointFieldAriaLabel": "地理位置点字段",
"kbn.discover.fieldNameIcons.geoShapeFieldAriaLabel": "几何形状字段",
"kbn.discover.fieldNameIcons.ipAddressFieldAriaLabel": "IP 地址字段",
"kbn.discover.fieldNameIcons.murmur3FieldAriaLabel": "Murmur3 字段",
"kbn.discover.fieldNameIcons.numberFieldAriaLabel": "数字字段",
"kbn.discover.fieldNameIcons.sourceFieldAriaLabel": "源字段",
"kbn.discover.fieldNameIcons.stringFieldAriaLabel": "字符串字段",
"kbn.discover.fieldNameIcons.unknownFieldAriaLabel": "未知字段",
"kbn.discover.histogram.partialData.bucketTooltipText": "选定的时间范围不包括此整个存储桶,其可能包含部分数据。",
"kbn.discover.histogramOfFoundDocumentsAriaLabel": "已找到文档的直方图",
"kbn.discover.hitsPluralTitle": "{hits, plural, one {次命中} other {次命中}}",
Expand Down

0 comments on commit 997a15c

Please sign in to comment.