Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix google picker i18n #5632

Merged
merged 2 commits into from
Jan 31, 2025
Merged

fix google picker i18n #5632

merged 2 commits into from
Jan 31, 2025

Conversation

mifi
Copy link
Contributor

@mifi mifi commented Jan 31, 2025

fixes #5542
fixes #5620

Copy link
Contributor

github-actions bot commented Jan 31, 2025

Diff output files
diff --git a/packages/@uppy/google-drive-picker/lib/GoogleDrivePicker.js b/packages/@uppy/google-drive-picker/lib/GoogleDrivePicker.js
index 4642959..932d353 100644
--- a/packages/@uppy/google-drive-picker/lib/GoogleDrivePicker.js
+++ b/packages/@uppy/google-drive-picker/lib/GoogleDrivePicker.js
@@ -48,6 +48,7 @@ export default class GoogleDrivePicker extends UIPlugin {
         storage: this.storage,
         pickerType: "drive",
         uppy: this.uppy,
+        i18n: this.i18n,
         clientId: this.opts.clientId,
         apiKey: this.opts.apiKey,
         appId: this.opts.appId,
diff --git a/packages/@uppy/google-photos-picker/lib/GooglePhotosPicker.js b/packages/@uppy/google-photos-picker/lib/GooglePhotosPicker.js
index cb91c10..87bd552 100644
--- a/packages/@uppy/google-photos-picker/lib/GooglePhotosPicker.js
+++ b/packages/@uppy/google-photos-picker/lib/GooglePhotosPicker.js
@@ -48,6 +48,7 @@ export default class GooglePhotosPicker extends UIPlugin {
         storage: this.storage,
         pickerType: "photos",
         uppy: this.uppy,
+        i18n: this.i18n,
         clientId: this.opts.clientId,
         onFilesPicked: this.handleFilesPicked,
       });
diff --git a/packages/@uppy/provider-views/lib/GooglePicker/GooglePickerView.js b/packages/@uppy/provider-views/lib/GooglePicker/GooglePickerView.js
index 28c2c49..28c8b1d 100644
--- a/packages/@uppy/provider-views/lib/GooglePicker/GooglePickerView.js
+++ b/packages/@uppy/provider-views/lib/GooglePicker/GooglePickerView.js
@@ -30,6 +30,7 @@ function useStore(store, key) {
 export default function GooglePickerView(_ref) {
   let {
     uppy,
+    i18n,
     clientId,
     onFilesPicked,
     pickerType,
@@ -141,16 +142,14 @@ export default function GooglePickerView(_ref) {
     }
   }, [accessToken, setAccessToken]);
   if (loading) {
-    return h("div", null, uppy.i18n("pleaseWait"), "...");
+    return h("div", null, i18n("pleaseWait"), "...");
   }
   if (accessToken == null) {
     return h(AuthView, {
-      pluginName: pickerType === "drive"
-        ? uppy.i18n("pluginNameGoogleDrivePicker")
-        : uppy.i18n("pluginNameGooglePhotosPicker"),
+      pluginName: pickerType === "drive" ? i18n("pluginNameGoogleDrivePicker") : i18n("pluginNameGooglePhotosPicker"),
       pluginIcon: pickerType === "drive" ? GoogleDriveIcon : GooglePhotosIcon,
       handleAuth: showPicker,
-      i18n: uppy.i18n,
+      i18n: i18n,
       loading: loading,
     });
   }
@@ -170,12 +169,12 @@ export default function GooglePickerView(_ref) {
       },
       disabled: loading,
       onClick: () => showPicker(),
-    }, pickerType === "drive" ? uppy.i18n("pickFiles") : uppy.i18n("pickPhotos")),
+    }, pickerType === "drive" ? i18n("pickFiles") : i18n("pickPhotos")),
     h("button", {
       type: "button",
       className: "uppy-u-reset uppy-c-btn",
       disabled: loading,
       onClick: handleLogoutClick,
-    }, uppy.i18n("logOut")),
+    }, i18n("logOut")),
   );
 }

Copy link
Member

@Murderlon Murderlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find

@mifi mifi merged commit dd555d8 into main Jan 31, 2025
16 checks passed
@mifi mifi deleted the fix-i18n branch January 31, 2025 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants