Skip to content

Commit

Permalink
Extract translation strings from the index pattern create page into t…
Browse files Browse the repository at this point in the history
…ranslation file

This commit is where the strings are now localized for this page and therefore will be loaded by
the Angular globalization framework. It also associates a translation ID to each string block and
therefore enables translation of the strings into different languages. It also provides the
pattern for localizing other pages in the UI.
  • Loading branch information
hickeyma committed Mar 6, 2017
1 parent 0ab48f0 commit 959c7ed
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@
<div ng-controller="managementIndicesCreate" class="kbn-management-indices-create">
<div class="page-header">
<h1 translate>KIBANA-H1_CONFIGURE_INDEX_PATTERN</h1>
In order to use Kibana you must configure at least one index pattern. Index patterns are
used to identify the Elasticsearch index to run search and analytics against. They are also
used to configure fields.
<p translate>KIBANA-MUST_CONFIGURE_INDEX_PATTERN</p>
</div>
<div>
<form name="form" role="form" class="well" ng-submit="createIndexPattern()">
<div class="form-group">
<label>
Index name or pattern
</label>
<p class="help-block" ng-if="!index.nameIsPattern">Patterns allow you to define dynamic index names using * as a wildcard. Example: logstash-*</p>
<p class="help-block" ng-if="index.isTimeBased && index.nameIsPattern">Patterns allow you to define dynamic index names. Static text in an index name is denoted using brackets. Example: [logstash-]YYYY.MM.DD. Please note that weeks are setup to use ISO weeks which start on Monday. &mdash;
<small><a target="_blank" href="http://momentjs.com/docs/#/displaying/format/">Date Format Documentation</a></small></p>
<label translate>KIBANA-INDEX_NAME_OR_PATTERN</label>
<p class="help-block" ng-if="!index.nameIsPattern" translate>KIBANA-WILDCARD_DYNAMIC_INDEX_PATTERNS</p>
<p class="help-block" ng-if="index.isTimeBased && index.nameIsPattern"><span translate>KIBANA-STATIC_TEXT_IN_DYNAMIC_INDEX_PATTERNS</span> &mdash;
<small><a target="_blank" href="http://momentjs.com/docs/#/displaying/format/" translate>KIBANA-DATE_FORMAT_DOCS</a></small></p>
<input
ng-model="index.name"
ng-attr-placeholder="{{index.defaultName}}"
Expand All @@ -27,9 +23,9 @@ <h1 translate>KIBANA-H1_CONFIGURE_INDEX_PATTERN</h1>
type="text"
class="form-control">
<small ng-show="index.nameInterval.name == 'weeks'">
<strong>Note: </strong>
I noticed you're using weekly indices. Kibana requires ISO weeks be used in your index creation.
See <a href="https://en.wikipedia.org/wiki/ISO_week_date" target="_blank" title="Wikipedia: ISO Week Date">Wikipedia: ISO Week Date</a>
<strong translate>KIBANA-NOTE_COLON</strong>&nbsp;
<span translate>KIBANA-WEEKLY_ISO_NOTICE</span>
See <a href="https://en.wikipedia.org/wiki/ISO_week_date" target="_blank" title="Wikipedia: ISO Week Date" translate>KIBANA-WIKI_ISO_WEEK_DATE</a>
</small>
</div>

Expand All @@ -38,18 +34,18 @@ <h1 translate>KIBANA-H1_CONFIGURE_INDEX_PATTERN</h1>
<input
ng-model="index.isTimeBased"
type="checkbox">
Index contains time-based events
<span translate>KIBANA-CONTAINS_TIME_BASED_EVENTS_CHECKBOX</span>
</label>
</div>

<div class="form-group" ng-if="index.isTimeBased">
<label>
Time-field name
<span translate>KIBANA-TIME_FIELD_NAME</span>
&nbsp;
<kbn-info info="This field will be used to filter events with the global time filter"></kbn-info>
&nbsp;
<small>
<a ng-click="refreshFieldList();"> refresh fields</a>
<a ng-click="refreshFieldList();" translate>KIBANA-REFRESH_FIELDS</a>
</small>
</label>
<select
Expand All @@ -65,57 +61,36 @@ <h1 translate>KIBANA-H1_CONFIGURE_INDEX_PATTERN</h1>
<div class="form-group" ng-if="canExpandIndices()">
<label>
<input ng-model="index.notExpandable" type="checkbox">
Do not expand index pattern when searching <small>(Not recommended)</small>
<span translate>KIBANA-EXPAND_INDEX_PATTERN_WARNING</span>
</label>

<div ng-if="index.notExpandable" class="alert alert-info">
This index pattern will be queried directly rather than being
expanded into more performant searches against individual indices.
<span translate>KIBANA-NOT_EXPANDABLE_PART1</span>

