You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/05/16 08:16:19 UTC

[GitHub] [superset] villebro commented on a diff in pull request #20061: fix: Add french translation missing

villebro commented on code in PR #20061:
URL: https://github.com/apache/superset/pull/20061#discussion_r873438792


##########
superset-frontend/src/dashboard/components/SliceAdder.jsx:
##########
@@ -253,7 +254,7 @@ class SliceAdder extends React.Component {
             value={this.state.sortBy}
             onChange={this.handleSelect}
             options={Object.entries(KEYS_TO_SORT).map(([key, label]) => ({
-              label: t('Sort by %s', label),
+              label: t('Sort by %s', t(label)),

Review Comment:
   This doesn't look right; you can't translate variables like this (the original code looks correct)



##########
superset-frontend/src/dashboard/components/dnd/AddSliceDragPreview.jsx:
##########
@@ -72,7 +73,7 @@ function AddSliceDragPreview({ dragItem, slices, isDragging, currentOffset }) {
         transform: `translate(${currentOffset.x}px, ${currentOffset.y}px)`,
       }}
       sliceName={slice.slice_name}
-      lastModified={slice.changed_on_humanized}
+      lastModified={moment.utc(slice.changed_on).fromNow()}

Review Comment:
   same here



##########
superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx:
##########
@@ -314,7 +314,7 @@ export default function DateFilterLabel(props: DateFilterControlProps) {
       <Divider />
       <div>
         <div className="section-title">{t('Actual time range')}</div>
-        {validTimeRange && <div>{evalResponse}</div>}
+        {validTimeRange && <div>{t(evalResponse)}</div>}

Review Comment:
   Again, you can't translate a variable (please see e.g. https://stackoverflow.com/questions/34579316/flask-babel-how-to-translate-variables for an explanation why this is the case)



##########
superset-frontend/src/dashboard/components/SliceAdder.jsx:
##########
@@ -221,7 +222,7 @@ class SliceAdder extends React.Component {
             innerRef={dragSourceRef}
             style={style}
             sliceName={cellData.slice_name}
-            lastModified={cellData.changed_on_humanized}
+            lastModified={moment.utc(cellData.changed_on).fromNow()}

Review Comment:
   This should not be changed (@dpgaspar can comment in more detail, but IIRC, the `changed_on` property needs to be constructed in the backend right now)



##########
superset-frontend/src/views/CRUD/welcome/Welcome.tsx:
##########
@@ -279,7 +279,7 @@ function Welcome({ user, addDangerToast }: WelcomeProps) {
   return (
     <WelcomeContainer>
       <WelcomeNav>
-        <h1 className="welcome-header">Home</h1>
+        <h1 className="welcome-header">{t('Home')}</h1>

Review Comment:
   Thanks for catching this!



-- 
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