Skip to content

Commit

Permalink
translations
Browse files Browse the repository at this point in the history
  • Loading branch information
kubk committed Jan 7, 2024
1 parent bfb1690 commit ace708d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 18 deletions.
20 changes: 6 additions & 14 deletions src/screens/folder-form/folder-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,20 @@ export const FolderForm = observer(() => {
}

return (
<Screen title={screen.folderId ? "Edit folder" : "Add folder"}>
<Screen title={screen.folderId ? t("edit_folder") : t("add_folder")}>
<Label text={t("title")} isRequired>
<Input field={folderForm.title} />
</Label>
<Label text={t("description")}>
<Input field={folderForm.description} rows={3} type={"textarea"} />
</Label>
<Label text={"Decks"} isPlain>
<Label text={t("decks")} isPlain>
{folderForm.decks.value.map((deck, i) => {
return (
<SettingsRow key={i}>
<span>{deck.name}</span>
<button
className={cx(
reset.button,
css({
padding: 8,
fontSize: 16,
}),
)}
className={cx(reset.button, css({ padding: 8, fontSize: 16 }))}
onClick={() => {
assert(folderForm);
return folderForm.decks.removeByIndex(i);
Expand All @@ -75,21 +69,19 @@ export const FolderForm = observer(() => {
<i
className={cx(
"mdi mdi-delete-circle mdi-24px",
css({
color: theme.danger,
}),
css({ color: theme.danger }),
)}
/>
</button>
</SettingsRow>
);
})}
</Label>
<Label text={"Add deck to the folder"} isPlain>
<Label text={t("add_deck_to_folder")} isPlain>
{folderStore.decksMine?.state === "pending" && <Loader />}
{folderStore.decksMine?.state === "fulfilled" &&
folderStore.decksMineFiltered.length === 0 ? (
<EmptyState>No more decks to add</EmptyState>
<EmptyState>{t("no_decks_to_add")}</EmptyState>
) : null}
{folderStore.decksMineFiltered.map((deck) => {
return (
Expand Down
6 changes: 2 additions & 4 deletions src/screens/folder-review/folder-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ export const FolderPreview = observer(() => {
icon={"mdi-delete-circle mdi-24px"}
outline
onClick={() => {
showConfirm(
"Do you want to delete the folder? Deleting folder won't remove decks inside the folder",
).then(() => {
showConfirm(t("delete_folder_confirm")).then(() => {
deckListStore.deleteFolder();
});
}}
Expand All @@ -158,7 +156,7 @@ export const FolderPreview = observer(() => {
gap: 6,
})}
>
<ListHeader text={"Decks"} />
<ListHeader text={t("decks")} />
{folder.decks.map((deck) => {
return (
<SettingsRow
Expand Down
28 changes: 28 additions & 0 deletions src/translations/t.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import { getUserLanguage } from "./get-user-language.ts";

const en = {
my_decks: "My decks",
decks: "Decks",
edit_folder: "Edit folder",
add_folder: "Add folder",
add_deck_to_folder: "Add deck to the folder",
no_decks_to_add: "No more decks to add",
show_all_decks: "Show all",
hide_all_decks: "Hide",
no_personal_decks_start: "You don't have any personal deck yet. Feel free to",
Expand Down Expand Up @@ -111,12 +116,19 @@ const en = {
share_deck_access_created_at: "Created at",
share_no_links: "You haven't created any one-time links for this deck",
go_back: "Go back",
delete_folder_confirm:
"Do you want to delete the folder? Deleting folder won't remove decks inside the folder",
};

type Translation = typeof en;

const ru: Translation = {
review_folder: "Повторить папку",
add_deck_to_folder: "Добавить колоду в папку",
add_folder: "Добавить папку",
edit_folder: "Редактировать папку",
no_decks_to_add: "Больше нет колод для добавления",
decks: "Колоды",
my_decks: "Мои колоды",
deck_preview: "Предпросмотр колоды",
show_all_decks: "Показать",
Expand Down Expand Up @@ -224,10 +236,17 @@ const ru: Translation = {
share_perpetual_link: "Поделиться постоянной ссылкой",
share_unused: "Не использована",
go_back: "Назад",
delete_folder_confirm:
"Вы уверены, что хотите удалить папку? Удаление папки не удалит колоды внутри папки",
};

const es: Translation = {
review_folder: "Repasar carpeta",
edit_folder: "Editar carpeta",
add_folder: "Añadir carpeta",
add_deck_to_folder: "Añadir mazo a la carpeta",
no_decks_to_add: "No hay más mazos para añadir",
decks: "Mazos",
my_decks: "Mis mazos",
show_all_decks: "Mostrar todos",
deck_preview: "Vista previa del mazo",
Expand Down Expand Up @@ -339,10 +358,17 @@ const es: Translation = {
share_deck_settings: "Compartir un mazo",
share_perpetual_link: "Compartir enlace perpetuo",
go_back: "Volver",
delete_folder_confirm:
"¿Quieres eliminar la carpeta? Eliminar la carpeta no eliminará los mazos dentro de la carpeta",
};

const ptBr: Translation = {
review_folder: "Revisar pasta",
no_decks_to_add: "Não há mais baralhos para adicionar",
add_deck_to_folder: "Adicionar baralho à pasta",
add_folder: "Adicionar pasta",
edit_folder: "Editar pasta",
decks: "Baralhos",
my_decks: "Meus baralhos",
show_all_decks: "Mostrar todos",
hide_all_decks: "Ocultar",
Expand Down Expand Up @@ -455,6 +481,8 @@ const ptBr: Translation = {
share_one_time_link: "Compartilhar link de acesso único",
share_unused: "Não utilizado",
go_back: "Voltar",
delete_folder_confirm:
"Você quer deletar a pasta? Deletar a pasta não irá remover os baralhos dentro da pasta",
};

const translations = { en, ru, es, "pt-br": ptBr };
Expand Down

0 comments on commit ace708d

Please sign in to comment.