You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Always-prog (via GitHub)" <gi...@apache.org> on 2023/01/24 17:10:09 UTC

[GitHub] [superset] Always-prog commented on a diff in pull request #20078: fix: Fixing the untranslated strings

Always-prog commented on code in PR #20078:
URL: https://github.com/apache/superset/pull/20078#discussion_r1085634140


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx:
##########
@@ -47,7 +48,7 @@ function displayHeaderCell(
       >
         {ArrowIcon}
       </span>
-      <span className="toggle-val">{parseLabel(name)}</span>
+      <span className="toggle-val">{t(parseLabel(name))}</span>

Review Comment:
   Hello @villebro @aehanno!
   We should not translate the results of the parseLabel function, because users can just set the verbose name of the column/metric in the dataset or manual SQL, excluding the string 'metric' that appears in the top left corner.
   ![image](https://user-images.githubusercontent.com/66589759/214359754-b5c1a28c-2084-4f41-a57e-f83cefc62765.png)
   
   To translate that metric, we can just add a translation for the METRIC_KEY constant at superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx:59, and it will work properly.
   Result of translating METRIC_KEY:
   ![image](https://user-images.githubusercontent.com/66589759/214359989-68ed7755-046d-4dfb-b6c6-d5a2793355dc.png)



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org