Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add discountable-form translations (es and en). #6854

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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