Use American English spelling throughout
This commit is contained in:
1 parent
6ba89696ee
commit
d1731efdb9
169 files changed
+786
-795
No files matched your search
@@ -33,7 +33,7 @@ export function isDomMutationError(err: unknown): boolean {
|
||||
// NotFoundError is what removeChild/insertBefore throw when the node they
|
||||
// were given is not where React last saw it. The name is checked first
|
||||
// because it is the reliable half -- the message is browser-specific and
|
||||
// localised, so matching on it alone would work in English Chrome and
|
||||
// localized, so matching on it alone would work in English Chrome and
|
||||
// nowhere else, which for a translation bug would be a poor joke.
|
||||
if (err.name === "NotFoundError" || err.name === "HierarchyRequestError") return true;
|
||||
return /removeChild|insertBefore|replaceChild|not a child of this node/i.test(err.message);
|
||||
@@ -83,7 +83,7 @@ export class TranslateBoundary extends Component<Props, State> {
|
||||
/*
|
||||
* console.info, not console.error. A reader translating the page is not a
|
||||
* fault, and logging it as one would put an entry in every error reporter
|
||||
* that reads the console, for behaviour that is expected and recovered
|
||||
* that reads the console, for behavior that is expected and recovered
|
||||
* from. The marker is here to be counted, not alarmed at.
|
||||
*/
|
||||
console.info(
|
||||
|
||||
@@ -12,7 +12,7 @@ import { TranslateBoundary, isDomMutationError } from "../TranslateBoundary";
|
||||
* (facebook/react#11538). The boundary's job is to put the subtree back
|
||||
* instead, and to leave everything that is not that alone.
|
||||
*/
|
||||
describe("recognising the translator's damage", () => {
|
||||
describe("recognizing the translator's damage", () => {
|
||||
it("knows the DOM errors Chrome's rewriting produces", () => {
|
||||
const notFound = new Error("Failed to execute 'removeChild' on 'Node'");
|
||||
notFound.name = "NotFoundError";
|
||||
@@ -21,11 +21,11 @@ describe("recognising the translator's damage", () => {
|
||||
});
|
||||
|
||||
it("matches on the error name as well as the message", () => {
|
||||
// The message is browser-specific and localised. Matching only on English
|
||||
// The message is browser-specific and localized. Matching only on English
|
||||
// text would be a translation bug that only works in English.
|
||||
const localised = new Error("Знайдений вузол не є дочірнім");
|
||||
localised.name = "NotFoundError";
|
||||
expect(isDomMutationError(localised)).toBe(true);
|
||||
const localized = new Error("Знайдений вузол не є дочірнім");
|
||||
localized.name = "NotFoundError";
|
||||
expect(isDomMutationError(localized)).toBe(true);
|
||||
});
|
||||
|
||||
it("does not claim an ordinary bug", () => {
|
||||
@@ -84,7 +84,7 @@ describe("the boundary", () => {
|
||||
it("logs the recovery as information, not as an error", () => {
|
||||
// A reader translating the page is expected and recovered from. Logging it
|
||||
// as an error would file a bug report in every console-reading reporter,
|
||||
// every time, for behaviour that worked.
|
||||
// every time, for behavior that worked.
|
||||
const fails = { left: 2 };
|
||||
const info = vi.spyOn(console, "info").mockImplementation(() => {});
|
||||
const error = vi.spyOn(console, "error").mockImplementation(() => {});
|
||||
|
||||
@@ -168,7 +168,7 @@ function toIsoDateTime(d: Date): string {
|
||||
return `${toLocalDateOnly(d)}T${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
||||
}
|
||||
|
||||
/** Shared text-box behaviour: type freely, commit on blur or Enter, revert what won't parse. */
|
||||
/** Shared text-box behavior: type freely, commit on blur or Enter, revert what won't parse. */
|
||||
function useTextField(value: string, display: (v: string) => string, commit: (text: string) => boolean) {
|
||||
const [text, setText] = useState(() => display(value));
|
||||
const [editing, setEditing] = useState(false);
|
||||
|
||||
@@ -97,7 +97,7 @@ export interface DialogChoice {
|
||||
* The safe answer, given the weight a dialog's confirm button has.
|
||||
*
|
||||
* A list of choices has no default until one is said to be, and the
|
||||
* destructive one must not become it by being the only thing with a colour --
|
||||
* destructive one must not become it by being the only thing with a color --
|
||||
* which is what "Discard changes" was, on a guard whose whole purpose is to
|
||||
* stop you losing work ([#175]).
|
||||
*
|
||||
|
||||
@@ -154,7 +154,7 @@ export function FilePreviewDialog({
|
||||
*
|
||||
* The bytes have to be fetched rather than the URL passed along, because the
|
||||
* share sheet takes a File. `same-origin` credentials because both URLs are
|
||||
* ihasmail's own blob proxy and it is the session cookie that authorises the
|
||||
* ihasmail's own blob proxy and it is the session cookie that authorizes the
|
||||
* read -- which is also why this does not break the rule about `ui/` not
|
||||
* reaching for the JMAP client: it is a plain fetch of a URL the caller
|
||||
* already handed over.
|
||||
|
||||
@@ -6,7 +6,7 @@ import { t } from "@/lib/i18n";
|
||||
* A QR code as inline SVG.
|
||||
*
|
||||
* Drawn as one path of square modules so it scales cleanly and inherits the
|
||||
* current colour, which keeps it legible in both themes without a second
|
||||
* current color, which keeps it legible in both themes without a second
|
||||
* rendering path. Error correction is set to M: enough tolerance for a phone
|
||||
* camera pointed at a screen, without inflating the module count.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user