DEV: Correct typos and spelling mistakes (#12812)

DEV: Correct typos and spelling mistakes (#12812)

Over the years we accrued many spelling mistakes in the code base.

This PR attempts to fix spelling mistakes and typos in all areas of the code that are extremely safe to change

  • comments
  • test descriptions
  • other low risk areas
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index ba13bf1..536a268 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -1 +1 @@
-<!-- NOTE: All pull requests should have tests (rspec in Ruby, qunit in Javascript). If your code does not include test coverage, please include an explanation of why it was omitted. -->
+<!-- NOTE: All pull requests should have tests (rspec in Ruby, qunit in JavaScript). If your code does not include test coverage, please include an explanation of why it was omitted. -->
diff --git a/app/assets/javascripts/discourse/app/components/composer-editor.js b/app/assets/javascripts/discourse/app/components/composer-editor.js
index c1be68e..124cf21 100644
--- a/app/assets/javascripts/discourse/app/components/composer-editor.js
+++ b/app/assets/javascripts/discourse/app/components/composer-editor.js
@@ -288,7 +288,7 @@ export default Component.extend({
 
     // when adding two separate files with the same filename search for matching
     // placeholder already existing in the editor ie [Uploading: test.png...]
-    // and add order nr to the next one: [Uplodading: test.png(1)...]
+    // and add order nr to the next one: [Uploading: test.png(1)...]
     const escapedFilename = filename.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
     const regexString = `\\[${I18n.t("uploading_filename", {
       filename: escapedFilename + "(?:\\()?([0-9])?(?:\\))?",
diff --git a/app/assets/javascripts/discourse/app/controllers/create-account.js b/app/assets/javascripts/discourse/app/controllers/create-account.js
index 6dc0fa3..57b41f4 100644
--- a/app/assets/javascripts/discourse/app/controllers/create-account.js
+++ b/app/assets/javascripts/discourse/app/controllers/create-account.js
@@ -268,7 +268,7 @@ export default Controller.extend(
         (isEmpty(this.accountUsername) || this.get("authOptions.email"))
       ) {
         // If email is valid and username has not been entered yet,
-        // or email and username were filled automatically by 3rd parth auth,
+        // or email and username were filled automatically by 3rd party auth,
         // then look for a registered username that matches the email.
         discourseDebounce(this, this.fetchExistingUsername, 500);
       }
diff --git a/app/assets/javascripts/discourse/app/controllers/second-factor-add-security-key.js b/app/assets/javascripts/discourse/app/controllers/second-factor-add-security-key.js
index d6b48db..48839d0 100644
--- a/app/assets/javascripts/discourse/app/controllers/second-factor-add-security-key.js
+++ b/app/assets/javascripts/discourse/app/controllers/second-factor-add-security-key.js
@@ -87,7 +87,7 @@ export default Controller.extend(ModalFunctionality, {
         attestation: "none",
         authenticatorSelection: {
           // see https://chromium.googlesource.com/chromium/src/+/master/content/browser/webauth/uv_preferred.md for why
-          // default value of preferred is not necesarrily what we want, it limits webauthn to only devices that support
+          // default value of preferred is not necessarily what we want, it limits webauthn to only devices that support
           // user verification, which usually requires entering a PIN
           userVerification: "discouraged",
         },
diff --git a/app/assets/javascripts/discourse/app/controllers/topic.js b/app/assets/javascripts/discourse/app/controllers/topic.js
index fcadfa4..6699af2 100644
--- a/app/assets/javascripts/discourse/app/controllers/topic.js
+++ b/app/assets/javascripts/discourse/app/controllers/topic.js
@@ -1606,7 +1606,7 @@ export default Controller.extend(bufferedProperty("model"), {
         }
 
         // scroll to bottom is very specific to new posts from discobot
-        // hence the -2 check (dicobot id). We can shift all this code
+        // hence the -2 check (discobot id). We can shift all this code
         // to discobot plugin longer term
         if (
           topic.get("isPrivateMessage") &&
diff --git a/app/assets/javascripts/discourse/app/helpers/user-avatar.js b/app/assets/javascripts/discourse/app/helpers/user-avatar.js
index 20af1a2..e0893b1 100644
--- a/app/assets/javascripts/discourse/app/helpers/user-avatar.js
+++ b/app/assets/javascripts/discourse/app/helpers/user-avatar.js
@@ -59,7 +59,7 @@ function renderAvatar(user, options) {
         const description = get(user, "description");
         // if a description has been provided
         if (description && description.length > 0) {
-          // preprend the username before the description
+          // prepend the username before the description
           title = I18n.t("user.avatar.name_and_description", {
             name: displayName,
             description,
diff --git a/app/assets/javascripts/discourse/app/initializers/badging.js b/app/assets/javascripts/discourse/app/initializers/badging.js
index f5a73b6..73c90b0 100644
--- a/app/assets/javascripts/discourse/app/initializers/badging.js
+++ b/app/assets/javascripts/discourse/app/initializers/badging.js
@@ -1,4 +1,4 @@
-// Updates the PWA badging if avaliable
+// Updates the PWA badging if available
 export default {
   name: "badging",
   after: "message-bus",
diff --git a/app/assets/javascripts/discourse/app/lib/ajax.js b/app/assets/javascripts/discourse/app/lib/ajax.js
index 36330ca..b7be9db 100644
--- a/app/assets/javascripts/discourse/app/lib/ajax.js
+++ b/app/assets/javascripts/discourse/app/lib/ajax.js
@@ -128,7 +128,7 @@ export function ajax() {
         Session.current().set("csrfToken", null);
       }
 
-      // If it's a parsererror, don't reject
+      // If it's a parser error, don't reject
       if (xhr.status === 200) {
         return args.success(xhr);
       }
diff --git a/app/assets/javascripts/discourse/app/lib/autocomplete.js b/app/assets/javascripts/discourse/app/lib/autocomplete.js
index d95cc46..99b7740 100644
--- a/app/assets/javascripts/discourse/app/lib/autocomplete.js
+++ b/app/assets/javascripts/discourse/app/lib/autocomplete.js
@@ -99,7 +99,7 @@ export default function (options) {
   let div = null;
   let prevTerm = null;
 
-  // By default, when the autcomplete popup is rendered it has the
+  // By default, when the autocomplete popup is rendered it has the
   // first suggestion 'selected', and pressing enter key inserts
   // the first suggestion into the input box.
   // If you want to stop that behavior, i.e. have the popup renders
diff --git a/app/assets/javascripts/discourse/app/lib/eyeline.js b/app/assets/javascripts/discourse/app/lib/eyeline.js
index f7f3188..f2ca4a8 100644
--- a/app/assets/javascripts/discourse/app/lib/eyeline.js
+++ b/app/assets/javascripts/discourse/app/lib/eyeline.js
@@ -67,7 +67,7 @@ Eyeline.prototype.update = function () {
     }
 
     // It's seen if...
-    // ...the element is vertically within the top and botom
+    // ...the element is vertically within the top and bottom
     if (elemTop <= docViewBottom && elemTop >= docViewTop) {
       markSeen = true;
     }
diff --git a/app/assets/javascripts/discourse/app/lib/hash.js b/app/assets/javascripts/discourse/app/lib/hash.js
index 7139627..a4fd849 100644
--- a/app/assets/javascripts/discourse/app/lib/hash.js
+++ b/app/assets/javascripts/discourse/app/lib/hash.js
@@ -1,6 +1,6 @@
 /*eslint no-bitwise:0 */
 
-// Note: before changing this be aware the same algo is used server side for avatars.
+// Note: before changing this be aware the same algorithm is used server side for avatars.
 export function hashString(str) {
   let hash = 0;
   for (let i = 0; i < str.length; i++) {
diff --git a/app/assets/javascripts/discourse/app/lib/page-tracker.js b/app/assets/javascripts/discourse/app/lib/page-tracker.js
index be74113..76a937f 100644
--- a/app/assets/javascripts/discourse/app/lib/page-tracker.js
+++ b/app/assets/javascripts/discourse/app/lib/page-tracker.js
@@ -23,7 +23,7 @@ export function startPageTracking(router, appEvents, documentTitle) {

[... diff too long, it was truncated ...]

GitHub sha: 59097b20

This commit appears in #12812 which was approved by SamSaffron. It was merged by SamSaffron.