Skip to content

Commit 2fda3a1

Browse files
authored
Merge pull request #52635 from tengqm/fg-shortcode
Revise the rendering of feature state
2 parents dbcef5f + 2231ff0 commit 2fda3a1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

i18n/en/en.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,10 @@ other = "Error"
174174
other = "Examples"
175175

176176
[feature_gate_enabled]
177-
other = "(enabled by default: {{ .enabled }})"
177+
other = "(enabled by default)"
178+
179+
[feature_gate_disabled]
180+
other = "(disabled by default)"
178181

179182
[feature_gate_stage_alpha]
180183
other = "Alpha"

layouts/shortcodes/feature-state.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@
3434

3535
<div class="feature-state-notice feature-{{ .stage }}" title="{{ printf "%s %s" (T "feature_state_feature_gate_tooltip") $feature_gate_name }}">
3636
<span class="feature-state-name">{{ T "feature_state" }}</span>
37-
<code>{{ T "feature_state_kubernetes_label" }} v{{ .fromVersion }} [{{ .stage }}]</code> {{ T "feature_gate_enabled" (dict "enabled" .defaultValue) }}
37+
<code>{{ T "feature_state_kubernetes_label" }} v{{ .fromVersion }} [{{ .stage }}]</code>
38+
{{- if eq .defaultValue true -}}
39+
{{ T "feature_gate_enabled" }}
40+
{{- else -}}
41+
{{ T "feature_gate_disabled" }}
42+
{{- end -}}
3843
</div>
3944

4045
{{- $featureGateFound = true -}}

0 commit comments

Comments
 (0)