Skip to content

Commit

Permalink
add missing translations (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmintey authored Jan 15, 2025
2 parents 2952d2f + 666cb7a commit 13d9df3
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"make-admin": "Make Admin",
"manager": "Manager",
"members": "Members",
"password-reset-link": "Password reset link",
"password-strength-requirement": "Password Strength Requirement",
"password-strength-warning": "Use caution when changing or disabling this value! If disabled, any password of 1 character or more will be allowed.",
"profile": "Profile",
Expand Down Expand Up @@ -208,6 +209,7 @@
"mode": "Mode",
"moderate": "Moderate",
"name-optional": "Name (optional)",
"no-file-selected": "No file selected",
"off": "Off",
"ok": "OK",
"oops": "Oops! Something went wrong.",
Expand All @@ -220,6 +222,7 @@
"saved": "Saved",
"search": "Search",
"search-for-user": "Search for a user to add to the group",
"select-file": "Select File",
"select-group": "Select Group",
"select-user-group": "Select a group for the user to join. An invite link will be generated",
"smtp-is-not-enabled": "SMTP is not enabled",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ListCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
let { hideCount = false, hasNewItems = false, list, preventNavigate = false }: Props = $props();
let listName = $derived(list.name || `${list.owner.name}'s Wishes`);
let listName = $derived(list.name || $t("wishes.wishes-for", { values: { listOwner: list.owner.name } }));
let iconColor = $derived(list.iconColor);
let elementTag = $derived(preventNavigate ? "div" : "a");
let element: HTMLElement | undefined = $state();
Expand Down
20 changes: 18 additions & 2 deletions src/lib/components/wishlists/ItemForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type { Item, ItemPrice } from "@prisma/client";
import Backdrop from "$lib/components/Backdrop.svelte";
import { env } from "$env/dynamic/public";
import { getToastStore } from "@skeletonlabs/skeleton";
import { FileButton, getToastStore } from "@skeletonlabs/skeleton";
import { getPriceValue } from "$lib/price-formatter";
import CurrencyInput from "../CurrencyInput.svelte";
import { t } from "svelte-i18n";
Expand All @@ -25,6 +25,8 @@
let price: number | null = $state(getPriceValue(productData));
const defaultCurrency = env.PUBLIC_DEFAULT_CURRENCY || "USD";
let userCurrency: string = $derived(productData.itemPrice?.currency || defaultCurrency);
let files: FileList | undefined = $state();
let uploadedImageName: string | undefined = $derived(files?.item(0)?.name || $t("general.no-file-selected"));
const extractUrl = (url: string) => {
const urlRegex = /(https?):\/\/[^\s/$.?#].[^\s]*/;
Expand Down Expand Up @@ -167,7 +169,21 @@

<label class="col-span-1 md:col-span-2" for="image">
<span>{$t("wishes.upload-image")}</span>
<input id="image" name="image" class="input" accept="image/*" type="file" />
<div
class="bg-surface-200-700-token border-surface-400-500-token grid grid-cols-[auto_1fr] items-center gap-2 border-token rounded-token"
>
<FileButton
id="image"
name="image"
class="py-1 pl-1"
accept="image/*"
button="btn btn-sm variant-filled"
bind:files
>
{$t("general.select-file")}
</FileButton>
<span>{uploadedImageName}</span>
</div>
</label>

<label class="col-span-1 md:col-span-4" for="image_url">
Expand Down
4 changes: 3 additions & 1 deletion src/routes/admin/groups/[groupId]/members/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
else await groupAPI.removeManager(userId);
await invalidateAll();
}
},
buttonTextCancel: $t("general.cancel"),
buttonTextConfirm: $t("general.confirm")
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/routes/admin/users/[username]/+page@.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@
</form>

{#if form?.success && form?.url}
<TokenCopy url={form.url}>Password reset link</TokenCopy>
<TokenCopy url={form.url}>{$t("admin.password-reset-link")}</TokenCopy>
{/if}

0 comments on commit 13d9df3

Please sign in to comment.