Skip to content

Commit

Permalink
More translations
Browse files Browse the repository at this point in the history
  • Loading branch information
kubk committed Apr 9, 2024
1 parent d7f8189 commit 9862dc5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import confetti from "canvas-confetti";
import { showAlert } from "../lib/telegram/show-alert.ts";
import { showAlert } from "../../lib/telegram/show-alert.ts";

export const notifyPaymentSuccess = () => {
confetti({
Expand Down
8 changes: 4 additions & 4 deletions src/store/deck-list-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import { showConfirm } from "../lib/telegram/show-confirm.ts";
import { t } from "../translations/t.ts";
import { canDuplicateDeckOrFolder } from "../../shared/access/can-duplicate-deck-or-folder.ts";
import { hapticImpact } from "../lib/telegram/haptics.ts";
import {
notifyPaymentFailed,
notifyPaymentSuccess,
} from "../ui/notify-payment.ts";
import { FolderWithDecksWithCards } from "../../functions/db/folder/get-folder-with-decks-with-cards-db.ts";
import { type FolderWithDeckIdDbType } from "../../functions/db/folder/schema.ts";
import { CatalogFolderDbType } from "../../functions/db/folder/get-public-folders-with-decks-db.ts";
import {
notifyPaymentFailed,
notifyPaymentSuccess,
} from "../screens/shared/notify-payment.ts";

export enum StartParamType {
RepeatAll = "repeat_all",
Expand Down
4 changes: 4 additions & 0 deletions src/translations/t.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ const en = {
freeze_for_or_manual: "or type manually",
freeze_notified: "You'll get notified on",
freeze_hint: "Postpone studying cards",
ui_loading: "Loading...",
};

type Translation = typeof en;
Expand Down Expand Up @@ -435,9 +436,11 @@ const ru: Translation = {
validate_positive: "Пожалуйста, введите положительное число",
validate_under_100: "Пожалуйста, введите число меньше 100",
freeze_hint: "Отложите изучение карточек",
ui_loading: "Загрузка...",
};

const es: Translation = {
ui_loading: "Cargando...",
yes_no: "Recordar",
answer: "Tipo de tarjeta",
answer_type_explanation_choice: `Una tarjeta con opciones de respuesta`,
Expand Down Expand Up @@ -659,6 +662,7 @@ const es: Translation = {
};

const ptBr: Translation = {
ui_loading: "Carregando...",
yes_no: "Lembrar",
answer: "Tipo de cartão",
answer_type_explanation_choice: `Um cartão com opções de resposta`,
Expand Down
5 changes: 4 additions & 1 deletion src/ui/select-with-chevron.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { theme } from "./theme.tsx";
import { css } from "@emotion/css";
import { ChevronIcon } from "./chevron-icon.tsx";
import { Select } from "./select.tsx";
import { t } from "../translations/t.ts";

type Option<T extends string | number> = {
label: string;
Expand All @@ -24,7 +25,9 @@ export const SelectWithChevron = <T extends string | number>(
const selectRef = useRef<HTMLSelectElement | null>(null);

if (isLoading) {
return <div className={css({ color: theme.hintColor })}>Loading...</div>;
return (
<div className={css({ color: theme.hintColor })}>{t("ui_loading")}</div>
);
}

return (
Expand Down
5 changes: 4 additions & 1 deletion src/ui/select.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import { theme } from "./theme.tsx";
import { css } from "@emotion/css";
import { t } from "../translations/t.ts";

type Option<T extends string | number> = {
label: string;
Expand All @@ -18,7 +19,9 @@ type Props<T extends string | number> = {
export const Select = <T extends string | number>(props: Props<T>) => {
const { value, onChange, options, isLoading, selectRef } = props;
if (isLoading) {
return <div className={css({ color: theme.hintColor })}>Loading...</div>;
return (
<div className={css({ color: theme.hintColor })}>{t("ui_loading")}</div>
);
}

return (
Expand Down

0 comments on commit 9862dc5

Please sign in to comment.