for (DashboardDto dashboard : dashboards) {
json.beginObject()
.prop("key", dashboard.getId())
- .prop("name", i18n.message(locale, String.format("dashboard.%s.name", dashboard.getName()), dashboard.getName()))
+ .prop("name", dashboard.getName())
.endObject();
}
json.endArray();
<li class="dropdown-header">{{t 'layout.dashboards'}}</li>
{{#withoutFirst component.dashboards}}
<li>
- <a href="{{componentDashboardPermalink ../component.key key}}">{{name}}</a>
+ <a href="{{componentDashboardPermalink ../component.key key}}">{{dashboardL10n name}}</a>
</li>
{{/withoutFirst}}
{{#if canManageContextDashboards}}
<ul class="dropdown-menu">
{{#each globalDashboards}}
<li>
- <a href="{{link '/dashboard/index?did=' key}}">{{name}}</a>
+ <a href="{{link '/dashboard/index?did=' key}}">{{dashboardL10n name}}</a>
</li>
{{/each}}
{{#if canManageGlobalDashboards}}
return window.formatMeasureVariation(measure, type);
});
+ Handlebars.registerHelper('dashboardL10n', function (dashboardName) {
+ var l10nKey = 'dashboard.' + dashboardName + '.name';
+ var l10nLabel = window.t(l10nKey);
+ if (l10nLabel !== l10nKey) {
+ return l10nLabel;
+ } else {
+ return dashboardName;
+ }
+ });
+
})();