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

Use title consistently from locales #5134

Merged
merged 6 commits into from
May 8, 2024
Merged

Use title consistently from locales #5134

merged 6 commits into from
May 8, 2024

Conversation

Murderlon
Copy link
Member

Closes #5018

@Murderlon Murderlon requested a review from aduh95 May 2, 2024 13:18
@Murderlon Murderlon self-assigned this May 2, 2024
Copy link
Contributor

github-actions bot commented May 2, 2024

Diff output files
diff --git a/packages/@uppy/dropbox/lib/Dropbox.js b/packages/@uppy/dropbox/lib/Dropbox.js
index a4afcd2..0dc6fc3 100644
--- a/packages/@uppy/dropbox/lib/Dropbox.js
+++ b/packages/@uppy/dropbox/lib/Dropbox.js
@@ -42,7 +42,7 @@ export default class Dropbox extends UIPlugin {
     });
     this.defaultLocale = locale;
     this.i18nInit();
-    this.title = this.opts.title || this.i18n("pluginNameDropbox");
+    this.title = this.i18n("pluginNameDropbox");
     this.onFirstRender = this.onFirstRender.bind(this);
     this.render = this.render.bind(this);
   }
diff --git a/packages/@uppy/screen-capture/lib/ScreenCapture.js b/packages/@uppy/screen-capture/lib/ScreenCapture.js
index f2e4146..a491154 100644
--- a/packages/@uppy/screen-capture/lib/ScreenCapture.js
+++ b/packages/@uppy/screen-capture/lib/ScreenCapture.js
@@ -52,11 +52,11 @@ export default class ScreenCapture extends UIPlugin {
     this.mediaDevices = getMediaDevices();
     this.protocol = location.protocol === "https:" ? "https" : "http";
     this.id = this.opts.id || "ScreenCapture";
-    this.title = this.opts.title || "Screencast";
     this.type = "acquirer";
     this.icon = ScreenRecIcon;
     this.defaultLocale = locale;
     this.i18nInit();
+    this.title = this.i18n("pluginNameScreenCapture");
     this.install = this.install.bind(this);
     this.setPluginState = this.setPluginState.bind(this);
     this.render = this.render.bind(this);
diff --git a/packages/@uppy/screen-capture/lib/locale.js b/packages/@uppy/screen-capture/lib/locale.js
index 67781c6..3d42e1e 100644
--- a/packages/@uppy/screen-capture/lib/locale.js
+++ b/packages/@uppy/screen-capture/lib/locale.js
@@ -1,5 +1,6 @@
 export default {
   strings: {
+    pluginNameScreenCapture: "Screencast",
     startCapturing: "Begin screen capturing",
     stopCapturing: "Stop screen capturing",
     submitRecordedFile: "Submit recorded file",
diff --git a/packages/@uppy/unsplash/lib/Unsplash.js b/packages/@uppy/unsplash/lib/Unsplash.js
index 9a4f674..80bad02 100644
--- a/packages/@uppy/unsplash/lib/Unsplash.js
+++ b/packages/@uppy/unsplash/lib/Unsplash.js
@@ -2,6 +2,7 @@ import { getAllowedHosts, SearchProvider, tokenStorage } from "@uppy/companion-c
 import { UIPlugin } from "@uppy/core";
 import { SearchProviderViews } from "@uppy/provider-views";
 import { h } from "preact";
+import locale from "./locale.js";
 const packageJson = {
   "version": "4.0.0-beta.5",
 };
@@ -12,7 +13,9 @@ export default class Unsplash extends UIPlugin {
     this.files = [];
     this.storage = this.opts.storage || tokenStorage;
     this.id = this.opts.id || "Unsplash";
-    this.title = this.opts.title || "Unsplash";
+    this.defaultLocale = locale;
+    this.i18nInit();
+    this.title = this.i18n("pluginNameUnsplash");
     this.icon = () =>
       h(
         "svg",
diff --git a/packages/@uppy/url/lib/Url.js b/packages/@uppy/url/lib/Url.js
index d08f9ff..6cf994c 100644
--- a/packages/@uppy/url/lib/Url.js
+++ b/packages/@uppy/url/lib/Url.js
@@ -129,11 +129,11 @@ export default class Url extends UIPlugin {
       });
     };
     this.id = this.opts.id || "Url";
-    this.title = this.opts.title || "Link";
     this.type = "acquirer";
     this.icon = () => h(UrlIcon, null);
     this.defaultLocale = locale;
     this.i18nInit();
+    this.title = this.i18n("pluginNameUrl");
     this.hostname = this.opts.companionUrl;
     if (!this.hostname) {
       throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");
diff --git a/packages/@uppy/url/lib/locale.js b/packages/@uppy/url/lib/locale.js
index dcad1af..325367f 100644
--- a/packages/@uppy/url/lib/locale.js
+++ b/packages/@uppy/url/lib/locale.js
@@ -1,5 +1,6 @@
 export default {
   strings: {
+    pluginNameUrl: "Link",
     import: "Import",
     enterUrlToImport: "Enter URL to import a file",
     failedToFetch: "Companion failed to fetch this URL, please make sure it’s correct",

@aduh95
Copy link
Member

aduh95 commented May 7, 2024

Shouldn't we remove title from the list of options in the types as well?

@aduh95
Copy link
Member

aduh95 commented May 8, 2024

We still have

@Murderlon Murderlon merged commit 1634263 into 4.x May 8, 2024
17 checks passed
@Murderlon Murderlon deleted the consistent-title branch May 8, 2024 10:54
github-actions bot added a commit that referenced this pull request May 14, 2024
| Package                |      Version | Package                |      Version |
| ---------------------- | ------------ | ---------------------- | ------------ |
| @uppy/companion        | 5.0.0-beta.6 | @uppy/status-bar       | 4.0.0-beta.7 |
| @uppy/companion-client | 4.0.0-beta.6 | @uppy/unsplash         | 4.0.0-beta.6 |
| @uppy/compressor       | 2.0.0-beta.7 | @uppy/url              | 4.0.0-beta.6 |
| @uppy/core             | 4.0.0-beta.7 | @uppy/utils            | 6.0.0-beta.6 |
| @uppy/dashboard        | 4.0.0-beta.7 | @uppy/webcam           | 4.0.0-beta.6 |
| @uppy/dropbox          | 4.0.0-beta.6 | @uppy/xhr-upload       | 4.0.0-beta.4 |
| @uppy/image-editor     | 3.0.0-beta.4 | uppy                   | 4.0.0-beta.7 |
| @uppy/screen-capture   | 4.0.0-beta.5 |                        |              |

- @uppy/companion: switch from `node-redis` to `ioredis` (Dominik Schmidt / #4623)
- meta: Fix headings in xhr.mdx (Merlijn Vos)
- @uppy/xhr-upload: introduce hooks similar to tus (Merlijn Vos / #5094)
- @uppy/core: close->destroy, clearUploadedFiles->clear (Merlijn Vos / #5154)
- @uppy/companion-client,@uppy/dropbox,@uppy/screen-capture,@uppy/unsplash,@uppy/url,@uppy/webcam: Use `title` consistently from locales (Merlijn Vos / #5134)




| Package            | Version | Package            | Version |
| ------------------ | ------- | ------------------ | ------- |
| @uppy/core         |  3.11.3 | uppy               |  3.25.3 |
| @uppy/image-editor |   2.4.6 |                    |         |

- @uppy/image-editor: fix tooltips (Avneet Singh Malhotra / #5156)
- meta: Remove redundant `plugins` prop from examples (Merlijn Vos / #5145)
- @uppy/image-editor: Remove `target` option from examples and document consistently (Merlijn Vos / #5146)
- @uppy/core: make getObjectOfFilesPerState more efficient (Merlijn Vos / #5155)
Murderlon added a commit that referenced this pull request May 21, 2024
* 4.x: (24 commits)
  @uppy/companion: encode `uploadId` (#5168)
  @uppy/companion: bump `express-session` (#5177)
  @uppy/companion: remove dependency on `express-request-id` (#5176)
  @uppy/companion: bump prom to v15 (#5175)
  docs: fix linter
  meta: remove `nodemon` from the deps (#5172)
  docs: update `@uppy/aws-s3` docs (#5093)
  meta: update more dependencies (#5171)
  @uppy/companion: upgrade deps (#5119)
  Release: uppy@4.0.0-beta.7 (#5162)
  @uppy/companion: switch from `node-redis` to `ioredis` (#4623)
  Fix headings in xhr.mdx
  @uppy/xhr-upload: introduce hooks similar to tus (#5094)
  @uppy/core: close->destroy, clearUploadedFiles->clear (#5154)
  Use `title` consistently from locales (#5134)
  Release: uppy@4.0.0-beta.6 (#5152)
  Release: uppy@4.0.0-beta.5 (#5141)
  meta: run Prettier in the release workflow
  Release: uppy@3.25.1 (#5139)
  Bump ejs from 3.1.9 to 3.1.10 (#5135)
  ...
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.

None yet

2 participants