EnxDev commented on code in PR #45172:
URL: https://github.com/apache/superset/pull/45172#discussion_r4329624555


##########
superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts:
##########
@@ -919,7 +921,13 @@ export function getLegendProps(
         }
       : {}),
     selected: legendState ?? {},
-    selector: ['all', 'inverse'],
+    // `selector: false` omits the All/Inv group from legend layout.
+    selector: showSelectorLegend
+      ? [
+          { type: 'all', title: t('All') },
+          { type: 'inverse', title: t('Inv') },
+        ]
+      : false,

Review Comment:
   Passing an explicit `title` skips ECharts' own locale. With the `'all'` / 
`'inverse'` shorthand, `LegendModel` reads the labels from the locale 
`Echart.tsx` registers, so French users got "Tout / Inverse" and Chinese users 
got "全选 / 反选". `Inv` is a new msgid with no translations, so every non-English 
locale will show the English "Inv" after this.
   
   Keeping the shorthand hides the buttons just the same:
   
   ```suggestion
       selector: showSelectorLegend ? ['all', 'inverse'] : false,
   ```
   
   The `t` import, the `Inv` entry in `messages.pot`, and the object-form 
expectations in `series.test.ts` and the Gantt test can then go back to how 
they were.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to