-
Notifications
You must be signed in to change notification settings - Fork 2k
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
attempt to fix i18n #5619
Conversation
maybe closes #5542
Diff output filesdiff --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, |
There was a problem hiding this 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.
yep i created an issue about fixing that. but yea i don't even know if this is the problem yet 🤷♂️ |
maybe closes #5542