Skip to content

Commit

Permalink
DEV: Correct typos and spelling mistakes (discourse#12812)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jsoref authored May 21, 2021
1 parent 6421fab commit 59097b2
Show file tree
Hide file tree
Showing 207 changed files with 315 additions and 315 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -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. -->
Original file line number Diff line number Diff line change
Expand Up @@ -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])?(?:\\))?",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/controllers/topic.js
Original file line number Diff line number Diff line change
Expand Up @@ -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") &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Updates the PWA badging if avaliable
// Updates the PWA badging if available
export default {
name: "badging",
after: "message-bus",
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/lib/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/lib/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/lib/eyeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/lib/hash.js
Original file line number Diff line number Diff line change
@@ -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++) {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/lib/page-tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function startPageTracking(router, appEvents, documentTitle) {
return;
}
router.on("routeDidChange", (transition) => {
// we ocassionally prevent tracking of replaced pages when only query params changed
// we occasionally prevent tracking of replaced pages when only query params changed
// eg: google analytics
const replacedOnlyQueryParams =
transition.urlMethod === "replace" && transition.queryParamsOnly;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/lib/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const SERVER_SIDE_ONLY = [
/^\/styleguide/,
];

// The amount of height (in pixles) that we factor in when jumpEnd is called so
// The amount of height (in pixels) that we factor in when jumpEnd is called so
// that we show a little bit of the post text even on mobile devices instead of
// scrolling to "suggested topics".
const JUMP_END_BUFFER = 250;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/lib/user-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function organizeResults(r, options) {
return results;
}

// all punctuations except for -, _ and . which are allowed in usernames
// all punctuation except for -, _ and . which are allowed in usernames
// note: these are valid in names, but will end up tripping search anyway so just skip
// this means searching for `sam saffron` is OK but if my name is `sam$ saffron` autocomplete
// will not find me, which is a reasonable compromise
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/discourse/app/lib/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,9 @@ const CODE_BLOCKS_REGEX = /^( |\t).*|`[^`]+`|^```[^]*?^```|\[code\][^]*?\[\/c
// | | | |
// | | | code blocks between [code]
// | | |
// | | +--- code blocks between three backquote
// | | +--- code blocks between three backticks
// | |
// | +----- inline code between backquotes
// | +----- inline code between backticks
// |
// +------- paragraphs starting with 4 spaces or tab

Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/lib/webauthn.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function getWebauthnCredential(
timeout: 60000,

// 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",
},
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/models/category.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ Category.reopenClass({

findBySlugPathWithID(slugPathWithID) {
let parts = slugPathWithID.split("/").filter(Boolean);
// slugs found by star/glob pathing in emeber do not automatically url decode - ensure that these are decoded
// slugs found by star/glob pathing in ember do not automatically url decode - ensure that these are decoded
if (this.slugEncoded()) {
parts = parts.map((urlPart) => decodeURI(urlPart));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export default class PostCooked {
valid = href.split("?")[0] === lc.url;
}

// don't display badge counts on category badge & oneboxes (unless when explicitely stated)
// don't display badge counts on category badge & oneboxes (unless when explicitly stated)
if (valid && isValidLink($link)) {
const title = I18n.t("topic_map.clicks", { count: lc.clicks });
$link.append(
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/lib/translation-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TranslationPlugin extends Plugin {

build() {
// We could get fancy eventually and do this based on whether the yaml
// or vendor files change but in practice we should't need exact up to date
// or vendor files change but in practice we shouldn't need exact up to date
// translations in admin.
if (built) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ acceptance("Admin - Badges - Show", function (needs) {

await click("input#badge-icon");
assert.ok(exists(".icon-picker"), "icon picker is becomes visible");
assert.ok(!exists(".image-uploader"), "image uploader bcomes hidden");
assert.ok(!exists(".image-uploader"), "image uploader becomes hidden");
assert.equal(query(".icon-picker").textContent.trim(), "fa-rocket");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ acceptance("Composer", function (needs) {
"![test|690x313, 50%](upload://test.png)",
// 3 No dimensions, should not work
"![test](upload://test.jpeg)",
// 4 Wrapped in backquetes should not work
// 4 Wrapped in backticks should not work
"`![test|690x313](upload://test.png)`",
// 5 html image - should not work
"<img src='/images/avatar.png' wight='20' height='20'>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ acceptance("Group Members - Anonymous", function () {
assert.equal(
queryAll(".group-username-filter").attr("placeholder"),
I18n.t("groups.members.filter_placeholder"),
"it should display the right filter placehodler"
"it should display the right filter placeholder"
);
});
});
Expand Down Expand Up @@ -65,7 +65,7 @@ acceptance("Group Members", function (needs) {
assert.equal(
queryAll(".group-username-filter").attr("placeholder"),
I18n.t("groups.members.filter_placeholder_admin"),
"it should display the right filter placehodler"
"it should display the right filter placeholder"
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default {
{ id: 6680, username: "cdman", avatar_template: "/images/avatar.png" },
{ id: 500, username: "aeid", avatar_template: "/images/avatar.png" },
{ id: 8, username: "geek", avatar_template: "/images/avatar.png" },
{ id: 606, username: "Cafeine", avatar_template: "/images/avatar.png" }
{ id: 606, username: "Caffeine", avatar_template: "/images/avatar.png" }
],
topic_list: {
can_create_topic: false,
Expand Down Expand Up @@ -1272,7 +1272,7 @@ export default {
{ id: 6680, username: "cdman", avatar_template: "/images/avatar.png" },
{ id: 500, username: "aeid", avatar_template: "/images/avatar.png" },
{ id: 8, username: "geek", avatar_template: "/images/avatar.png" },
{ id: 606, username: "Cafeine", avatar_template: "/images/avatar.png" }
{ id: 606, username: "Caffeine", avatar_template: "/images/avatar.png" }
],
topic_list: {
can_create_topic: false,
Expand Down Expand Up @@ -3003,7 +3003,7 @@ export default {
{ id: 3681, username: "Ajarn", avatar_template: "/images/avatar.png" },
{ id: 1621, username: "bnb", avatar_template: "/images/avatar.png" },
{ id: 6266, username: "bragi", avatar_template: "/images/avatar.png" },
{ id: 5335, username: "masda70", avatar_template: "/images/avatar.png" },
{ id: 5335, username: "mazda70", avatar_template: "/images/avatar.png" },
{
id: 6314,
username: "rafaelfranca",
Expand Down Expand Up @@ -4183,7 +4183,7 @@ export default {
{ id: 3681, username: "Ajarn", avatar_template: "/images/avatar.png" },
{ id: 1621, username: "bnb", avatar_template: "/images/avatar.png" },
{ id: 6266, username: "bragi", avatar_template: "/images/avatar.png" },
{ id: 5335, username: "masda70", avatar_template: "/images/avatar.png" },
{ id: 5335, username: "mazda70", avatar_template: "/images/avatar.png" },
{
id: 6314,
username: "rafaelfranca",
Expand Down Expand Up @@ -5255,7 +5255,7 @@ export default {
{ id: 3681, username: "Ajarn", avatar_template: "/images/avatar.png" },
{ id: 1621, username: "bnb", avatar_template: "/images/avatar.png" },
{ id: 6266, username: "bragi", avatar_template: "/images/avatar.png" },
{ id: 5335, username: "masda70", avatar_template: "/images/avatar.png" },
{ id: 5335, username: "mazda70", avatar_template: "/images/avatar.png" },
{
id: 6314,
username: "rafaelfranca",
Expand Down
Loading

0 comments on commit 59097b2

Please sign in to comment.