Skip to content

Commit

Permalink
Add discountable-form translations (es and en).
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrodcaball committed Mar 28, 2024
1 parent 5e53b91 commit 199d0f6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
5 changes: 4 additions & 1 deletion packages/admin-ui/ui/public/locales/en/translation.json
Expand Up @@ -2007,5 +2007,8 @@
"users-the-team": "The Team",
"users-manage-users-of-your-medusa-store": "Manage users of your Medusa Store",
"users-count_one": "{{count}}",
"users-count_other": "{{count}}"
"users-count_other": "{{count}}",
"discountable-form-discountable": "Discountable",
"discountable-form-hint-gift-card": "When unchecked discounts will not be applied to this gift card.",
"discountable-form-hint-product": "When unchecked discounts will not be applied to this product."
}
5 changes: 4 additions & 1 deletion packages/admin-ui/ui/public/locales/es/translation.json
Expand Up @@ -1920,5 +1920,8 @@
"users-the-team": "El Equipo",
"users-manage-users-of-your-medusa-store": "Administrar usuarios de tu Tienda Medusa",
"users-count_one": "{{count}}",
"users-count_other": "{{count}}"
"users-count_other": "{{count}}",
"discountable-form-discountable": "Descontable",
"discountable-form-hint-gift-card": "Cuando no esté marcado, esta tarjeta de regalo no se descontará del inventario.",
"discountable-form-hint-product": "Cuando no esté marcado, este producto no se descontará del inventario."
}
@@ -1,6 +1,7 @@
import { Controller } from "react-hook-form"
import { NestedForm } from "../../../../utils/nested-form"
import Switch from "../../../atoms/switch"
import { useTranslation } from "react-i18next"

export type DiscountableFormType = {
value: boolean
Expand All @@ -12,11 +13,14 @@ type Props = {
}

const DiscountableForm = ({ form, isGiftCard }: Props) => {
const { t } = useTranslation()
const { control, path } = form
return (
<div>
<div className="mb-2xsmall flex items-center justify-between">
<h2 className="inter-base-semibold">Discountable</h2>
<h2 className="inter-base-semibold">
{t("discountable-form-discountable", "Discountable")}
</h2>
<Controller
control={control}
name={path("value")}
Expand All @@ -26,8 +30,15 @@ const DiscountableForm = ({ form, isGiftCard }: Props) => {
/>
</div>
<p className="inter-base-regular text-grey-50">
When unchecked discounts will not be applied to this{" "}
{isGiftCard ? "gift card" : "product"}.
{isGiftCard
? t(
"discountable-form-hint-gift-card",
"When unchecked discounts will not be applied to this gift card."
)
: t(
"discountable-form-hint-product",
"When unchecked discounts will not be applied to this product."
)}
</p>
</div>
)
Expand Down

0 comments on commit 199d0f6

Please sign in to comment.