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

attempt to fix i18n #5619

Merged
merged 1 commit into from
Jan 23, 2025
Merged

attempt to fix i18n #5619

merged 1 commit into from
Jan 23, 2025

Conversation

mifi
Copy link
Contributor

@mifi mifi commented Jan 23, 2025

maybe closes #5542

Copy link
Contributor

Diff output files
diff --git a/packages/@uppy/google-drive-picker/lib/GoogleDrivePicker.js b/packages/@uppy/google-drive-picker/lib/GoogleDrivePicker.js
index f533a27..4642959 100644
--- a/packages/@uppy/google-drive-picker/lib/GoogleDrivePicker.js
+++ b/packages/@uppy/google-drive-picker/lib/GoogleDrivePicker.js
@@ -57,7 +57,7 @@ export default class GoogleDrivePicker extends UIPlugin {
     this.storage = this.opts.storage || tokenStorage;
     this.defaultLocale = locale;
     this.i18nInit();
-    this.title = this.i18n("pluginNameGoogleDrive");
+    this.title = this.i18n("pluginNameGoogleDrivePicker");
     const client = new RequestClient(uppy, {
       pluginId: this.id,
       provider: "url",
diff --git a/packages/@uppy/google-drive-picker/lib/locale.js b/packages/@uppy/google-drive-picker/lib/locale.js
index b345088..c068ab8 100644
--- a/packages/@uppy/google-drive-picker/lib/locale.js
+++ b/packages/@uppy/google-drive-picker/lib/locale.js
@@ -1,5 +1,5 @@
 export default {
   strings: {
-    pluginNameGoogleDrive: "Google Drive",
+    pluginNameGoogleDrivePicker: "Google Drive",
   },
 };
diff --git a/packages/@uppy/google-photos-picker/lib/GooglePhotosPicker.js b/packages/@uppy/google-photos-picker/lib/GooglePhotosPicker.js
index 2406fad..cb91c10 100644
--- a/packages/@uppy/google-photos-picker/lib/GooglePhotosPicker.js
+++ b/packages/@uppy/google-photos-picker/lib/GooglePhotosPicker.js
@@ -55,7 +55,7 @@ export default class GooglePhotosPicker extends UIPlugin {
     this.storage = this.opts.storage || tokenStorage;
     this.defaultLocale = locale;
     this.i18nInit();
-    this.title = this.i18n("pluginNameGooglePhotos");
+    this.title = this.i18n("pluginNameGooglePhotosPicker");
     const client = new RequestClient(uppy, {
       pluginId: this.id,
       provider: "url",
diff --git a/packages/@uppy/google-photos-picker/lib/locale.js b/packages/@uppy/google-photos-picker/lib/locale.js
index fec03f5..14f79b9 100644
--- a/packages/@uppy/google-photos-picker/lib/locale.js
+++ b/packages/@uppy/google-photos-picker/lib/locale.js
@@ -1,5 +1,5 @@
 export default {
   strings: {
-    pluginNameGooglePhotos: "Google Photos",
+    pluginNameGooglePhotosPicker: "Google Photos",
   },
 };
diff --git a/packages/@uppy/locales/lib/en_US.js b/packages/@uppy/locales/lib/en_US.js
index e35a04f..52e717d 100644
--- a/packages/@uppy/locales/lib/en_US.js
+++ b/packages/@uppy/locales/lib/en_US.js
@@ -129,6 +129,8 @@ en_US.strings = {
   pluginNameFacebook: "Facebook",
   pluginNameGoogleDrive: "Google Drive",
   pluginNameGooglePhotos: "Google Photos",
+  pluginNameGoogleDrivePicker: "Google Drive",
+  pluginNameGooglePhotosPicker: "Google Photos",
   pluginNameInstagram: "Instagram",
   pluginNameOneDrive: "OneDrive",
   pluginNameScreenCapture: "Screencast",
diff --git a/packages/@uppy/provider-views/lib/GooglePicker/GooglePickerView.js b/packages/@uppy/provider-views/lib/GooglePicker/GooglePickerView.js
index acaee1e..28c2c49 100644
--- a/packages/@uppy/provider-views/lib/GooglePicker/GooglePickerView.js
+++ b/packages/@uppy/provider-views/lib/GooglePicker/GooglePickerView.js
@@ -145,7 +145,9 @@ export default function GooglePickerView(_ref) {
   }
   if (accessToken == null) {
     return h(AuthView, {
-      pluginName: pickerType === "drive" ? uppy.i18n("pluginNameGoogleDrive") : uppy.i18n("pluginNameGooglePhotos"),
+      pluginName: pickerType === "drive"
+        ? uppy.i18n("pluginNameGoogleDrivePicker")
+        : uppy.i18n("pluginNameGooglePhotosPicker"),
       pluginIcon: pickerType === "drive" ? GoogleDriveIcon : GooglePhotosIcon,
       handleAuth: showPicker,
       i18n: uppy.i18n,

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.

I suppose in this case it's fine but not being to reuse a translated string seems like a major flaw in a i18n implementation. Endless duplication is not the way forward but for this case let's see if it works.

@mifi
Copy link
Contributor Author

mifi commented Jan 23, 2025

yep i created an issue about fixing that. but yea i don't even know if this is the problem yet 🤷‍♂️

@mifi mifi merged commit aee5e12 into main Jan 23, 2025
15 of 16 checks passed
@mifi mifi deleted the attempt-to-fix-i18n branch January 23, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: missing string: pluginNameGoogleDrive + pluginNameGooglePhotos
2 participants