Elasticsearch will receive a query against <em>{{index.name}}</em>
and will have to search through all matching indices regardless
of whether they have data that matches the current time range.
<span translate="KIBANA-NOT_EXPANDABLE_PART2" translate-values="{ indexName: '{{index.name}}' }"></span>
</div>

<p class="help-block">
By default, searches against any time-based index pattern that
contains a wildcard will automatically be expanded to query only
the indices that contain data within the currently selected time
range.
</p>
<p class="help-block" translate>KIBANA-WILDCARD_DEFAULT_EXPANDED_TO_CURRENT_TIME_RANGE_HELP</p>

<p class="help-block">
Searching against the index pattern <em>logstash-*</em> will
actually query elasticsearch for the specific matching indices
(e.g. <em>logstash-2015.12.21</em>) that fall within the current
time range.
</p>
<p class="help-block" translate>KIBANA-WILDCARD_DEFAULT_EXPANDED_TO_CURRENT_TIME_RANGE_EXAMPLE_HELP</p>
</div>

<div class="form-group time-and-pattern">
<label ng-if="index.isTimeBased">
<input ng-model="index.nameIsPattern" type="checkbox">
Use event times to create index names <small>[DEPRECATED]</small>
<span translate>KIBANA-INDEX_NAME_IS_PATTERN_CHECKBOX</span>
</label>
</div>

<div class="form-group" ng-if="index.isTimeBased && index.nameIsPattern">
<div class="alert alert-warning">
<h4>Time-interval based index patterns are deprecated!</h4>
<p>
We <strong>strongly recommend</strong> using wildcard pattern names instead of
time-interval based index patterns.
</p>
<p>
Kibana is now smart enough to automatically determine which
indices to search against within the current time range for
wildcard index patterns. This means that wildcard
index patterns now get the same performance optimizations when
searching within a time range as time-interval patterns.
</p>
<h4>KIBANA-ALERT_INDEX_PATTERN_DEPRECATED</h4>
<p translate>KIBANA-RECOMMEND_WILD_CARD_PATTERN</p>
<p Ttranslate>KIBANA-RECOMMEND_WILD_CARD_PATTERN_DETAILS</p>
</div>
<label>
Index pattern interval&nbsp;
<span translate>KIBANA-INDEX_PATTERN_INTERVAL</span>&nbsp;
<kbn-info info="The interval at which index names rotate."></kbn-info>
</label>
<select
Expand All @@ -132,17 +107,17 @@ <h4>Time-interval based index patterns are deprecated!</h4>
</div>

<div class="alert alert-info" ng-if="index.samples">
Attempted to match the following indices and aliases:
<span translate>KIBANA-SAMPLE_ALERT</span>
<ul>
<li ng-repeat="sample in index.samples">{{sample}}</li>
</ul>
<button type="button" ng-click="moreSamples(true)" class="btn btn-default">
Expand Search
<span translate>KIBANA-EXPAND_SEARCH</span>
</button>
</div>

<div class="alert alert-{{index.existing.class}}" ng-if="index.existing">
Pattern matches {{index.existing.matchPercent}} of existing indices and aliases
<span translate='KIBANA-EXISTING_MATCH_PERCENT' translate-values="{ indexExistingMatchPercent: '{{index.existing.matchPercent}}' }"></span>
<ul>
<li ng-repeat="match in index.existing.matches | orderBy:'toString()'| limitTo: index.sampleCount">{{match}}</li>
</ul>
Expand All @@ -151,20 +126,20 @@ <h4>Time-interval based index patterns are deprecated!</h4>
ng-click="moreSamples()"
type="button"
class="btn btn-default">
Expand Search
<span translate>KIBANA-EXPAND_SEARCH</span>
</button>
</div>

