mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Fix typos (#2210)
This commit is contained in:
parent
fa9ab5ee3f
commit
5551a37f03
33 changed files with 44 additions and 43 deletions
|
@ -106,6 +106,7 @@ Bart Louwers <bart.git@emeel.net>
|
|||
Sam Penny <github.com/sam1penny>
|
||||
Yutsuten <mateus.etto@gmail.com>
|
||||
Zoom <zoomrmc+git@gmail.com>
|
||||
Stefan Kangas <stefankangas@gmail.com>
|
||||
|
||||
********************
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ about 6 gigabytes of temporary files. Once you've created the wheels, you can
|
|||
remove the other files to free up space if you wish.
|
||||
|
||||
- `bazel clean --expunge` will remove the generated Bazel files, freeing up
|
||||
most of the space. The files are usualy stored in a subdir of
|
||||
most of the space. The files are usually stored in a subdir of
|
||||
`~/.cache/bazel` or `\bazel\anki`
|
||||
- `rm -rf ~/.cache/bazel*` or `\bazel\anki` will remove cached downloads as
|
||||
well, requiring them to be redownloaded if you want to build again.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Protocol Buffers
|
||||
|
||||
Anki uses [different implementations of Protocol Buffers](./architecture.md#protobuf)
|
||||
and each has its own pecularities. This document highlights some aspects relevant
|
||||
and each has its own peculiarities. This document highlights some aspects relevant
|
||||
to Anki and hopefully helps to avoid some common pitfalls.
|
||||
|
||||
For information about Protobuf's types and syntax, please see the official [language guide](https://developers.google.com/protocol-buffers/docs/proto3).
|
||||
|
@ -83,8 +83,8 @@ when choosing _Downgrade_), does not make use of Protobuf messages.
|
|||
### Field Numbers
|
||||
|
||||
Field numbers larger than 15 need an additional byte to encode, so `repeated` fields
|
||||
should preferrably be assigned a number between 1 and 15. If a message contains
|
||||
`reserved` fields, this is usually to accomodate potential future `repeated` fields.
|
||||
should preferably be assigned a number between 1 and 15. If a message contains
|
||||
`reserved` fields, this is usually to accommodate potential future `repeated` fields.
|
||||
|
||||
## Implementation-Specific Notes
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ message BackendError {
|
|||
Kind kind = 2;
|
||||
// optional page in the manual
|
||||
optional links.HelpPageLinkRequest.HelpPage help_page = 3;
|
||||
// additional information about the context in which the error occured
|
||||
// additional information about the context in which the error occurred
|
||||
string context = 4;
|
||||
// a backtrace of the underlying error; requires RUST_BACKTRACE to be set
|
||||
string backtrace = 5;
|
||||
|
|
|
@ -259,7 +259,7 @@ message CustomStudyRequest {
|
|||
CRAM_KIND_ALL = 3;
|
||||
}
|
||||
CramKind kind = 1;
|
||||
// the maximimum number of cards
|
||||
// the maximum number of cards
|
||||
uint32 card_limit = 2;
|
||||
// cards must match one of these, if unempty
|
||||
repeated string tags_to_include = 3;
|
||||
|
|
|
@ -74,7 +74,7 @@ py_wheel(
|
|||
"//platforms:macos_x86_64": "macosx_10_13_x86_64",
|
||||
"//platforms:macos_arm64": "macosx_11_0_arm64",
|
||||
# the glibc versions below are set for the official builds;
|
||||
# you can adjust them to suit your enviroment
|
||||
# you can adjust them to suit your environment
|
||||
"//platforms:linux_x86_64": "manylinux_2_28_x86_64",
|
||||
"//platforms:linux_arm64": "manylinux_2_31_aarch64",
|
||||
}),
|
||||
|
|
|
@ -120,7 +120,7 @@ def backslashcase(string):
|
|||
str1 = re.sub(r"_", r"\\", snakecase(string))
|
||||
|
||||
return str1
|
||||
# return re.sub(r"\\n", "", str1)) # TODO: make regex fot \t ...
|
||||
# return re.sub(r"\\n", "", str1)) # TODO: make regex for \t ...
|
||||
|
||||
|
||||
def sentencecase(string):
|
||||
|
@ -249,7 +249,7 @@ def alphanumcase(string):
|
|||
string: String to convert.
|
||||
|
||||
Returns:
|
||||
string: String with cutted non-alphanumeric symbols.
|
||||
string: String with cut non-alphanumeric symbols.
|
||||
|
||||
"""
|
||||
# return filter(str.isalnum, str(string))
|
||||
|
|
|
@ -23,7 +23,7 @@ class SmartDict(dict):
|
|||
See http://www.peterbe.com/plog/SmartDict
|
||||
Copyright 2005, Peter Bengtsson, peter@fry-it.com
|
||||
|
||||
A smart dict can be instanciated either from a pythonic dict
|
||||
A smart dict can be instantiated either from a pythonic dict
|
||||
or an instance object (eg. SQL recordsets) but it ensures that you can
|
||||
do all the convenient lookups such as x.first_name, x['first_name'] or
|
||||
x.get('first_name').
|
||||
|
@ -84,7 +84,7 @@ class SupermemoXmlImporter(NoteImporter):
|
|||
"""
|
||||
|
||||
def __init__(self, col: Collection, file: str) -> None:
|
||||
"""Initialize internal varables.
|
||||
"""Initialize internal variables.
|
||||
Pameters to be exposed to GUI are stored in self.META"""
|
||||
NoteImporter.__init__(self, col, file)
|
||||
m = _legacy_add_basic_model(self.col)
|
||||
|
@ -108,7 +108,7 @@ class SupermemoXmlImporter(NoteImporter):
|
|||
self.cntMeta.popTitles = False
|
||||
self.cntMeta.title = []
|
||||
|
||||
# META stores controls of import scritp, should be
|
||||
# META stores controls of import script, should be
|
||||
# exposed to import dialog. These are default values.
|
||||
self.META = SmartDict()
|
||||
self.META.resetLearningData = False # implemented
|
||||
|
@ -116,7 +116,7 @@ class SupermemoXmlImporter(NoteImporter):
|
|||
self.META.loggerLevel = 2 # implemented 0no,1info,2error,3debug
|
||||
self.META.tagAllTopics = True
|
||||
self.META.pathsToBeTagged = [
|
||||
"English for begginers",
|
||||
"English for beginners",
|
||||
"Advanced English 97",
|
||||
"Phrasal Verbs",
|
||||
] # path patterns to be tagged - in gui entered like 'Advanced English 97|My Vocablary'
|
||||
|
@ -145,7 +145,7 @@ class SupermemoXmlImporter(NoteImporter):
|
|||
|
||||
def _decode_htmlescapes(self, html: str) -> str:
|
||||
"""Unescape HTML code."""
|
||||
# In case of bad formated html you can import MinimalSoup etc.. see BeautifulSoup source code
|
||||
# In case of bad formatted html you can import MinimalSoup etc.. see BeautifulSoup source code
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
# my sm2004 also ecaped & char in escaped sequences.
|
||||
|
@ -254,7 +254,7 @@ class SupermemoXmlImporter(NoteImporter):
|
|||
# normalize - remove diacritic punctuation from unicode chars to ascii
|
||||
item.lTitle = [self._unicode2ascii(topic) for topic in item.lTitle]
|
||||
|
||||
# Transfrom xyz / aaa / bbb / ccc on Title path to Tag xyzAaaBbbCcc
|
||||
# Transform xyz / aaa / bbb / ccc on Title path to Tag xyzAaaBbbCcc
|
||||
# clean things like [999] or [111-2222] from title path, example: xyz / [1000-1200] zyx / xyz
|
||||
# clean whitespaces
|
||||
# set Capital letters for first char of the word
|
||||
|
@ -405,7 +405,7 @@ class SupermemoXmlImporter(NoteImporter):
|
|||
|
||||
# migrate only memorized otherway skip/continue
|
||||
if self.META.onlyMemorizedItems and not (int(smel.Interval) > 0):
|
||||
self.logger("Element skiped \t- not memorized ...", level=3)
|
||||
self.logger("Element skipped \t- not memorized ...", level=3)
|
||||
else:
|
||||
# import sm element data to Anki
|
||||
self.addItemToCards(smel)
|
||||
|
@ -418,11 +418,11 @@ class SupermemoXmlImporter(NoteImporter):
|
|||
"\t{} {}".format((key + ":").ljust(15), smel[key]), level=3
|
||||
)
|
||||
else:
|
||||
self.logger("Element skiped \t- no valid Q and A ...", level=3)
|
||||
self.logger("Element skipped \t- no valid Q and A ...", level=3)
|
||||
|
||||
else:
|
||||
# now we know that item was topic
|
||||
# parseing of whole node is now finished
|
||||
# parsing of whole node is now finished
|
||||
|
||||
# test if it's really topic
|
||||
if smel.Title is not None:
|
||||
|
|
|
@ -52,7 +52,7 @@ def _get_platform(rctx):
|
|||
fail("unexpected platform", rctx.os.name)
|
||||
|
||||
def _impl(rctx):
|
||||
# bundled python overriden?
|
||||
# bundled python overridden?
|
||||
if rctx.os.environ.get("PYO3_PYTHON"):
|
||||
path = rctx.os.environ.get("PYO3_PYTHON")
|
||||
rctx.symlink(path, "python")
|
||||
|
|
|
@ -407,7 +407,7 @@ class AddonManager:
|
|||
force_enable: bool = False,
|
||||
) -> InstallOk | InstallError:
|
||||
"""Install add-on from path or file-like object. Metadata is read
|
||||
from the manifest file, with keys overriden by supplying a 'manifest'
|
||||
from the manifest file, with keys overridden by supplying a 'manifest'
|
||||
dictionary"""
|
||||
try:
|
||||
zfile = ZipFile(file)
|
||||
|
|
|
@ -275,7 +275,7 @@ class Table:
|
|||
|
||||
def _reset_selection(self) -> None:
|
||||
"""Remove selection and focus without emitting signals.
|
||||
If no selection change is triggerd afterwards, `browser.on_all_or_selected_rows_changed()`
|
||||
If no selection change is triggered afterwards, `browser.on_all_or_selected_rows_changed()`
|
||||
and `browser.on_current_row_changed()` must be called.
|
||||
"""
|
||||
self._view.selectionModel().reset()
|
||||
|
|
|
@ -129,7 +129,7 @@ class DeckBrowser:
|
|||
|
||||
_body = """
|
||||
<center>
|
||||
<table cellspacing=0 cellpading=3>
|
||||
<table cellspacing=0 cellpadding=3>
|
||||
%(tree)s
|
||||
</table>
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ class ImportDialog(QDialog):
|
|||
def onDelimiter(self) -> None:
|
||||
|
||||
# Open a modal dialog to enter an delimiter
|
||||
# Todo/Idea Constrain the maximum width, so it doesnt take up that much screen space
|
||||
# Todo/Idea Constrain the maximum width, so it doesn't take up that much screen space
|
||||
delim, ok = getText(
|
||||
tr.importing_by_default_anki_will_detect_the(),
|
||||
self,
|
||||
|
|
|
@ -213,7 +213,7 @@ def _handle_local_file_request(request: LocalFileRequest) -> Response:
|
|||
def _builtin_data(path: str) -> bytes:
|
||||
"""Return data from file in aqt/data folder.
|
||||
Path must use forward slash separators."""
|
||||
# overriden location?
|
||||
# overridden location?
|
||||
if data_folder := os.getenv("ANKI_DATA_FOLDER"):
|
||||
full_path = os.path.join(data_folder, path)
|
||||
with open(full_path, "rb") as f:
|
||||
|
|
|
@ -792,7 +792,7 @@ time = %(time)d;
|
|||
due,
|
||||
)
|
||||
|
||||
buf = "<center><table cellpading=0 cellspacing=0><tr>"
|
||||
buf = "<center><table cellpadding=0 cellspacing=0><tr>"
|
||||
for ease, label in self._answerButtonList():
|
||||
buf += but(ease, label)
|
||||
buf += "</tr></table>"
|
||||
|
|
|
@ -871,7 +871,7 @@ def current_window() -> QWidget | None:
|
|||
|
||||
|
||||
def send_to_trash(path: Path) -> None:
|
||||
"Place file/folder in recyling bin, or delete permanently on failure."
|
||||
"Place file/folder in recycling bin, or delete permanently on failure."
|
||||
if not path.exists():
|
||||
return
|
||||
try:
|
||||
|
|
|
@ -175,7 +175,7 @@ class WebContent:
|
|||
|
||||
Important Notes:
|
||||
- When modifying the attributes specified above, please make sure your
|
||||
changes only perform the minimum requried edits to make your add-on work.
|
||||
changes only perform the minimum required edits to make your add-on work.
|
||||
You should avoid overwriting or interfering with existing data as much
|
||||
as possible, instead opting to append your own changes, e.g.:
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
; !insertmacro APP_ASSOCIATE "txt" "myapp.textfile" "$INSTDIR\myapp.exe,0" \
|
||||
; "Open with myapp" "$INSTDIR\myapp.exe $\"%1$\""
|
||||
;
|
||||
; Never insert the APP_ASSOCIATE macro multiple times, it is only ment
|
||||
; Never insert the APP_ASSOCIATE macro multiple times, it is only meant
|
||||
; to associate an application with a single file and using the
|
||||
; the "open" verb as default. To add more verbs (actions) to a file
|
||||
; use the APP_ASSOCIATE_ADDVERB macro.
|
||||
|
|
|
@ -512,7 +512,7 @@ hooks = [
|
|||
args=["columns: dict[str, aqt.browser.Column]"],
|
||||
doc="""Allows you to add custom columns to the browser.
|
||||
|
||||
columns is a dictionary of data obejcts. You can add an entry with a custom
|
||||
columns is a dictionary of data objects. You can add an entry with a custom
|
||||
column to describe how it should be displayed in the browser or modify
|
||||
existing entries.
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ use strum::IntoStaticStr;
|
|||
|
||||
use crate::prelude::*;
|
||||
|
||||
/// Auxillary deck state, stored in the config table.
|
||||
/// Auxiliary deck state, stored in the config table.
|
||||
#[derive(Debug, Clone, Copy, IntoStaticStr)]
|
||||
#[strum(serialize_all = "camelCase")]
|
||||
pub enum DeckConfigKey {
|
||||
|
|
|
@ -255,7 +255,7 @@ fn split_and_truncate_filename(fname: &str, max_bytes: usize) -> (&str, &str) {
|
|||
}
|
||||
|
||||
/// Return a substring on a valid UTF8 boundary.
|
||||
/// Based on a funtion in the Rust stdlib.
|
||||
/// Based on a function in the Rust stdlib.
|
||||
fn truncated_to_char_boundary(s: &str, mut max: usize) -> &str {
|
||||
if max >= s.len() {
|
||||
s
|
||||
|
|
|
@ -75,7 +75,7 @@ impl<N: Deref<Target = Notetype>> CardGenContext<N> {
|
|||
}
|
||||
|
||||
/// If template[ord] generates a non-empty question given nonempty_fields, return the provided
|
||||
/// deck id, or an overriden one. If question is empty, return None.
|
||||
/// deck id, or an overridden one. If question is empty, return None.
|
||||
fn is_nonempty(&self, card_ord: usize, nonempty_fields: &HashSet<&str>) -> bool {
|
||||
let card = &self.cards[card_ord];
|
||||
let template = match card.template {
|
||||
|
|
|
@ -198,7 +198,7 @@ impl Collection {
|
|||
cutoff_snapshot,
|
||||
}));
|
||||
} else {
|
||||
// we currenly allow the queues to be empty for unit tests
|
||||
// we currently allow the queues to be empty for unit tests
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
@ -68,7 +68,7 @@ pub fn parse_due_date_str(s: &str) -> Result<DueDateSpecifier> {
|
|||
r#"(?x)^
|
||||
# a number
|
||||
(?P<min>\d+)
|
||||
# an optional hypen and another number
|
||||
# an optional hyphen and another number
|
||||
(?:
|
||||
-
|
||||
(?P<max>\d+)
|
||||
|
|
|
@ -271,7 +271,7 @@ mod test {
|
|||
// with the current time being MST
|
||||
let now = mst.ymd(2019, 12, 26).and_hms(20, 0, 0).timestamp();
|
||||
assert_eq!(elap(crt, now, mdt_offset, mst_offset, 4), 507);
|
||||
// the previous implementation generated a diferent elapsed number of days with a change
|
||||
// the previous implementation generated a different elapsed number of days with a change
|
||||
// to DST, but the number shouldn't change
|
||||
assert_eq!(elap(crt, now, mdt_offset, mdt_offset, 4), 507);
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ use super::{is_tag_separator, join_tags, split_tags};
|
|||
use crate::{notes::NoteTags, prelude::*};
|
||||
|
||||
impl Collection {
|
||||
/// Replace occurences of a search with a new value in tags.
|
||||
/// Replace occurrences of a search with a new value in tags.
|
||||
pub fn find_and_replace_tag(
|
||||
&mut self,
|
||||
nids: &[NoteId],
|
||||
|
|
|
@ -87,7 +87,7 @@ impl TimestampMillis {
|
|||
|
||||
fn elapsed() -> time::Duration {
|
||||
if *crate::PYTHON_UNIT_TESTS {
|
||||
// shift clock around rollover time to accomodate Python tests that make bad assumptions.
|
||||
// shift clock around rollover time to accommodate Python tests that make bad assumptions.
|
||||
// we should update the tests in the future and remove this hack.
|
||||
let mut elap = time::SystemTime::now()
|
||||
.duration_since(time::SystemTime::UNIX_EPOCH)
|
||||
|
|
|
@ -12,7 +12,7 @@ export interface SurroundFormat<T = never> {
|
|||
*/
|
||||
matcher: (element: HTMLElement | SVGElement, match: MatchType<T>) => void;
|
||||
/**
|
||||
* @returns Whehter before or after are allowed to merge to a single
|
||||
* @returns Whether before or after are allowed to merge to a single
|
||||
* FormattingNode range
|
||||
*/
|
||||
merger?: (before: FormattingNode<T>, after: FormattingNode<T>) => boolean;
|
||||
|
|
|
@ -381,7 +381,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
Serves as a pre-slotted convenience component which combines all the common
|
||||
components and functionality for general note editing.
|
||||
|
||||
Functionality exclusive to specifc note-editing views (e.g. in the browser or
|
||||
Functionality exclusive to specific note-editing views (e.g. in the browser or
|
||||
the AddCards dialog) should be implemented in the user of this component.
|
||||
-->
|
||||
<div class="note-editor" bind:clientHeight>
|
||||
|
|
|
@ -8,7 +8,7 @@ import type { SymbolsTable } from "./symbols-types";
|
|||
// Not all characters work well in the editor field
|
||||
delete characterEntities["Tab"];
|
||||
|
||||
// A single character entity can be present under differnet names
|
||||
// A single character entity can be present under different names
|
||||
// So we change the mapping to symbol => name[]
|
||||
const characterTable: Record<string, string[]> = {};
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ interface ClosingClickArgs {
|
|||
|
||||
/**
|
||||
* Returns a derived store, which translates `MouseEvent`s into a boolean
|
||||
* indicating whether they constitue a click that should close `floating`.
|
||||
* indicating whether they constitute a click that should close `floating`.
|
||||
*
|
||||
* @param: Should be an event store wrapping document.click.
|
||||
*/
|
||||
|
|
|
@ -17,7 +17,7 @@ interface ClosingKeyupArgs {
|
|||
|
||||
/**
|
||||
* Returns a derived store, which translates `MouseEvent`s into a boolean
|
||||
* indicating whether they constitue a click that should close `floating`.
|
||||
* indicating whether they constitute a click that should close `floating`.
|
||||
*
|
||||
* @param: Should be an event store wrapping document.click.
|
||||
*/
|
||||
|
|
|
@ -69,7 +69,7 @@ export interface DynamicSlottingAPI<
|
|||
* Allow add-on developers to dynamically extend/modify components our components
|
||||
*
|
||||
* @remarks
|
||||
* It allows to insert elements inbetween the components, or modify their props.
|
||||
* It allows to insert elements in between the components, or modify their props.
|
||||
* Practically speaking, we let Svelte do the initial insertion of an element,
|
||||
* but then immediately move it to its destination, and save a reference to it.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue