Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[i18n] Translate missing labels in context #26970

Merged
merged 56 commits into from
Dec 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
c7ec189
Merge pull request #1 from elastic/master
Nox911 Sep 24, 2018
fa01b88
Merge pull request #2 from elastic/master
Nox911 Sep 27, 2018
70f6c7e
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Sep 27, 2018
68587a0
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Sep 28, 2018
42aa7d3
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 2, 2018
efeaefe
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 2, 2018
8a054ed
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 8, 2018
b0d1660
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 16, 2018
62b6ad1
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 17, 2018
acbad4b
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 18, 2018
a850650
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 22, 2018
0a200ce
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 25, 2018
b2a8244
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 29, 2018
b4b979e
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 30, 2018
d349a4f
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 31, 2018
ae285b9
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 2, 2018
3051641
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 5, 2018
6231971
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 8, 2018
f86a3d4
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 9, 2018
cf813c7
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 13, 2018
1aba03f
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 14, 2018
491009b
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 15, 2018
e243126
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 22, 2018
e74bd61
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 22, 2018
8bc5ffa
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 23, 2018
5787937
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 23, 2018
f17fa1e
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 24, 2018
c63b0a6
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 26, 2018
ed62b5b
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 26, 2018
df4fab4
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 26, 2018
46d284a
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 27, 2018
d1fd49e
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 29, 2018
ec1ad76
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 29, 2018
6ebd934
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 30, 2018
332d867
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Dec 3, 2018
4a99411
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Dec 3, 2018
4cdec42
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Dec 4, 2018
5d44df7
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Dec 4, 2018
c6e63aa
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Dec 4, 2018
8182d1f
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Dec 4, 2018
aefb90f
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Dec 5, 2018
e4e7120
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Dec 6, 2018
a9a6043
Merge branch 'master' of https://github.com/elastic/kibana
Dec 7, 2018
9d247e6
Merge branch 'master' of https://github.com/elastic/kibana
Dec 10, 2018
bd707af
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Dec 11, 2018
b52c48a
Translate context and docs
Nox911 Dec 11, 2018
71fb60d
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Dec 12, 2018
4d95475
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Dec 13, 2018
5bf7214
Fix issues
Nox911 Dec 13, 2018
7c76c50
Fix issues
Nox911 Dec 13, 2018
62e824d
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Dec 13, 2018
a48e205
Fix issues
Nox911 Dec 13, 2018
4463796
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Dec 14, 2018
f3e076f
Merge branch 'master' into feature/translate-context
Nox911 Dec 14, 2018
876e358
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Dec 14, 2018
01c6c9f
Merge branch 'master' into feature/translate-context
Nox911 Dec 14, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/legacy/core_plugins/kibana/public/context/api/anchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import _ from 'lodash';

import { SearchSourceProvider } from 'ui/courier';

