2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-08-17 18:04:11 +08:00

DEV: Fix random typos (#33839)

July 2025 edition

@discourse-translator-bot keep_translations
This commit is contained in:
Jarek Radosz 2025-07-24 22:04:13 +02:00 committed by GitHub
parent bcc4ef1e6d
commit cfb1ea0c2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 63 additions and 63 deletions

View file

@ -138,7 +138,7 @@ export function _addTransformerName(name, transformerType) {
console.warn(
`${prefix()}: transformer "${name}" matches existing core transformer "${
existingInfo.name
}" and shouldn't be re-registered using the the API.`
}" and shouldn't be re-registered using the API.`
);
return;
}

View file

@ -286,7 +286,7 @@ module("Integration | Component | AsyncContent", function (hooks) {
assert.dom(".empty").doesNotExist();
});
test("it displays the content block if the the empty block is not provided", async function (assert) {
test("it displays the content block if the empty block is not provided", async function (assert) {
const promise = Promise.resolve(null);
await render(

View file

@ -445,7 +445,7 @@ module("Unit | Utility | transformers", function (hooks) {
assert.deepEqual(
[testObject1.value1, testObject2.value1],
[0, 0],
"catches the exception and and keeps processing the queue when there are others transformers registered"
"catches the exception and keeps processing the queue when there are others transformers registered"
);
});
@ -1180,7 +1180,7 @@ module("Unit | Utility | transformers", function (hooks) {
assert.deepEqual(
[testObject1.value, testObject2.value],
[0, 0],
"catches the exception and and keeps processing the queue when there are others transformers registered"
"catches the exception and keeps processing the queue when there are others transformers registered"
);
});

View file

@ -830,9 +830,9 @@ module SiteSettingExtension
# If the theme hasn't overridden any theme site settings (or changed defaults)
# then we will just fall back further down bellow to the current site setting value.
settings_overriden_for_theme = theme_site_settings[scoped_to[:theme_id]]
if settings_overriden_for_theme && settings_overriden_for_theme.key?(clean_name)
return settings_overriden_for_theme[clean_name]
settings_overridden_for_theme = theme_site_settings[scoped_to[:theme_id]]
if settings_overridden_for_theme && settings_overridden_for_theme.key?(clean_name)
return settings_overridden_for_theme[clean_name]
end
end

View file

@ -46,7 +46,7 @@ class TextSentinel
seems_quiet?
end
# Ensure minumum entropy
# Ensure minimum entropy
def seems_meaningful?
@opts[:min_entropy].nil? || entropy >= @opts[:min_entropy]
end

View file

@ -98,7 +98,7 @@ class UrlHelper
# Ideally we will jump straight to `Addressable::URI.normalized_encode`. However,
# that implementation has some edge-case issues like https://github.com/sporkmonger/addressable/issues/472.
# To temporaily work around those issues for the majority of cases, we try parsing with `::URI`.
# To temporarily work around those issues for the majority of cases, we try parsing with `::URI`.
# If that fails (e.g. due to non-ascii characters) then we will fall back to addressable.
# Hopefully we can simplify this back to `Addressable::URI.normalized_encode` in the future.

View file

@ -275,7 +275,7 @@ export default class ChatApi extends Service {
* Creates a message interaction.
* @param {number} channelId - The ID of the channel.
* @param {number} messageId - The ID of the message.
* @param {object} data - Params of the intereaction.
* @param {object} data - Params of the interaction.
* @param {string} data.action_id - The ID of the action.
* @returns {Promise}
*/

View file

@ -45,13 +45,13 @@ RSpec.describe CleanUnusedEmbeddingSearchIndexes do
it "removes all indexes" do
migration.up
remaininig_idxs =
remaining_idxs =
DB.query_single(
"SELECT indexname FROM pg_indexes WHERE indexname IN (:names)",
names: all_idx_names,
)
expect(remaininig_idxs).to be_empty
expect(remaining_idxs).to be_empty
end
end
@ -66,19 +66,19 @@ RSpec.describe CleanUnusedEmbeddingSearchIndexes do
migration.up
remaininig_idxs =
remaining_idxs =
DB.query_single(
"SELECT indexname FROM pg_indexes WHERE indexname IN (:names)",
names: all_idx_names,
)
expect(remaininig_idxs).to contain_exactly(*expected_model_idxs)
expect(remaining_idxs).to contain_exactly(*expected_model_idxs)
# This method checks dimensions are correct.
expect(DiscourseAi::Embeddings::Schema.correctly_indexed?(embedding_def)).to eq(true)
end
end
context "when there is an embedding definition with different dimenstions" do
context "when there is an embedding definition with different dimensions" do
fab!(:embedding_def) { Fabricate(:embedding_definition, id: 2, dimensions: 1536) }
fab!(:embedding_def_2) { Fabricate(:embedding_definition, id: 3, dimensions: 768) }
@ -91,13 +91,13 @@ RSpec.describe CleanUnusedEmbeddingSearchIndexes do
migration.up
remaininig_idxs =
remaining_idxs =
DB.query_single(
"SELECT indexname FROM pg_indexes WHERE indexname IN (:names)",
names: all_idx_names,
)
expect(remaininig_idxs).to contain_exactly(*expected_model_idxs)
expect(remaining_idxs).to contain_exactly(*expected_model_idxs)
# This method checks dimensions are correct.
expect(DiscourseAi::Embeddings::Schema.correctly_indexed?(embedding_def_2)).to eq(true)
end

View file

@ -215,7 +215,7 @@ RSpec.describe DiscourseAi::AiModeration::SpamScanner do
end
end
it "unsilences flagging user if erronuously silenced" do
it "unsilences flagging user if erroneously silenced" do
described_class.flagging_user.update!(silenced_till: 1.day.from_now)
expect(described_class.flagging_user.silenced?).to eq(false)
end
@ -225,7 +225,7 @@ RSpec.describe DiscourseAi::AiModeration::SpamScanner do
expect(described_class.flagging_user.trust_level).to eq(4)
end
it "unsuspends user if it was erronuously suspended" do
it "unsuspends user if it was erroneously suspended" do
described_class.flagging_user.update!(suspended_till: 1.day.from_now, suspended_at: 1.day.ago)
expect(described_class.flagging_user.suspended?).to eq(false)
end

View file

@ -94,7 +94,7 @@ RSpec.describe DiscourseAi::Admin::AiEmbeddingsController do
end
context "with invalid attrs" do
it "doesn't create a new embedding defitinion" do
it "doesn't create a new embedding definition" do
post "/admin/plugins/discourse-ai/ai-embeddings.json",
params: {
ai_embedding: valid_attrs.except(:provider),
@ -151,7 +151,7 @@ RSpec.describe DiscourseAi::Admin::AiEmbeddingsController do
expect(response.status).to eq(404)
end
it "doesn't allow dimenstions to be updated" do
it "doesn't allow dimensions to be updated" do
new_dimensions = 200
put "/admin/plugins/discourse-ai/ai-embeddings/#{embedding_definition.id}.json",
@ -183,7 +183,7 @@ RSpec.describe DiscourseAi::Admin::AiEmbeddingsController do
describe "DELETE #destroy" do
fab!(:embedding_definition)
it "destroys the embedding defitinion" do
it "destroys the embedding definition" do
expect {
delete "/admin/plugins/discourse-ai/ai-embeddings/#{embedding_definition.id}.json"

View file

@ -189,7 +189,7 @@ describe "integration tests" do
expect(assignment.target_id).to eq(new_topic.id)
end
it "assigment is still post assignment when not first post" do
it "assignment is still post assignment when not first post" do
post.update!(topic: new_topic, post_number: "3")
DiscourseEvent.trigger(:post_moved, post, old_topic.id)
assignment.reload

View file

@ -35,7 +35,7 @@ RSpec.describe Jobs::EnqueueReminders do
assert_reminders_enqueued(0)
end
it "enqueues a reminder when the user has one assignement if `pending_assign_reminder_threshold` is set to one" do
it "enqueues a reminder when the user has one assignment if `pending_assign_reminder_threshold` is set to one" do
assign_one_task_to(user)
SiteSetting.pending_assign_reminder_threshold = 1

View file

@ -41,7 +41,7 @@ RSpec.describe Assigner do
)
end
describe "when user watchs topic when assigned" do
describe "when user watches topic when assigned" do
before { moderator.user_option.watch_topic_when_assigned! }
it "respects 'when assigned' user preference" do

View file

@ -23,7 +23,7 @@ RSpec.describe DiscourseChatIntegration::Manager do
describe ".process_command" do
describe "add new rule" do
# Not testing how filters are merged here, that's done in .smart_create_rule
# We just want to make sure the commands are being interpretted correctly
# We just want to make sure the commands are being interpreted correctly
it "should add a new rule correctly" do
response = DiscourseChatIntegration::Helper.process_command(chan1, ["watch", category.slug])
@ -387,7 +387,7 @@ RSpec.describe DiscourseChatIntegration::Manager do
ttl = Discourse.redis.pttl("chat_integration:transcript:#{key}")
# Slight hack since freeze_time doens't work on redis
# Slight hack since freeze_time doesn't work on redis
expect(Discourse.redis.pttl("chat_integration:transcript:#{key}")).to be <= (3601 * 1000)
expect(Discourse.redis.pttl("chat_integration:transcript:#{key}")).to be >= (3599 * 1000)
end

View file

@ -9,8 +9,8 @@ en:
github_permalinks_exclude: "Filename or directory that should be excluded from permalink overwrites. Provide only filename or full path: user/repository/optional-directory/filename"
github_badges_enabled: "Enable GitHub badges"
github_badges_repos: "URLs of the GitHub repos to scan for contributions and commits"
github_silver_badge_min_commits: "Minumum number of commits for silver badge"
github_gold_badge_min_commits: "Minumum number of commits for gold badge"
github_silver_badge_min_commits: "Minimum number of commits for silver badge"
github_gold_badge_min_commits: "Minimum number of commits for gold badge"
errors:
invalid_badge_repo: "You must provide a GitHub URL or the repository name in the format github_user/repository_name"

View file

@ -81,11 +81,11 @@ describe Jobs::ReplaceGithubNonPermalinks do
it "works with multiple github urls in the post" do
stub_request(:get, github_permanent_url).to_return(status: 200, body: "")
stub_request(:get, github_permanent_url2.gsub(/#.+$/, "")).to_return(status: 200, body: "")
post = Fabricate(:post, raw: "#{github_url} #{github_url2} htts://github.com")
post = Fabricate(:post, raw: "#{github_url} #{github_url2} https://github.com")
job.execute(post_id: post.id)
post.reload
updated_post = "#{github_permanent_url} #{github_permanent_url2} htts://github.com"
updated_post = "#{github_permanent_url} #{github_permanent_url2} https://github.com"
expect(post.raw).to eq(updated_post)
end
end

View file

@ -17,13 +17,13 @@ RSpec.describe ::Patreon::Patron do
amount_cents: "0",
},
"4589" => {
title: "Sponsers",
title: "Sponsors",
amount_cents: "1000",
},
}
end
let(:reward_users) { { "0" => %w[111111 111112], "4589" => ["111112"] } }
let(:titles) { { "111111" => "All Patrons", "111112" => "All Patrons, Sponsers" } }
let(:titles) { { "111111" => "All Patrons", "111112" => "All Patrons, Sponsors" } }
before do
Patreon.set("users", patrons)
@ -57,7 +57,7 @@ RSpec.describe ::Patreon::Patron do
end
describe "sync groups" do
let(:ouser) { Fabricate(:patreon_user_info, provider_uid: "111112") }
let(:patreon_user_info) { Fabricate(:patreon_user_info, provider_uid: "111112") }
let(:group1) { Fabricate(:group) }
let(:group2) { Fabricate(:group) }
@ -69,14 +69,14 @@ RSpec.describe ::Patreon::Patron do
it "should sync all Patreon users" do
user = Fabricate(:user, email: "foo@bar.com")
described_class.sync_groups
expect(group1.users.to_a - [ouser.user, user]).to eq([])
expect(group2.users.to_a - [ouser.user]).to eq([])
expect(group1.users.to_a - [patreon_user_info.user, user]).to eq([])
expect(group2.users.to_a - [patreon_user_info.user]).to eq([])
end
it "should sync by Patreon id" do
described_class.sync_groups_by(patreon_id: ouser.provider_uid)
expect(group1.users.to_a).to eq([ouser.user])
expect(group2.users.to_a).to eq([ouser.user])
described_class.sync_groups_by(patreon_id: patreon_user_info.provider_uid)
expect(group1.users.to_a).to eq([patreon_user_info.user])
expect(group2.users.to_a).to eq([patreon_user_info.user])
end
end
end

View file

@ -14,27 +14,27 @@ describe PostVotingCommentSerializer do
context "with a comment user" do
it "returns the right attributes for an anonymous user" do
serializer = described_class.new(comment, scope: Guardian.new)
serilized_comment = serializer.as_json[:post_voting_comment]
serialized_comment = serializer.as_json[:post_voting_comment]
expect(serilized_comment[:id]).to eq(comment.id)
expect(serilized_comment[:created_at]).to eq_time(comment.created_at)
expect(serilized_comment[:post_voting_vote_count]).to eq(1)
expect(serilized_comment[:cooked]).to eq(comment.cooked)
expect(serilized_comment[:name]).to eq(comment.user.name)
expect(serilized_comment[:username]).to eq(comment.user.username)
expect(serialized_comment[:id]).to eq(comment.id)
expect(serialized_comment[:created_at]).to eq_time(comment.created_at)
expect(serialized_comment[:post_voting_vote_count]).to eq(1)
expect(serialized_comment[:cooked]).to eq(comment.cooked)
expect(serialized_comment[:name]).to eq(comment.user.name)
expect(serialized_comment[:username]).to eq(comment.user.username)
end
it "returns the right attributes for logged in user" do
serializer = described_class.new(comment, scope: Guardian.new(post.user))
serilized_comment = serializer.as_json[:post_voting_comment]
serialized_comment = serializer.as_json[:post_voting_comment]
expect(serilized_comment[:id]).to eq(comment.id)
expect(serilized_comment[:created_at]).to eq_time(comment.created_at)
expect(serilized_comment[:post_voting_vote_count]).to eq(1)
expect(serilized_comment[:cooked]).to eq(comment.cooked)
expect(serilized_comment[:name]).to eq(comment.user.name)
expect(serilized_comment[:username]).to eq(comment.user.username)
expect(serilized_comment[:user_voted]).to eq(true)
expect(serialized_comment[:id]).to eq(comment.id)
expect(serialized_comment[:created_at]).to eq_time(comment.created_at)
expect(serialized_comment[:post_voting_vote_count]).to eq(1)
expect(serialized_comment[:cooked]).to eq(comment.cooked)
expect(serialized_comment[:name]).to eq(comment.user.name)
expect(serialized_comment[:username]).to eq(comment.user.username)
expect(serialized_comment[:user_voted]).to eq(true)
end
end
@ -46,11 +46,11 @@ describe PostVotingCommentSerializer do
it "does not fail to serialize" do
serializer = described_class.new(comment, scope: Guardian.new(post.user))
serilized_comment = serializer.as_json[:post_voting_comment]
serialized_comment = serializer.as_json[:post_voting_comment]
expect(serilized_comment[:id]).to eq(comment.id)
expect(serilized_comment[:name]).to be_nil
expect(serilized_comment[:username]).to be_nil
expect(serialized_comment[:id]).to eq(comment.id)
expect(serialized_comment[:name]).to be_nil
expect(serialized_comment[:username]).to be_nil
end
end
end

View file

@ -63,7 +63,7 @@ describe DiscourseSolved::GuardianExtensions do
expect(guardian.can_accept_answer?(topic, post)).to eq(true)
end
it "returns false if the user is trust level 4 but the trust level 4 group is not allowd to accept solutions" do
it "returns false if the user is trust level 4 but the trust level 4 group is not allowed to accept solutions" do
SiteSetting.accept_all_solutions_allowed_groups = Fabricate(:group).id
user.update!(trust_level: TrustLevel[4])
expect(guardian.can_accept_answer?(topic, post)).to eq(false)

View file

@ -1181,7 +1181,7 @@ RSpec.describe UsersController do
context "with an admin api key" do
fab!(:api_key, refind: false) { Fabricate(:api_key, user: admin) }
it "creates the user as active with a an admin key" do
it "creates the user as active with an admin key" do
SiteSetting.send_welcome_message = true
SiteSetting.must_approve_users = true

View file

@ -71,7 +71,7 @@ export default class SidebarNewTopicButton extends Component {
}
@action
getCategoryandTag() {
getCategoryAndTag() {
this.category = this.router.currentRoute.attributes?.category || null;
this.tag = this.router.currentRoute.attributes?.tag || null;
}
@ -96,8 +96,8 @@ export default class SidebarNewTopicButton extends Component {
{{#if this.shouldRender}}
<div
class="sidebar-new-topic-button__wrapper"
{{didInsert this.getCategoryandTag}}
{{didUpdate this.getCategoryandTag this.router.currentRoute}}
{{didInsert this.getCategoryAndTag}}
{{didUpdate this.getCategoryAndTag this.router.currentRoute}}
{{didInsert this.watchForComposer}}
{{willDestroy this.stopWatchingForComposer}}
>