<div class="alert alert-info" ng-if="index.existing.failures.length">
Indices and aliases that were found, but did not match the pattern:
<span translate>KIBANA-NON_MATCHING_INDICES_AND_ALIASES</span>
<ul>
<li ng-repeat="match in index.existing.failures | limitTo: index.sampleCount">{{match}}</li>
</ul>
<a
ng-if="index.sampleCount < index.existing.matches.length"
ng-click="moreSamples()"
class="alert-link">
more
<span translate>KIBANA-MORE</span>
</a>
</div>
</section>
Expand All @@ -176,7 +151,7 @@ <h4>Time-interval based index patterns are deprecated!</h4>
type="submit"
class="btn">
<span ng-hide="form.name.$error.indexNameInput">{{index.fetchFieldsError || "Create" }}</span>
<span ng-show="form.name.$error.indexNameInput">Invalid index name pattern.</span>
<span ng-show="form.name.$error.indexNameInput" translate>KIBANA-INVALID_INDEX_PATTERN</span>
</button>
</form>
</div>
Expand Down
29 changes: 28 additions & 1 deletion src/core_plugins/kibana/translations/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
{
"UI-WELCOME_MESSAGE": "Loading Kibana",
"UI-WELCOME_ERROR": "Kibana did not load properly. Check the server output for more information.",
"KIBANA-H1_CONFIGURE_INDEX_PATTERN": "Configure an index pattern"
"KIBANA-H1_CONFIGURE_INDEX_PATTERN": "Configure an index pattern",
"KIBANA-MUST_CONFIGURE_INDEX_PATTERN": "In order to use Kibana you must configure at least one index pattern. Index patterns are used to identify the Elasticsearch index to run search and analytics against. They are also used to configure fields.",
"KIBANA-CONTAINS_TIME_BASED_EVENTS_CHECKBOX": "Index contains time-based events",
"KIBANA-INDEX_NAME_IS_PATTERN_CHECKBOX": "Use event times to create index names <small>[DEPRECATED]</small>",
"KIBANA-ALERT_INDEX_PATTERN_DEPRECATED": "Time-interval based index patterns are deprecated!",
"KIBANA-RECOMMEND_WILD_CARD_PATTERN": " We <strong>strongly recommend</strong> using wildcard pattern names instead of time-interval based index patterns.",
"KIBANA-RECOMMEND_WILD_CARD_PATTERN_DETAILS": "Kibana is now smart enough to automatically determine which indices to search against within the current time range for wildcard index patterns. This means that wildcard index patterns now get the same performance optimizations when searching within a time range as time-interval patterns.",
"KIBANA-INDEX_PATTERN_INTERVAL": "Index pattern interval",
"KIBANA-INDEX_NAME_OR_PATTERN": "Index name or pattern",
"KIBANA-WILDCARD_DYNAMIC_INDEX_PATTERNS": "Patterns allow you to define dynamic index names using * as a wildcard. Example: logstash-*",
"KIBANA-STATIC_TEXT_IN_DYNAMIC_INDEX_PATTERNS": "Patterns allow you to define dynamic index names. Static text in an index name is denoted using brackets. Example: [logstash-]YYYY.MM.DD. Please note that weeks are setup to use ISO weeks which start on Monday.",
"KIBANA-NOTE_COLON": "Note:",
"KIBANA-WEEKLY_ISO_NOTICE": "I noticed you are using weekly indices. Kibana requires ISO weeks be used in your index creation.",
"KIBANA-EXPAND_INDEX_PATTERN_WARNING": "Do not expand index pattern when searching <small>(Not recommended)</small>",
"KIBANA-NOT_EXPANDABLE_PART1": "This index pattern will be queried directly rather than being expanded into more performant searches against individual indices.",
"KIBANA-NOT_EXPANDABLE_PART2": "Elasticsearch will receive a query against <em>{{indexName}}</em> and will have to search through all matching indices regardless of whether they have data that matches the current time range.",
"KIBANA-WILDCARD_DEFAULT_EXPANDED_TO_CURRENT_TIME_RANGE_HELP": "By default, searches against any time-based index pattern that contains a wildcard will automatically be expanded to query only the indices that contain data within the currently selected time range.",
"KIBANA-WILDCARD_DEFAULT_EXPANDED_TO_CURRENT_TIME_RANGE_EXAMPLE_HELP": "Searching against the index pattern <em>logstash-*</em> will actually query elasticsearch for the specific matching indices (e.g. <em>logstash-2015.12.21</em>) that fall within the current time range.",
"KIBANA-SAMPLE_ALERT": "Attempted to match the following indices and aliases:",
"KIBANA-EXPAND_SEARCH": "Expand Search",
"KIBANA-EXISTING_MATCH_PERCENT": "Pattern matches {{indexExistingMatchPercent}} of existing indices and aliases",
"KIBANA-NON_MATCHING_INDICES_AND_ALIASES": "Indices and aliases that were found, but did not match the pattern:",
"KIBANA-MORE": "more",
"KIBANA-TIME_FIELD_NAME": "Time-field name",
"KIBANA-REFRESH_FIELDS": "refresh fields",
"KIBANA-INVALID_INDEX_PATTERN": "Invalid index name pattern.",
"KIBANA-DATE_FORMAT_DOCS": "Date Format Documentation",
"KIBANA-WIKI_ISO_WEEK_DATE": "Wikipedia: ISO Week Date"
}
2 changes: 1 addition & 1 deletion webpackShims/ui-bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ define(function (require) {
$translateProvider.useLoader('translationsLoader');
// Enable escaping of HTML
// issue in https://angular-translate.github.io/docs/#/guide/19_security
$translateProvider.useSanitizeValueStrategy('escape');
$translateProvider.useSanitizeValueStrategy('escapeParameters');
}]);

});

0 comments on commit 959c7ed

Please sign in to comment.