export function fetchAnchorProvider(indexPatterns, Private) {
export function fetchAnchorProvider(indexPatterns, Private, i18n) {
const SearchSource = Private(SearchSourceProvider);

return async function fetchAnchor(
Expand Down Expand Up @@ -54,7 +54,9 @@ export function fetchAnchorProvider(indexPatterns, Private) {
const response = await searchSource.fetch();

if (_.get(response, ['hits', 'total'], 0) < 1) {
throw new Error('Failed to load anchor document.');
throw new Error(i18n('kbn.context.failedToLoadAnchorDocumentErrorDescription', {
defaultMessage: 'Failed to load anchor document.'
}));
}

return {
Expand Down
88 changes: 65 additions & 23 deletions src/legacy/core_plugins/kibana/public/context/app.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<div class="kuiLocalNav" ng-if="!k7design">
<div class="kuiLocalNavRow">
<div class="kuiLocalNavRow__section">
<div class="kuiLocalTitle" role="heading" aria-level="1">
Surrounding Documents in {{ contextApp.state.queryParameters.indexPatternId }}
</div>
<div
class="kuiLocalTitle"
role="heading"
aria-level="1"
i18n-id="kbn.context.surroundingDocumentsDescription"
i18n-default-message="Surrounding Documents in {indexPatternId}"
i18n-values="{
indexPatternId: contextApp.state.queryParameters.indexPatternId
}"
></div>
</div>
</div>
<div class="kuiLocalNavRow kuiLocalNavRow--secondary">
Expand All @@ -25,31 +32,46 @@
<div class="kuiInfoPanel kuiInfoPanel--error kuiVerticalRhythm">
<div class="kuiInfoPanelHeader">
<span class="kuiInfoPanelHeader__icon kuiIcon kuiIcon--error fa-warning"></span>
<span class="kuiInfoPanelHeader__title">
Failed to load the anchor document
</span>
<span
class="kuiInfoPanelHeader__title"
i18n-id="kbn.context.failedToLoadAnchorDocumentDescription"
i18n-default-message="Failed to load the anchor document"
></span>
</div>

<div class="kuiInfoPanelBody">
<div
class="kuiInfoPanelBody__message"
ng-if="contextApp.state.loadingStatus.anchor.reason === contextApp.constants.FAILURE_REASONS.INVALID_TIEBREAKER"
i18n-id="kbn.context.noSearchableTiebreakerFieldDescription"
i18n-default-message="No searchable tiebreaker field could be found in the index pattern {indexPatternId}. Please change the advanced setting {tieBreakerFields} to include a valid field for this index pattern."
i18n-values="{
indexPatternId: contextApp.state.queryParameters.indexPatternId,
html_tieBreakerFields: '<code>context:tieBreakerFields</code>'
}"
>
No searchable tiebreaker field could be found in the index pattern
{{ contextApp.state.queryParameters.indexPatternId}}.

Please change the advanced setting
<code>context:tieBreakerFields</code> to include a valid field for this
index pattern.
</div>
<div
class="kuiInfoPanelBody__message"
ng-if="contextApp.state.loadingStatus.anchor.reason === contextApp.constants.FAILURE_REASONS.UNKNOWN"
>
Please reload or visit
<a ng-href="{{ contextApp.state.navigation.discover.url }}">Discover</a>
to select a valid anchor document.
</div>
<span
i18n-id="kbn.context.reloadPageDescription.reloadOrVisitTextMessage"
i18n-default-message="Please reload or visit"
i18n-description="Part of composite text kbn.context.reloadPageDescription.reloadOrVisitTextMessage + kbn.context.reloadPageDescription.discoverLinkText + kbn.context.reloadPageDescription.selectValidAnchorDocumentTextMessage"
></span>
<a
ng-href="{{ contextApp.state.navigation.discover.url }}"
i18n-id="kbn.context.reloadPageDescription.discoverLinkText"
i18n-default-message="Discover"
i18n-description="Part of composite text kbn.context.reloadPageDescription.reloadOrVisitTextMessage + kbn.context.reloadPageDescription.discoverLinkText + kbn.context.reloadPageDescription.selectValidAnchorDocumentTextMessage"
></a>
<span
i18n-id="kbn.context.reloadPageDescription.selectValidAnchorDocumentTextMessage"
i18n-default-message="to select a valid anchor document."
i18n-description="Part of composite text kbn.context.reloadPageDescription.reloadOrVisitTextMessage + kbn.context.reloadPageDescription.discoverLinkText + kbn.context.reloadPageDescription.selectValidAnchorDocumentTextMessage"
></span>
</div>
</div>
</div>
</div>
Expand All @@ -70,15 +92,24 @@
icon="'fa-chevron-up'"
ng-click="contextApp.actions.fetchMorePredecessorRows()"
>
Load {{ contextApp.state.queryParameters.defaultStepSize }} more
<span
i18n-id="kbn.context.loadMoreDescription"
i18n-default-message="Load {defaultStepSize} more"
i18n-values="{
defaultStepSize: contextApp.state.queryParameters.defaultStepSize
}"
></span>
</context-loading-button>
<context-size-picker
count="contextApp.state.queryParameters.predecessorCount"
data-test-subj="predecessorCountPicker"
is-disabled="contextApp.state.loadingStatus.anchor.status !== contextApp.constants.LOADING_STATUS.LOADED"
on-change-count="contextApp.actions.fetchGivenPredecessorRows"
></context-size-picker>
<span>newer documents</span>
<span
i18n-id="kbn.context.newerDocumentsDescription"
i18n-default-message="newer documents"
></span>
<span
class="kuiStatusText kuiStatusText--warning"
ng-if="(contextApp.state.loadingStatus.predecessors.status === contextApp.constants.LOADING_STATUS.LOADED)
Expand All @@ -101,9 +132,11 @@
].includes(contextApp.state.loadingStatus.anchor.status)"
class="kuiPanel kuiPanel--centered kuiVerticalRhythm"
>
<div class="kuiTableInfo">
Loading&hellip;
</div>
<div
class="kuiTableInfo"
i18n-id="kbn.context.loadingDescription"
i18n-default-message="Loading…"
></div>
</div>

<!-- Table -->
Expand Down Expand Up @@ -136,15 +169,24 @@
icon="'fa-chevron-down'"
ng-click="contextApp.actions.fetchMoreSuccessorRows()"
>
Load {{ contextApp.state.queryParameters.defaultStepSize }} more
<span
i18n-id="kbn.context.loadMoreDescription"
i18n-default-message="Load {defaultStepSize} more"
i18n-values="{
defaultStepSize: contextApp.state.queryParameters.defaultStepSize
}"
></span>
</context-loading-button>
<context-size-picker
count="contextApp.state.queryParameters.successorCount"
data-test-subj="successorCountPicker"
is-disabled="contextApp.state.loadingStatus.anchor.status !== contextApp.constants.LOADING_STATUS.LOADED"
on-change-count="contextApp.actions.fetchGivenSuccessorRows"
></context-size-picker>
<div>older documents</div>
<div
i18n-id="kbn.context.olderDocumentsDescription"
i18n-default-message="older documents"
></div>
<span
class="kuiStatusText kuiStatusText--warning"
ng-if="(contextApp.state.loadingStatus.successors.status === contextApp.constants.LOADING_STATUS.LOADED)
Expand Down
1 change: 1 addition & 0 deletions src/legacy/core_plugins/kibana/public/context/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function ContextAppController($scope, config, Private) {
);
}


