-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Translate Gauge and Goal #23882
Translate Gauge and Goal #23882
Conversation
💔 Build Failed |
@tibmt add 'kbnVislibVisTypes' to .i18nrc.json for CI to pass CI validation |
@@ -171,17 +205,25 @@ | |||
<div class="hintbox" ng-show="!editorState.params.gauge.colorsRange.length"> | |||
<p> | |||
<i class="fa fa-danger text-danger"></i> | |||
<strong>Required:</strong> You must specify at least one range. | |||
<span | |||
i18n-id="kbnVislibVisTypes.controls.gaugeOptions.requiredTitle" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requiredTitle => specifiedRangeNumberWarningMessage
<strong>Required:</strong> You must specify at least one range. | ||
<span | ||
i18n-id="kbnVislibVisTypes.controls.gaugeOptions.requiredTitle" | ||
i18n-default-message="<strong>Required:</strong> You must specify at least one range." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use i18n-values for nested tags
Add Range | ||
</div> | ||
class="kuiButton kuiButton--primary kuiButton--fullWidth" | ||
i18n-id="kbnVislibVisTypes.controls.gaugeOptions.addRangeButton" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like it is title, not button, so addRangeButton => addRangeTitle
<div class="text text-center text-info">Note: colors can be changed in the legend</div> | ||
<div | ||
class="text text-center text-info" | ||
i18n-id="kbnVislibVisTypes.controls.gaugeOptions.noteTitle" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noteTitle => howToChangeColorsDescription
@@ -103,7 +104,7 @@ export default function GaugeVisType(Private) { | |||
{ | |||
group: 'buckets', | |||
name: 'group', | |||
title: 'Split Group', | |||
title: i18n('kbnVislibVisTypes.gauge.splitGroupTitle', { defaultMessage: 'Split Group' }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
splitGroupTitle => groupTitle
@@ -98,7 +100,7 @@ export default function GoalVisType(Private) { | |||
{ | |||
group: 'buckets', | |||
name: 'group', | |||
title: 'Split Group', | |||
title: i18n('kbnVislibVisTypes.goal.splitGroupTitle', { defaultMessage: 'Split Group' }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
splitGroupTitle => groupTitle
💔 Build Failed |
💔 Build Failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
💔 Build Failed |
retest |
💚 Build Succeeded |
for="showScale" | ||
i18n-id="kbnVislibVisTypes.controls.gaugeOptions.fontSizeLabel" | ||
i18n-default-message="Font Size ({fontSizeSpan}pt)" | ||
i18n-values="{ fontSizeSpan: '<span ng-bind=\'editorState.params.gauge.style.fontSize\'></span>' }" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong. This should rather just inject editorState.params.gauge.style.fontSize
as a parameter and not that weird span
ng-bind construct.
Also please rename the parameter name to fontSize
, we should not keep element names (especially if they are not semantic elements at all) in the parameter name.
@@ -107,6 +107,10 @@ module.directive('gaugeOptions', function () { | |||
$scope.customColors = true; | |||
}); | |||
|
|||
$scope.editorState.requiredText = i18n('kbnVislibVisTypes.params.gauge.requiredText', { | |||
defaultMessage: 'Requred:' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required
@@ -107,6 +107,10 @@ module.directive('gaugeOptions', function () { | |||
$scope.customColors = true; | |||
}); | |||
|
|||
$scope.editorState.requiredText = i18n('kbnVislibVisTypes.params.gauge.requiredText', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't set that value on the editorState
, but use the $scope
directly. A translated string is NOT part of the editor state.
description: `Gauges indicate the status of a metric. Use it to show how a metric's value relates | ||
to reference threshold values.`, | ||
description: i18n('kbnVislibVisTypes.gauge.gaugeDescription', { | ||
defaultMessage: 'Gauges indicate the status of a metric. Use it to show how a metric\'s value relatesto reference threshold values.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To prevent the need of escaping the single quote, please just use a backtick string here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timroes there will be error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a heads up that there's a missing space here between relatesto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lukeelmers fix it, thanks
update Gauge(not Heatmap) component |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
retest |
💔 Build Failed |
Now we cannot use backtick string or double quote. We will change it when it will be possible |
💚 Build Succeeded |
* Translate Gauge and Goal * fix some names, rewrite some code and add 'kbnVislibVisTypes' to '.i18nrc.json' * add 'Required' translation * fix 'requiredText' bug * use \' instead of " * update heatmap component * Update gauge.js * Update gauge.js * Update gauge.js
* Translate Gauge and Goal * fix some names, rewrite some code and add 'kbnVislibVisTypes' to '.i18nrc.json' * add 'Required' translation * fix 'requiredText' bug * use \' instead of " * update heatmap component * Update gauge.js * Update gauge.js * Update gauge.js
Translation of Gauge and Goal visualization components