function createInitialState(defaultStepSize, tieBreakerField, discoverUrl) {
return {
queryParameters: createInitialQueryParametersState(defaultStepSize, tieBreakerField),
Expand Down
10 changes: 7 additions & 3 deletions src/legacy/core_plugins/kibana/public/context/query/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { fetchContextProvider } from '../api/context';
import { QueryParameterActionsProvider } from '../query_parameters';
import { FAILURE_REASONS, LOADING_STATUS } from './constants';

export function QueryActionsProvider(courier, Private, Promise) {
export function QueryActionsProvider(courier, Private, Promise, i18n) {
const fetchAnchor = Private(fetchAnchorProvider);
const { fetchPredecessors, fetchSuccessors } = Private(fetchContextProvider);
const {
Expand Down Expand Up @@ -81,7 +81,9 @@ export function QueryActionsProvider(courier, Private, Promise) {
(error) => {
setFailedStatus(state)('anchor', { error });
toastNotifications.addDanger({
title: 'Unable to load the anchor document',
title: i18n('kbn.context.unableToLoadAnchorDocumentDescription', {
defaultMessage: 'Unable to load the anchor document'
}),
text: <MarkdownSimple>{error.message}</MarkdownSimple>,
});
throw error;
Expand Down Expand Up @@ -125,7 +127,9 @@ export function QueryActionsProvider(courier, Private, Promise) {
(error) => {
setFailedStatus(state)('predecessors', { error });
toastNotifications.addDanger({
title: 'Unable to load documents',
title: i18n('kbn.context.unableToLoadDocumentDescription', {
defaultMessage: 'Unable to load documents'
}),
text: <MarkdownSimple>{error.message}</MarkdownSimple>,
});
throw error;
Expand Down
52 changes: 33 additions & 19 deletions src/legacy/core_plugins/kibana/public/doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
<div class="kuiLocalNav" ng-if="!k7design">
<div class="kuiLocalNavRow">
<div class="kuiLocalNavRow__section">
<div class="kuiLocalTitle">
Single Document
</div>
<div
class="kuiLocalTitle"
i18n-id="kbn.doc.singleDocumentTitle"
i18n-default-message="Single Document"
></div>
</div>
</div>
<div class="kuiLocalNavRow kuiLocalNavRow--secondary">
Expand All @@ -17,7 +19,9 @@
<div
class="kuiLocalTab kuiLocalTab-isSelected"
ng-if="!hit"
>Unknown Id</div>
i18n-id="kbn.doc.unknownIdTitle"
i18n-default-message="Unknown Id"
></div>
</div>
</div>
</div>
Expand All @@ -28,14 +32,18 @@
<div class="kuiInfoPanel kuiInfoPanel--error kuiVerticalRhythm">
<div class="kuiInfoPanelHeader">
<span class="kuiInfoPanelHeader__icon kuiIcon kuiIcon--error fa-warning"></span>
<span class="kuiInfoPanelHeader__title">
Failed to locate document
</span>
<span
class="kuiInfoPanelHeader__title"
i18n-id="kbn.doc.failedToLocateDocumentDescription"
i18n-default-message="Failed to locate document"
></span>
</div>
<div class="kuiInfoPanelBody">
<div class="kuiInfoPanelBody__message">
Unfortunately I could not find any documents matching that id, of that type, in that index. I tried really hard. I wanted it to be there. Sometimes I swear documents grow legs and just walk out of the index. Sneaky. I wish I could offer some advice here, something to make you feel better
</div>
<div
class="kuiInfoPanelBody__message"
i18n-id="kbn.doc.couldNotFindDocumentsDescription"
i18n-default-message="Unfortunately I could not find any documents matching that id, of that type, in that index. I tried really hard. I wanted it to be there. Sometimes I swear documents grow legs and just walk out of the index. Sneaky. I wish I could offer some advice here, something to make you feel better"
></div>
</div>
</div>
</div>
Expand All @@ -45,24 +53,30 @@
<div class="kuiInfoPanel kuiInfoPanel--error kuiVerticalRhythm">
<div class="kuiInfoPanelHeader">
<span class="kuiInfoPanelHeader__icon kuiIcon kuiIcon--error fa-warning"></span>
<span class="kuiInfoPanelHeader__title">
Failed to execute query
</span>
<span
class="kuiInfoPanelHeader__title"
i18n-id="kbn.doc.failedToExecuteQueryDescription"
i18n-default-message="Failed to execute query"
></span>
</div>
<div class="kuiInfoPanelBody">
<div class="kuiInfoPanelBody__message">
Oh no. Something went very wrong. Its not just that I couldn't find your document, I couldn't even try. The index was missing, or the type. Go check out Elasticsearch, something isn't quite right here.
</div>
<div
class="kuiInfoPanelBody__message"
i18n-id="kbn.doc.somethingWentWrongDescription"
i18n-default-message="Oh no. Something went very wrong. Its not just that I couldn't find your document, I couldn't even try. The index was missing, or the type. Go check out Elasticsearch, something isn't quite right here."
></div>
</div>
</div>
</div>

<!-- loading -->
<div class="kuiViewContentItem" ng-if="status === undefined">
<div class="kuiPanel kuiPanel--centered">
<div class="kuiTableInfo">
Loading&hellip;
</div>
<div
class="kuiTableInfo"
i18n-id="kbn.doc.loadingDescription"
i18n-default-message="Loading…"
></div>
</div>
</div>

Expand Down